I'm asking because the definition of MoveConstructible, as
specified by the current C++0x working draft
<www.open-std.org/JTC1/sc22/WG21>, may still need some finetuning.
Juha Nieminen wrote:
I thought concepts were dropped from C++0x.
Yes, indeed. But C++0x will still use terms like
"MoveConstructible" to specify the requirements of std library
templates. For example, when defining std::swap:
template<class T> void swap(T& a, T& b);
Requires: Type T shall be MoveConstructible and MoveAssignable.
Effects: Exchanges values stored in two locations.
See
http://www.open-std.org/JTC1/sc22/WG21/docs/papers/2010/n3035.pdf
The term MoveConstructible is defined in Table 33:
Table 33 - MoveConstructible requirements [moveconstructible]
Expression Post-condition
T t(rv) t is equivalent to the value of rv before the construction
So now I wonder which of those four types are MoveConstructible:
typedef int T1;
typedef const int T2;
typedef std::unique_ptr<int> T3;
typedef const std::unique_ptr<int> T4;
In my opinion, T1, T2, and T3. Being CopyConstructible is sufficient
for the first two, and T3 has a move constructor.
copied. The constness would stop it from being cast to unique_ptr&&,
so it can't be moved either.