Topic: Shouldn't std::deque be MoveConstructible like std::vector?


Author: LeighJohnston <leigh.v.johnston@googlemail.com>
Date: Mon, 13 Jul 2009 13:45:22 CST
Raw View
Hi,

Just looked at the latest version of C++0x draft (June) and I might
have spotted an error, not sure...

Shouldn't std::deque be MoveConstructible like std::vector?  If you
insert elements in the middle of a deque then most of the
"reallocations" will be done with MoveAssign however the elements at
the end of the controlled sequence will need MoveConstruct surely?
Perhaps I am missing something, I am a concepts n00b.

/Leigh

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@googlemail.com>
Date: Tue, 21 Jul 2009 16:44:54 CST
Raw View
On Jul 13, 9:45 pm, LeighJohnston <leigh.v.johns...@googlemail.com>
wrote:
> Just looked at the latest version of C++0x draft (June) and I might
> have spotted an error, not sure...
>
> Shouldn't std::deque be MoveConstructible like std::vector?  If you
> insert elements in the middle of a deque then most of the
> "reallocations" will be done with MoveAssign however the elements at
> the end of the controlled sequence will need MoveConstruct surely?
> Perhaps I am missing something, I am a concepts n00b.

Yes, std::deque should definitively be moveable, see the currently
active library issue

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#976

Greetings from Bremen,

Daniel Kr   gler


--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]