Using incomplete types to instantiate STL-Templates?
Wolfgang Bangerth
bangerth@ices.utexas.edu
Wed Apr 30 17:19:00 GMT 2003
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/
More information about the Gcc
mailing list