#include <variant> #include <iostream> #include <type_traits> struct C1 { struct A { int a = 0; }; std::variant<A> var; }; struct C2 { struct A { int a = 0; }; std::variant<std::monostate, A> var; }; int main() { std::cout << std::is_default_constructible_v<C1::A> << std::endl; // prints 0 std::cout << std::is_default_constructible_v<C2::A> << std::endl; // prints 1 return 0; }