Why I can’t use types which can only be constructed by default and move in std::variant
?
#include <variant>
struct M1 { M1(M1&&){} M1(){} };
struct M2 { M2(M2&&){} M2(){} };
int main()
{
std::variant<M1,M2> var=M1{};
var=M1{};
}
I want to use it with classes containing std::unique_ptr
…