Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yury-fedorov opened this issue Jan 22, 2023 · 1 comment

Comments

@yury-fedorov
Copy link

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")

@melg8
Copy link

melg8 commented May 28, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants