Suppose we have a non-copyable type X:
struct X
{
X(X&&) = default;
X(const X&) = delete;
}
Then, naturally, we cannot copy a container having X as value type:
std::set<X> v;
std::set<X> v2{v} // error
My question is, whether the expression that involves such a copy is well-formed? For instance, the following expression compiles:
sizeof( std::set<X>{v} )
I am asking since I run into the following problem:
std::cout << std::is_copy_constructible_v< X >;
std::cout << std::is_copy_constructible_v< std::set<X> >;
Which prints out 01. It's a bit counter-intuitive that std::set<X> is "reported" being copy-constructible when in fact it is not (by means of that its copy constructor cannot be called).