[libcxx-commits] [libcxx] [libc++] Add container_traits (prework for `std::flat_map`) (PR #109578)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Sep 27 10:36:30 PDT 2024
================
@@ -2609,6 +2611,18 @@ inline constexpr bool __format::__enable_insertable<std::deque<wchar_t>> = true;
#endif // _LIBCPP_STD_VER >= 20
+template <class _Tp, class _Allocator>
+struct __container_traits<deque<_Tp, _Allocator> > {
+ // http://eel.is/c++draft/deque.modifiers#3
+ // If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move
+ // assignment operator of T, there are no effects. If an exception is thrown while inserting a single element at
+ // either end, there are no effects. Otherwise, if an exception is thrown by the move constructor of a
+ // non-Cpp17CopyInsertable T, the effects are unspecified.
+ using __emplacement_has_strong_exception_safety_guarantee =
+ _Or<is_nothrow_move_constructible<_Tp>,
+ __is_cpp17_copy_insertable<typename deque<_Tp, _Allocator>::allocator_type> >;
----------------
ldionne wrote:
```suggestion
__is_cpp17_copy_insertable<_Allocator> >;
```
https://github.com/llvm/llvm-project/pull/109578
More information about the libcxx-commits
mailing list