martinmoene / span-lite

span lite - A C++20-like span for C++98, C++11 and later in a single-file header-only library
Boost Software License 1.0
497 stars 41 forks source link

Include `stdexcept` if exceptions enabled #42

Closed flexferrum closed 5 years ago

flexferrum commented 5 years ago

Resolves #41

Currently, span.hpp includes stdexcept only if contract violation enabled. But throws std::out_of_range under the simple ! span_CONFIG( NO_EXCEPTIONS ) check. This PR fixes this issue and allows std exception when exceptions enabled.