This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using incomplete types to instantiate STL-Templates?
- From: Wolfgang Bangerth <bangerth at ices dot utexas dot edu>
- To: gcc at gcc dot gnu dot org, <gdr at integrable-solutions dot net>, Christian Ehrhardt <ehrhardt at mathematik dot uni-ulm dot de>
- Date: Wed, 30 Apr 2003 11:45:17 -0500 (CDT)
- Subject: 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/