// Copyright 2021 Peter Dimov. // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include using namespace boost::variant2; template class X: variant { using base = variant; using base::base; }; struct Y { Y( Y const& rhs ) = default; template Y( T const& t ) { t.bar(); } }; int main() { using W = X; W a( 1 ); W b( a ); (void)b; }