this fixes build error when built with c++14 and no exceptions
Details
Diff Detail
Event Timeline
include/experimental/optional | ||
---|---|---|
524 | If this kind of code is going to show up in lots of places, then maybe wrap it up in a macro: _LIBCPP_THROW_OR_ASSERT(bad_optional_access(), "bad optional access") ? With some extra preprocessor magic, and if LLVM didn't care about the string in the assert, could even leave out the second parameter |
include/experimental/optional | ||
---|---|---|
524 | In D14653 (which did not land), I had used a _LIBCPP_THROW macro for a similar purpose (see changes in config/include). Currently there is no uniform mechanism adopted in the library for throwing exceptions. I agree that it would be nice to fix this. I will revive that part of D14653 soon. Thanks for the reminder! |
It's a good idea. Currently, there are about 600+ "throws" being
guarded by _LIBCPP_NO_EXCEPTIONS macro.
How about let's merge the patch now and I can do the conversion of
existing code to the wrapper in background?
Weiming
Just a reminder - the people who can approve patches for libc++ are @mclow.lists and @EricWF.
If this kind of code is going to show up in lots of places, then maybe wrap it up in a macro:
?
With some extra preprocessor magic, and if LLVM didn't care about the string in the assert, could even leave out the second parameter