mpark / variant

C++17 `std::variant` for C++11/14/17
https://mpark.github.io/variant
Boost Software License 1.0
659 stars 88 forks source link

Add support for compilation with exceptions disabled #30

Closed gcardwel closed 7 years ago

gcardwel commented 7 years ago

If compiler support for exceptions is turned off, usually via -fno-exceptions command line switch on gcc/clang, then std::variant can never be in the valueless_by_exception state. Thus, you should then be able to call std::visit<>() or std::get<>() without them doing the test for empty or having them call throw.

As it stands now, you can't compile variant without having exception support enabled.

mpark commented 7 years ago

Closed by https://github.com/mpark/variant/commit/840f86b1f47275eb03c7f0d068d9eefc1774e3ab