This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Using incomplete types to instantiate STL-Templates?


Note that libstdc++ _does_ actually accept the code Christian showed. It 
only rejects it if concepts checking is on. I think that's weird, and 
personally consider it a defect in the way the concepts checks are 
implemented. 

In this case, the concepts checks are placed at class declaration level,
which is too early. Since std::list only stores pointers to objects, the 
class pointed to needs not be complete at this time. It would be 
sufficient to place the concepts check into one of the member functions, 
by which the requirement of completeness of _Tp would be deferred.

However, that's just a layman's opinion :-)

W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:            bangerth@ices.utexas.edu
                               www: http://www.ices.utexas.edu/~bangerth/



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