Consider the following classes.
struct with_copy {
with_copy() = default;
with_copy(with_copy const&) {}
with_copy& operator=(with_copy c
I'm not quite sure what you tested but it foo
is surely both move assignable and move constructible. Admittedly, this doesn't say anything about a move constructor or a move assignment being accessible, just that construction or assignment from an rvalue works. Both clang (clang version 3.5 (trunk 196718)) and gcc (gcc version 4.9.0 20131031 (experimental) (GCC)) agree with this assessment. This is the complete source I tried:
#include
#include
#include
struct with_copy {
with_copy() = default;
with_copy(with_copy const&) {}
with_copy& operator=(with_copy const&) { return *this; }
};
struct foo {
with_copy c;
std::unique_ptr p;
};
int main()
{
std::cout << "move constructible: "
<< std::is_move_constructible::value << '\n';
std::cout << "move assignable: "
<< std::is_move_assignable::value << '\n';
foo f0;
foo f1 = std::move(f0);
f0 = std::move(f1);
}