Given the following code:
struct X
{
explicit X() {}
X( const X & ) = delete;
X & operator=( const X & ) = delete;
X( X && ) = default;
X & operator=( X && ) = default;
};
int
main()
{
std::vector<X> t;
t = { X{} };
return 0;
}
is it supposed to fail? Until now, I assumed that std::vector would be move-initialized from the initializer list, but at least with g++ 7.4 in C++17, the initialization of the vector is done via the copy constructor.