This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: Re: [Patch] Remove workaround for copy_backward


Gabriel Dos Reis <gdr@integrable-solutions.net> writes:

| Here is my take on the template constructror issue.  It is out of
| question to add a dummy argument, because:
|  (1) it an ABI breaking -- I do not have a strong opinion here;
|  (2) it makes us potentially accept "invalid" constructs -- even though
|      it may a harmless one.  For some reasons, people tend to use/depend
|      on things we think harmless; I'm pretty sure we'll get questions
|      like: "why does not vector<> use by nth argument?".

I'll add a third item

  (3) breaks conforming codes (even if we may disagree on their being
      good practice)

     I'd take my favorite example, page 9 from
http://www.cmla.ens-cachan.fr/~dosreis/C++/talks/generic-programming-in-cxx.pdf

     #include <vector>
     struct X {
        explicit X(int) { }
     };   

     int main()
     {
        std::vector<X> w(25, 4);                // OK
     }

    With enable-if work-around as proposed, the above will be
    (incorrectly) rejected. If you think it is contrived example (and
    I conceide the point), think
  
      std::vector<std::vector<int> > matrix(3, 3);

    I've already seen codes like that.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]