Movables in std::vector

Paolo Carlini paolo.carlini@oracle.com
Wed Oct 12 20:56:00 GMT 2011


On 10/12/2011 10:48 PM, Magnus Fromreide wrote:
> Hello.
>
> Using trunk and c++0x-mode I tried to use a vector of a movable, but not
> copyable, type.
>
> That failed.
>
> Looking inside stl_vector.h I find the following code line:
>
>         __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
>
> and that seems to indicate that movable types aren't yet allowed in
> vectors. Is that intentional?
Those concept-checks are very-very old and haven't been updated for 
C++11. If you ask me, I suspect they will never be, frankly, unless 
somebody volunteers, and still, the whole technology is rather weak if 
assessed today, after all the serious work on real Concepts, there are 
some subtle cases that simply you can't get right with that approach. 
Thus, sorry, just don't use -D_GLIBCPP_CONCEPT_CHECKS together with 
-std=c++0x/gnu++0x.

Paolo.



More information about the Libstdc++ mailing list