[libcxx-commits] [PATCH] D62228: Make `vector` unconditionally move elements when exceptions are disabled.
Marshall Clow via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 22 07:03:33 PDT 2019
mclow.lists added a comment.
I'm not particularly in favor of this patch.
There was a discussion on the mailing list that (to my mind) petered out with no particular conclusion as to whether or not this was a good idea.
I not that fond of `-fno-exceptions` in general, **and** I think that special-casing `vector` here is the wrong approach.
If we really want to embrace this (and I don't), I think we should change `move_if_noexcept` (and the other noexcept type traits) to return true when exceptions are disabled.
Also, these functions `__construct_backward` and `__construct_forwards` should be free functions, not non-standard extensions to `allocator_traits` (but that's existing code)
================
Comment at: include/utility:284
+#else
+ false,
#endif
----------------
Why an enum?
How about:
```
#ifdef _LIBCPP_NO_EXCEPTIONS
_LIBCPP_BOOL_CONSTANT(true) __exceptions_disabled;
#else
_LIBCPP_BOOL_CONSTANT(false) __exceptions_disabled;
#endif
```
Repository:
rCXX libc++
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62228/new/
https://reviews.llvm.org/D62228
More information about the libcxx-commits
mailing list