range-v3 icon indicating copy to clipboard operation
range-v3 copied to clipboard

Currently not possible to compile range-v3 with -fno-exceptions flag set

Open yury-fedorov opened this issue 3 years ago • 3 comments

Adding -fno-exceptions as a compilation flag into a project dependent from range-v3 leads to the following errors:

range-v3-src/include/meta/meta.hpp:410:35: error: cannot use 'throw' with exceptions disabled throw "The start of the integer_sequence must not be " range-v3-src/include/range/v3/detail/variant.hpp:455:17: error: cannot use 'throw' with exceptions disabled throw bad_variant_access("bad variant access"); range-v3-src/include/range/v3/view/interface.hpp:314:17: error: cannot use 'throw' with exceptions disabled throw std::out_of_range("view_interface::at"); range-v3-src/include/range/v3/view/interface.hpp:327:17: error: cannot use 'throw' with exceptions disabled throw std::out_of_range("view_interface::at"); range-v3-src/include/range/v3/utility/optional.hpp:79:13: error: cannot use 'throw' with exceptions disabled throw bad_optional_access{}; range-v3-src/include/range/v3/range/operations.hpp:53:53: error: cannot use 'throw' with exceptions disabled throw std::out_of_range("ranges::at")

yury-fedorov avatar Jan 22 '23 22:01 yury-fedorov

Also encountered same issue with line: throw bad_variant_access("bad variant access"); it would be nice to have something like define switch to change behaviour of this places into other than exception way to report issue. Not that many places in library actually throw. @yury-fedorov did you endup with any sort of workarounds?

melg8 avatar May 28 '23 02:05 melg8