Movables in std::vector
Marc Glisse
marc.glisse@inria.fr
Thu Oct 13 05:35:00 GMT 2011
On Wed, 12 Oct 2011, Magnus Fromreide wrote:
> 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)
Funny how _SGIAssignableConcept is always the one that causes trouble. It
already breaks many things in C++03, and since I removed it locally I
haven't had other false positives.
> and that seems to indicate that movable types aren't yet allowed in
> vectors. Is that intentional?
>
> On the other hand http://gcc.gnu.org/onlinedocs/libstdc
> ++/manual/status.html#status.iso.200x seems to indicate that the c++11
> support is finished in vector so that is a little confusing.
http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt02ch05s02.html
"Please note that the checks are based on the requirements in the
original C++ standard, some of which have changed in the upcoming C++0x
revision. Additionally, some correct code might be rejected by the
concept checks, for example template argument types may need to be
complete when used in a template definition, rather than at the point of
instantiation. There are no plans to address these shortcomings."
--
Marc Glisse
More information about the Libstdc++
mailing list