[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


================
@@ -1544,6 +1545,17 @@ erase(forward_list<_Tp, _Allocator>& __c, const _Up& __v) {
 }
 #endif
 
+template <class _Tp, class _Allocator>
+struct __container_traits<forward_list<_Tp, _Allocator> > {
+  // http://eel.is/c++draft/container.reqmts
+  // 66 Unless otherwise specified (see [associative.reqmts.except], [unord.req.except], [deque.modifiers],
+  // [inplace.vector.modifiers], and [vector.modifiers]) all container types defined in this Clause meet the following
+  // additional requirements:
+  // - (66.1) If an exception is thrown by an insert() or emplace() function while inserting a single element, that
----------------
ldionne wrote:

```suggestion
  // - If an exception is thrown by an insert() or emplace() function while inserting a single element, that
```

These numbers won't age well!

https://github.com/llvm/llvm-project/pull/109578


More information about the libcxx-commits mailing list