martinmoene / optional-lite

optional lite - A C++17-like optional, a nullable object for C++98, C++11 and later in a single-file header-only library
Boost Software License 1.0
403 stars 45 forks source link

Compilation is broken with exceptions disabled #47

Closed viettrungluu closed 5 years ago

viettrungluu commented 5 years ago

Compilation is broken with exceptions disabled (for current HEAD of master).

I get

.../optional_lite/include/nonstd/optional.hpp:1662:22: error: 'nonstd::optional_lite::bad_optional_access' has not been declared
 using optional_lite::bad_optional_access;
                      ^

Presumably https://github.com/martinmoene/optional-lite/blob/4c4da9074ac4c779bb81332fd82292edd8a6089d/include/nonstd/optional.hpp#L1662 should be gated on #if ! optional_CONFIG_NO_EXCEPTIONS.

I'd be happy to send a PR.