It hits the error C3445: copy-list-initialization of 'std::pair<std::string, nonstd::blah>... which we assume is because in our setup, this is observed as false:
While the same for std::variant evaluates to true. This then makes std::pair constructor to be explicit which in turn removes the possibility of using a wide range of valid codes like this:
using foo = nonstd::variant<std::string>;
using bar = std::map<std::string, foo>;
auto zoo = bar{{"hello", "world"}};
Hi
The following code does not compile using MSVC 142 (19.35.32215 from VS 2022) using C++14 standard
It hits the error
C3445: copy-list-initialization of 'std::pair<std::string, nonstd::blah>...
which we assume is because in our setup, this is observed asfalse
:While the same for
std::variant
evaluates to true. This then makesstd::pair
constructor to beexplicit
which in turn removes the possibility of using a wide range of valid codes like this: