0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

24 Containers library 24.2 Requirements [container.requirements] [containers] C++N4910:2022 (638) p841.cpp

Last updated at Posted at 2022-08-04

はじめに(Introduction)

N4910 Working Draft, Standard for Programming Language C++
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf

n4910は、ISO/IEC JTC1 SC22 WG21の作業原案(Working Draft)です。
公式のISO/IEC 14882原本ではありません。
ISO/IEC JTC1 SC22 WG21では、可能な限り作業文書を公開し、幅広い意見を求めています。
一連の記事はコード断片をコンパイルできる形にする方法を検討してコンパイル、リンク、実行して、規格案の原文と処理系(g++, Clang++)との違いを確認し、技術内容を検討し、ISO/IEC JTC1 SC22 WG21にフィードバックするために用います。
また、CERT C++, MISRA C++等のコーディング標準のコード断片をコンパイルする際の参考にさせていただこうと考えています。CERT C++, MISRA C++が標準化の動きとの時間的なずれがあれば確認できれば幸いです。また、boostライブラリとの関連、Linux OS, TOPPERSカーネル、g++(GCC), clang++(LLVM)との関係も調査中です。
何か、抜け漏れ、耳より情報がありましたらおしらせくださると幸いです。

<この項は書きかけです。順次追記します。>

背景(back ground)

C/C++でコンパイルエラーが出ると、途方にくれることがしばしばあります。
何回かに1回は、該当するエラーが検索できます。
ただ、条件が違っていて、そこでの修正方法では目的を達成しないこともしばしばです。いろいろな条件のコンパイルエラーとその対応方法について、広く記録することによって、いつか同じエラーに遭遇した時にやくに立つことを目指しています。

この半年の間で、三度、自分のネットでの記録に助けられたことがあります。
また過去に解決できなかった記録を10種類以上、最近になって解決できたことがあります。それは、主に次の3つの情報に基づいています。

cpprefjp - C++日本語リファレンス

コンパイラの実装状況

また
https://researchmap.jp/joub9b3my-1797580/#_1797580
に記載したサイトのお世話になっています。

作業方針(sequence)

Clang++では-std=c++03, C++2bの2種類
g++では-std=c++03, c++2bの2種類
でコンパイルし、

1)コンパイルエラーを収集する。
2)コンパイルエラーをなくす方法を検討する。
コンパイルエラーになる例を示すだけが目的のコードは、コンパイルエラーをなくすのではなく、コンパイルエラーの種類を収集するだけにする。
文法を示すのが目的のコード場合に、コンパイルエラーをなくすのに手間がかかる場合は、順次作業します。
3)リンクエラーをなくす方法を検討する。
文法を示すのが目的のコード場合に、リンクエラーをなくすのに手間がかかる場合は、順次作業します。
4)意味のある出力を作る。
コンパイル、リンクが通っても、意味のある出力を示そうとすると、コンパイル・リンクエラーが出て収拾できそうにない場合がある。順次作業します。

1)だけのものから4)まで進んだものと色々ある状態です。一歩でも前に進むご助言をお待ちしています。「検討事項」の欄に現状を記録するようにしています。

C++N4910:2022 Standard Working Draft on ISO/IEC 14882(0) sample code compile list

C++N4741, 2018 Standard Working Draft on ISO/IEC 14882 sample code compile list

C++N4606, 2016符号断片編纂一覧(example code compile list)

C++N4606, 2016 Working Draft 2016, ISO/IEC 14882, C++ standard(1) Example code compile list
https://qiita.com/kaizen_nagoya/items/df5d62c35bd6ed1c3d43/

C++N3242, 2011 sample code compile list on clang++ and g++

編纂器(Compiler)

clang++ --version

Debian clang version 14.0.5-++20220610033153+c12386ae247c-1~exp1~20220610153237.151
Target: x86_64-pc-linux-gnu, Thread model: posix, InstalledDir: /usr/bin

g++- --version

g++ (GCC) 12.1.0 Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

24 Containers library 24.2 Requirements [container.requirements] [containers] C++N4910:2022 (638) p841.cpp

算譜(source code)

p841.cpp
// C++N4910 Committee Draft, Standard for Programming Language C++
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf
const char * n4910 = "24 Containers library 24.2 Requirements  [container.requirements] [containers] C++N4910:2022 (638) p841.cpp";
// Debian clang version 14.0.5-++20220610033153+c12386ae247c-
// g++ (GCC) 12.1.0 Copyright (C) 2022 Free Software Foundation, Inc.
// Edited by Dr. OGAWA Kiyoshi. Compile procedure and results record.
// C++N4910:2022 Standard Working Draft on ISO/IEC 14882(0) sample code compile list
// https://qiita.com/kaizen_nagoya/items/fc957ddddd402004bb91

#include "N4910.h"

using namespace std;

// 24 Containers library [containers]
// 24.2 Requirements [container.requirements]
// 24.2.1 Preamble [container.requirements.pre]
// Containers are objects that store other objects. They control allocation and deallocation of these objects through constructors, destructors, insert and erase operations.
// All of the complexity requirements in this Clause are stated solely in terms of the number of operations on the contained objects.
i// [Example 1: The copy constructor of type vector<vector<int>> has linear complexity, even though the complexity of copying each contained vector<int> is itself linear.
// Allocator-aware containers (24.2.2.5) other than basic_string construct elements using the function allocator_traits<allocator_type>::rebind_traits<U>::construct and destroy elements using the function allocator_traits<allocator_type>::rebind_traits<U>::destroy (20.2.8.3), where U is either allocator_type::value_type or an internal type used by the container. These functions are called only for the container’s element type, not for internal types used by the container.
// [Note 1: This means, for example, that a node-based container would need to construct nodes containing aligned buffers and call construct to place the element into the buffer.
// 24.2.2 General containers [container.gen.reqmts]
// 24.2.2.1 General  [container.requirements.general]
// In subclause 24.2.2,
//  A type X meets the container requirements if the following types, statements, and expressions are well-formed and have the specified semantics.
typename X::value_type
// Result: T
// Preconditions: T is Cpp17Erasable from X (see 24.2.2.5, below). typename X::reference
// Result: T&
typename X::const_reference
// Result: const T&
typename X::iterator
// Result: X&.
// Effects: All existing elements of a are either move assigned to or destroyed.
// Postconditions: If a and rv do not refer to the same object, a is equal to the value that rv had before this assignment.
// Complexity: Linear.
X u(a);
X u = a;
X u(rv);
X u = rv;
a = rv
// Result: A type that meets the forward iterator requirements (25.3.5.5) with value type T. The type X::iterator is convertible to X::const_iterator.
// typename X::const_iterator
// Result: A type that meets the requirements of a constant iterator and those of a forward iterator with value type T.
    typename X::difference_type
// Result: A signed integer type, identical to the difference type of X::iterator and X::const_iterator. typename X::size_type
// Result: An unsigned integer type that can represent any non-negative value of X::difference_type. X u;
    X u = X();
// Postconditions: u.empty()
// Complexity: Constant.
// Preconditions: T is Cpp17Copy Insertable into X (see below).
// Postconditions: u == a
// Complexity: Linear.
// Postconditions: u is equal to the value that rv had before this construction. Complexity: Linear for array and constant for all other standard containers.
a.~X()
// Result: void
// Effects: Destroys every element of a; any memory obtained is deallocated. Complexity: Linear.
a.begin()
// Result: iterator; const_iterator for constant a.
// Returns: An iterator referring to the first element in the container. // Complexity: Constant.
// Preconditions: T meets the Cpp17EqualityComparable requirements.
// Result: Convertible to bool.
// Returns: equal(a.begin(), a.end(), b.begin(), b.end()) [Note 1: The algorithm equal is defined in 27.6.11. —end note] Complexity: Constant if a.size() != b.size(), linear otherwise. Remarks: == is an equivalence relation.
// Effects: Equivalent to !(a == b).
a.end()
a.cbegin()
a.cend()
i <=> j
a == b
a != b
a.swap(b)
// Result: iterator; const_iterator for constant a.
// Returns: An iterator which is the past-the-end value for the container. // Complexity: Constant.
// Result: const_iterator.
// Returns: const_cast<X const&>(a).
begin() Complexity:
Constant.
// Result: const_iterator.
// Returns: const_cast<X const&>(a).
end() Complexity:
Constant.
// Result: strong_ordering.
// Constraints: X::iterator meets the random access iterator requirements. Complexity: Constant.
// Result: void
// Effects: Exchanges the contents of a and b.
// Complexity: Linear for array and constant for all other standard containers.
swap(a, b)
// Effects: Equivalent to a.swap(b). r=a
a.size()
// Result: X&.
// Postconditions: r == a.
// Complexity: Linear.
// Result: size_type.
// Returns: distance(a.begin(), a.end()), i.e. the number of elements in the container. Complexity: Constant.
// emarks: The number of elements is defined by the rules of constructors, inserts, and erases.
a.max_size()
a.empty()
// Result: size_type.
// Returns: distance(begin(), end()) for the largest possible container.
// Complexity: Constant.
// Result: Convertible to bool.
// Returns: a.begin() == a.end()
// Complexity: Constant.
// Remarks: If the container is empty, then a.empty() is true.
//  In the expressions
i == j i != j i<j
i <= j i >= j i>j
i <=> j i-j
// where i and j denote objects of a container’s iterator type, either or both may be replaced by an object of the container’s const_iterator type referring to the same element with no change in semantics.
//  Unless otherwise specified, all containers defined in this Clause obtain memory using an allocator (see 16.4.4.6).
// [Note 2: In particular, containers and iterators do not store references to allocated elements other than through the allocator’s pointer type, i.e., as objects of type P or pointer_traits<P>::template rebind<unspecified >, where P is allocator_traits<allocator_type>::pointer.
// Copy constructors for these container types obtain an allocator by calling allocator_traits<allocator_- type>::select_on_container_copy_construction on the allocator belonging to the container being copied. Move constructors obtain an allocator by move construction from the allocator belonging to the container being moved. Such move construction of the allocator shall not exit via an exception. All other constructors for these container types take a const allocator_type& argument.
// [Note 3: If an invocation of a constructor uses the default value of an optional allocator argument, then the allocator type must support value-initialization.
// A copy of this allocator is used for any memory allocation and element construction performed, by these constructors and by all member functions, during the lifetime of each container object or until the allocator is replaced. The allocator may be replaced only via assignment or swap(). Allocator replacement is performed by copy assignment, move assignment, or swapping of the allocator only if
// — allocator_traits<allocator_type>::propagate_on_container_copy_assignment::value,
//  — allocator_traits<allocator_type>::propagate_on_container_move_assignment::value, or
// — allocator_traits<allocator_type>::propagate_on_container_swap::value
//  The expression a.swap(b), for containers a and b of a standard container type other than array, shall exchange the values of a and b without invoking any move, copy, or swap operations on the individual container elements. Lvalues of any Compare, Pred, or Hash types belonging to a and b shall be swappable and shall be exchanged by calling swap as described in 16.4.4.3. If allocator_traits<allocator_type>::propagate_- on_container_swap::value is true, then lvalues of type allocator_type shall be swappable and the allocators of a and b shall also be exchanged by calling swap as described in 16.4.4.3. Otherwise, the allocators shall not be swapped, and the behavior is undefined unless a.get_allocator() == b.get_- allocator(). Every iterator referring to an element in one container before the swap shall refer to the same element in the other container after the swap. It is unspecified whether an iterator with value a.end() before the swap will have value b.end() after the swap.
// is true within the implementation of the corresponding container operation. In all container types defined in this Clause, the member get_allocator() returns a copy of the allocator used to construct the container or, if that allocator has been replaced, a copy of the most recent replacement.
// — if an exception is thrown by an insert() or emplace() function while inserting a single element, that function has no effects.
// — if an exception is thrown by a push_back(), push_front(), emplace_back(), or emplace_front() function, that function has no effects.
// — no erase(), clear(), pop_back() or pop_front() function throws an exception.
// — no copy constructor or assignment operator of a returned iterator throws an exception.
// — no swap() function throws an exception.
// — no swap() function invalidates any references, pointers, or iterators referring to the elements of the containers being swapped.
// [Note 1: The end() iterator does not refer to any element, so it can be invalidated.
// Result: The type reverse_iterator<X::const_iterator>, a constant iterator type whose value type is T.
// 24.2.2.3 Reversible container requirements [container.rev.reqmts]
//  A type X meets the reversible container requirements if X meets the container requirements, the iterator type of X belongs to the bidirectional or random access iterator categories (25.3), and the following types and expressions are well-formed and have the specified semantics.
typename X::reverse_iterator
// Result: The type reverse_iterator<X::iterator>, an iterator type whose value type is T. typename X::const_reverse_iterator
a.rbegin()
a.rend()
// Result: reverse_iterator; const_reverse_iterator for constant a.
// Returns: reverse_iterator(end())
// Complexity: Constant.
// Result: reverse_iterator; const_reverse_iterator for constant a. // Returns: reverse_iterator(begin())
// Complexity: Constant.
a.crbegin()
a.crend()
// Result: const_reverse_iterator.
// Returns: const_cast<X const&>(a).rbegin() Complexity: Constant.
// Result: const_reverse_iterator.
// Returns: const_cast<X const&>(a).rend() Complexity: Constant.
//  Unless otherwise specified (see 24.2.7.2, 24.2.8.2, 24.3.8.4, and 24.3.11.5) all container types defined in this Clause meet the following additional requirements:
//  Unless otherwise specified (either explicitly or by defining a function in terms of other functions), invoking a container member function or passing a container as an argument to a library function shall not invalidate iterators to, or change the values of, objects within that container.
//  A contiguous container is a container whose member types iterator and const_iterator meet the Cpp17RandomAccessIterator requirements (25.3.5.7) and model contiguous_iterator (25.3.4.14).
// 24.2.2.4 Optional container requirements [container.opt.reqmts]
// The following operations are provided for some types of containers but not others. Those containers for which the listed operations are provided shall implement the semantics as described unless otherwise stated. If the iterators passed to lexicographical_compare_three_way meet the constexpr iterator requirements (25.3.1) then the operations described below are implemented by constexpr functions.
a <=> b
// Result: synth-three-way-result <X::value_type>.
// Preconditions: Either <=> is defined for values of type (possibly const) T, or < is defined for values of type (possibly const) T and < is a total ordering relationship.
// Returns: lexicographical_compare_three_way(a.begin(), a.end(), b.begin(), b.end(), synth-three-way)
// [Note 1: The algorithm lexicographical_compare_three_way is defined in Clause 27.
// Complexity: Linear.
//  All of the containers defined in Clause 24 and in 23.4.3 except array meet the additional requirements of an allocator-aware container, as described below.
// Given an allocator type A and given a container type X having a value_type identical to T and an allocator_- type identical to allocator_traits<A>::rebind_alloc<T> and given an lvalue m of type A, a pointer p of type T*, an expression v of type (possibly const) T, and an rvalue rv of type T, the following terms are defined. If X is not allocator-aware or is a specialization of basic_string, the terms below are defined as if A were allocator<T> — no allocator object needs to be created and user specializations of allocator<T> are not instantiated:
// 24.2.2.5 Allocator-aware containers [container.alloc.reqmts]
// — T is Cpp17DefaultInsertable into X means that the following expression is well-formed: allocator_traits<A>::construct(m, p)
// — An element of X is default-inserted if it is initialized by evaluation of the expression allocator_traits<A>::construct(m, p) where p is the address of the uninitialized storage for the element allocated within X.
// — T is Cpp17MoveInsertable into X means that the following expression is well-formed:
allocator_traits<A>::construct(m, p, rv)
// and its evaluation causes the following postcondition to hold: The value of *p is equivalent to the value of rv before the evaluation.
// [Note 1: rv remains a valid object. Its state is unspecified
// — T is Cpp17CopyInsertable into X means that, in addition to T being Cpp17MoveInsertable into X, the following expression is well-formed:
allocator_traits<A>::construct(m, p, v)
// and its evaluation causes the following postcondition to hold: The value of v is unchanged and is equivalent to *p.
// — T is Cpp17EmplaceConstructible into X from args, for zero or more arguments args, means that the following expression is well-formed:
allocator_traits<A>::construct(m, p, args)
// — T is Cpp17Erasable from X means that the following expression is well-formed: allocator_traits<A>::destroy(m, p)
//  The following exposition-only concept is used in the definition of containers:
template<class R, class T>
concept container-compatible-range = // exposition only
    ranges::input_range<R> && convertible_to<ranges::range_reference_t<R>, T>;
//  In this subclause,
// — X denotes an allocator-aware container class with a value_type of T using an allocator of type A,
// [Note 2: A container calls allocator_traits<A>::construct(m, p, args) to construct an element at p using args, with m == get_allocator(). The default construct in allocator will call ::new((void*)p) T(args), but specialized allocators can choose a different definition.
a=t
  a = rv
// Result: X&.
// — u denotes a variable,
// — a and b denote non-const lvalues of type X,
// — c denotes an lvalue of type const X,
// — t denotes an lvalue or a const rvalue of type X, — rv denotes a non-const rvalue of type X, and — misavalueoftypeA.
// A type X meets the allocator-aware container requirements if X meets the container requirements and the following types, statements, and expressions are well-formed and have the specified semantics.
      typename X::allocator_type
      X u;
X u = X();
X u(m);
X u(t, m);
X u(rv);
// Result: A
// Preconditions: allocator_type::value_type is the same as X::value_type.
c.get_allocator()
// Result: A
// Complexity: Constant.
// Preconditions: A meets the Cpp17DefaultConstructible requirements.
// Postconditions: u.empty() returns true, u.get_allocator() == A().
// Complexity: Constant.
// Postconditions: u.empty() returns true, u.get_allocator() == m.
// Complexity: Constant.
// Preconditions: T is Cpp17CopyInsertable into X. Postconditions: u == t, u.get_allocator() == m Complexity: Linear.
// Postconditions: u has the same elements as rv had before this construction; the value of u.get_- allocator() is the same as the value of rv.get_allocator() before this construction.
// Complexity: Constant.
X u(rv, m);
// Preconditions: T is Cpp17MoveInsertable into X.
// Postconditions: u has the same elements, or copies of the elements, that rv had before this construction, u.get_allocator() == m.
// Complexity: Constant if m == rv.get_allocator(), otherwise linear.
// Result: X&.
// Preconditions: T is Cpp17CopyInsertable into X and Cpp17CopyAssignable. // Postconditions: a == t is true.
// Complexity: Linear.
// — X denotes a sequence container class,
// — a denotes a value of type X containing elements of type T,
// — u denotes the name of a variable being declared,
// — A denotes X::allocator_type if the qualified-id X::allocator_type is valid and denotes a type (13.10.3) and allocator<T> if it doesn’t,
// — i and j denote iterators that meet the Cpp17InputIterator requirements and refer to elements implicitly convertible to value_type,
// Preconditions: If allocator_traits<allocator_type>::propagate_on_container_move_assign- ment::value is false, T is Cpp17MoveInsertable into X and Cpp17MoveAssignable.
// Effects: All existing elements of a are either move assigned to or destroyed.
// Postconditions: If a and rv do not refer to the same object, a is equal to the value that rv had before this assignment. Complexity: Linear.
a.swap(b)
// Result: void
// Effects: Exchanges the contents of a and b. Complexity: Constant.
//  The behavior of certain container member functions and deduction guides depends on whether types qualify as input iterators or allocators. The extent to which an implementation determines that a type cannot be an input iterator is unspecified, except that as a minimum integral types shall not qualify as input iterators. Likewise, the extent to which an implementation determines that a type cannot be an allocator is unspecified, except that as a minimum a type A shall not qualify as an allocator unless it meets both of the following conditions:
// — The qualified-id A::value_type is valid and denotes a type (13.10.3).
// — The expression declval<A&>().allocate(size_t{}) is well-formed when treated as an unevaluated operand.
// For purposes of avoiding data races (16.4.6.10), implementations shall consider the following functions to be const: begin, end, rbegin, rend, front, back, data, find, lower_bound, upper_bound, equal_range, at and, except in associative or unordered associative containers, operator[].
//  Notwithstanding 16.4.6.10, implementations are required to avoid data races when the contents of the contained object in different elements in the same container, excepting vector<bool>, are modified concurrently.
//  [Note 1: For a vector<int> x with a size greater than one, x[1] = 5 and *x.begin() = 10 can be executed concurrently without a data race, but x[0] = 5 and *x.begin() = 10 executed concurrently can result in a data race. As an exception to the general rule, for a vector<bool> y, y[0] = true can race with y[1] = true.
// 24.2.4 Sequence containers [sequence.reqmts]
//  A sequence container organizes a finite set of objects, all of the same type, into a strictly linear arrangement. The library provides four basic kinds of sequence containers: vector, forward_list, list, and deque. In addition, array is provided as a sequence container which provides limited sequence operations because it has a fixed number of elements. The library also provides container adaptors that make it easy to construct abstract data types, such as stacks or queues, out of the basic sequence container kinds (or out of other kinds of sequence containers that the user defines).
//  [Note 1: The sequence containers offer the programmer different complexity trade-offs. vector is appropriate in most circumstances. array has a fixed size known during translation. list or forward_list support frequent insertions and deletions from the middle of the sequence. deque supports efficient insertions and deletions taking place at the beginning or at the end of the sequence. When choosing a container, remember vector is best; leave a comment to explain if you choose from the rest! —end note]
//  In this subclause,
// 24.2.3 Container data races [container.requirements.dataraces]
// — [i, j) denotes a valid range,
// — rg denotes a value of a type R that models container-compatible-range <T>, — il designates an object of type initializer_list<value_type>,
// — n denotes a value of type X::size_type,
// — p denotes a valid constant iterator to a,
// — q denotes a valid dereferenceable constant iterator to a,
// — [q1, q2) denotes a valid range of constant iterators in a,
// — t denotes an lvalue or a const rvalue of X::value_type, and
// — rv denotes a non-const rvalue of X::value_type.
// — Args denotes a template parameter pack;
// — args denotes a function parameter pack with the pattern Args&&.
// Preconditions: T is Cpp17CopyInsertable into X.
// Effects: Constructs a sequence container with n copies of t.
// Postconditions: distance(u.begin(), u.end()) == n is true.
// Result: X&.
// Preconditions: T is Cpp17CopyInsertable into X and Cpp17CopyAssignable.
// Effects: Assigns the range [il.begin(), il.end()) into a. All existing elements of a are either assigned to or destroyed.
// Returns: *this.
//  The complexities of the expressions are sequence dependent.
//  A type X meets the sequence container requirements if X meets the container requirements and the following statements and expressions are well-formed and have the specified semantics.
X u(n, t);
X u(i, j);
a = il
// Preconditions: T is Cpp17EmplaceConstructible into X from *i. For vector, if the iterator does not meet the Cpp17ForwardIterator requirements (25.3.5.5), T is also Cpp17MoveInsertable into X.
// Effects: Constructs a sequence container equal to the range [i, j). Each iterator in the range [i, j) is dereferenced exactly once.
// Postconditions: distance(u.begin(), u.end()) == distance(i, j) is true. X(from_range, rg)
// Preconditions: T is Cpp17EmplaceConstructible into X from *ranges::begin(rg). For vector, if R models neither sized_range nor forward_range, T is also Cpp17MoveInsertable into X.
// Effects: Constructs a sequence container equal to the range rg. Each iterator in the range rg is dereferenced exactly once.
// Postconditions: distance(begin(), end()) == ranges::distance(rg) is true. X(il)
// Effects: Equivalent to X(il.begin(), il.end()).
    a.emplace(p, args)
// Result: iterator.
// Preconditions: T is Cpp17EmplaceConstructible into X from args. For vector and deque, T is also  Cpp17MoveInsertable into X and Cpp17MoveAssignable.
// Effects: Inserts an object of type T constructed with std::forward<Args>(args)... before p. [Note 2: args can directly or indirectly refer to a value in a. —end note]
// Returns: An iterator that points to the new element constructed from args into a.
    a.insert(p, t)
// Result: iterator.
// Preconditions: T is Cpp17CopyInsertable into X. For vector and deque, T is also Cpp17CopyAssignable.
// Effects: Inserts a copy of t before p.
// Returns: An iterator that points to the copy of t inserted into a.
    a.insert(p, rv)
// Result: iterator.
// Preconditions: T is Cpp17MoveInsertable into X. For vector and deque, T is also Cpp17MoveAssignable.
// Effects: Inserts a copy of rv before p.
// Returns: An iterator that points to the copy of rv inserted into a.
    a.insert(p, n, t)
// Result: iterator.
// Preconditions: T is Cpp17CopyInsertable into X and Cpp17CopyAssignable.
// Effects: Inserts n copies of t before p.
// Returns: An iterator that points to the copy of the first element inserted into a, or p if n == 0.
    a.insert(p, i, j)
// Result: iterator.
// Preconditions: T is Cpp17EmplaceConstructible into X from *i. For vector and deque, T is also Cpp17MoveInsertable into X, Cpp17MoveConstructible, Cpp17MoveAssignable, and swappable (16.4.4.3). Neither i nor j are iterators into a.
// Effects: Inserts copies of elements in [i, j) before p. Each iterator in the range [i,j) shall be dereferenced exactly once.
// Returns: An iterator that points to the copy of the first element inserted into a, or p if i == j.
    a.insert_range(p, rg)
    a.erase(q)
// Result: iterator.
// Preconditions: T is Cpp17EmplaceConstructible into X from *ranges::begin(rg). For vector and deque, T is also Cpp17MoveInsertable into X, Cpp17MoveConstructible, Cpp17MoveAssignable, and swappable (16.4.4.3). rg and a do not overlap.
// Effects: Inserts copies of elements in rg before p. Each iterator in the range rg is dereferenced exactly once.
// Returns: An iterator that points to the copy of the first element inserted into a, or p if rg is empty. a.insert(p, il)
// Effects: Equivalent to a.insert(p, il.begin(), il.end()).
// Result: iterator.
// Preconditions: For vector and deque, T is Cpp17MoveAssignable.
// Effects: Erases the element pointed to by q.
// Returns: An iterator that points to the element immediately following q prior to the element being erased. If no such element exists, a.end() is returned.
    a.erase(q1, q2)
// Result: iterator.
// Preconditions: For vector and deque, T is Cpp17MoveAssignable. Effects: Erases the elements in the range [q1, q2).
// — If the constructor
    template<class InputIterator>
X(InputIterator first, InputIterator last,
  const allocator_type& alloc = allocator_type());
// is called with a type InputIterator that does not qualify as an input iterator, then the constructor shall not participate in overload resolution.
// Returns: An iterator that points to the element pointed to by q2 prior to any elements being erased. If no such element exists, a.end() is returned.
a.clear()
// Result: void
// Effects: Destroys all elements in a. Invalidates all references, pointers, and iterators referring to the elements of a and may invalidate the past-the-end iterator.
// Postconditions: a.empty() is true.
// Complexity: Linear.
a.assign(i, j)
// Result: void
// Preconditions: T is Cpp17EmplaceConstructible into X from *i and assignable from *i. For vector, if the iterator does not meet the forward iterator requirements (25.3.5.5), T is also Cpp17MoveInsertable into X. Neither i nor j are iterators into a.
// Effects: Replaces elements in a with a copy of [i, j). Invalidates all references, pointers and iterators referring to the elements of a. For vector and deque, also invalidates the past-the-end iterator. Each iterator in the range [i, j) is dereferenced exactly once.
a.assign_range(rg)
// Result: void
// Mandates: assignable_from<T&, ranges::range_reference_t<R>> is modeled.
// Preconditions: T is Cpp17EmplaceConstructible into X from *ranges::begin(rg). For vector, if R models neither sized_range nor forward_range, T is also Cpp17MoveInsertable into X. rg and a do not overlap.
// Effects: Replaces elements in a with a copy of each element in rg. Invalidates all references, pointers, and iterators referring to the elements of a. For vector and deque, also invalidates the past-the-end iterator. Each iterator in the range rg is dereferenced exactly once.
a.assign(il)
// Effects: Equivalent to a.assign(il.begin(), il.end()).
a.assign(n, t)
// Result: void
// Preconditions: T is Cpp17CopyInsertable into X and Cpp17CopyAssignable. t is not a reference into a.
// Effects: Replaces elements in a with n copies of t. Invalidates all references, pointers and iterators referring to the elements of a. For vector and deque, also invalidates the past-the-end iterator.
//  For every sequence container defined in this Clause and in Clause 23:
// — If the member functions of the forms:
template<class InputIterator> return-type F(const_iterator p,
                                    InputIterator first, InputIterator last);
template<class InputIterator>
return_type F(InputIterator first, InputIterator last);
// such as insert
// such as append, assign
template<class InputIterator>
return_type F(const_iterator i1, const_iterator i2,
              InputIterator first, InputIterator last); // such as replace
// are called with a type InputIterator that does not qualify as an input iterator, then these functions shall not participate in overload resolution.
// — A deduction guide for a sequence container shall not participate in overload resolution if it has an InputIterator template parameter and a type that does not qualify as an input iterator is deduced for that parameter, or if it has an Allocator template parameter and a type that does not qualify as an allocator is deduced for that parameter.
// Result: reference; const_reference for constant a.
// Returns: *a.begin()
// Remarks: Required for basic_string, array, deque, forward_list, list, and vector.
//  The following operations are provided for some types of sequence containers but not others. An implementation shall implement them so as to take amortized constant time.
a.front()
a.back()
// Result: reference; const_reference for constant a. Effects: Equivalent to:
auto tmp = a.end();
--tmp;
return *tmp;
// Remarks: Required for basic_string, array, deque, list, and vector.
a.emplace_front(args)
// Result: reference
// Preconditions: T is Cpp17EmplaceConstructible into X from args.
// Effects: Prepends an object of type T constructed with std::forward<Args>(args).... Returns: a.front().
// Remarks: Required for deque, forward_list, and list.
a.emplace_back(args)
// Result: reference
// Preconditions: T is Cpp17EmplaceConstructible into X from args. For vector, T is also Cpp17MoveIn-sertable into X.
// Effects: Appends an object of type T constructed with std::forward<Args>(args).... Returns: a.back().
// Remarks: Required for deque, list, and vector.
a.push_front(t)
// Result: void
// Preconditions: T is Cpp17CopyInsertable into X.
// Effects: Prepends a copy of t.
// Remarks: Required for deque, forward_list, and list.
a.push_front(rv)
// Result: void
// Preconditions: T is Cpp17MoveInsertable into X.
// Effects: Prepends a copy of rv.
// Remarks: Required for deque, forward_list, and list.
a.prepend_range(rg)
a[n]
// Result: void
// Preconditions: T is Cpp17EmplaceConstructible into X from *ranges::begin(rg).
// Effects: Inserts copies of elements in rg before begin(). Each iterator in the range rg is dereferenced exactly once.
// [Note 3: The order of elements in rg is not reversed.
// Remarks: Required for deque, forward_list, and list.
a.push_back(t)
// Result: void
// Preconditions: T is Cpp17CopyInsertable into X.
// Effects: Appends a copy of t.
// Remarks: Required for basic_string, deque, list, and vector.
a.push_back(rv)
// Result: void
// Preconditions: T is Cpp17MoveInsertable into X.
// Effects: Appends a copy of rv.
// Remarks: Required for basic_string, deque, list, and vector.
a.append_range(rg)
a.at(n)
// Result: void
// Preconditions: T is Cpp17EmplaceConstructible into X from *ranges::begin(rg). For vector, T is also Cpp17MoveInsertable into X.
// Effects: Inserts copies of elements in rg before end(). Each iterator in the range rg is dereferenced exactly once.
// Remarks: Required for deque, list, and vector.
a.pop_front()
// Result: void
// Preconditions: a.empty() is false.
// Effects: Destroys the first element.
// Remarks: Required for deque, forward_list, and list.
a.pop_back()
// Result: void
// Preconditions: a.empty() is false.
// Effects: Destroys the last element.
// Remarks: Required for basic_string, deque, list, and vector.
// Result: reference; const_reference for constant a
// Returns: *(a.begin() + n)
// Remarks: Required for basic_string, array, deque, and vector.
// Result: reference; const_reference for constant a
// Returns: *(a.begin() + n)
// Throws: out_of_range if n >= a.size().
// Remarks: Required for basic_string, array, deque, and vector.
// 24.2.5 Node handles [container.node]
// 24.2.5.1 Overview [container.node.overview]
//  A node handle is an object that accepts ownership of a single element from an associative container (24.2.7) or an unordered associative container (24.2.8). It may be used to transfer that ownership to another container with compatible nodes. Containers with compatible nodes have the same node handle type. Elements may be transferred in either direction between container types in the same row of Table 79.
//  If a node handle is not empty, then it contains an allocator that is equal to the allocator of the container when the element was extracted. If a node handle is empty, it contains no allocator.
//  Class node-handle is for exposition only.
//  If a user-defined specialization of pair exists for pair<const Key, T> or pair<Key, T>, where Key is the container’s key_type and T is the container’s mapped_type, the behavior of operations involving node handles is undefined.
template<unspecified> class node_handle {
public:
// These type declarations are described in 24.2.7 and 24.2.8.
// not present for map containers // not present for set containers // not present for set containers
    using value_type
    using key_type
    using mapped_type
    using allocator_type = see below;
// 24.2.5.3, destructor ~node-handle();
// 24.2.5.4, observers value_type& value() const; key_type& key() const; mapped_type& mapped() const;
// not present for map containers // not present for set containers // not present for set containers
        = see below;
        = see below;
        = see below;
private:
    using container_node_type = unspecified;
    using ator_traits = allocator_traits<allocator_type>;
    typename ator_traits::template
    rebind_traits<container_node_type>::pointer ptr_;
    optional<allocator_type> alloc_;
public:
// 24.2.5.2, constructors, copy, and assignment
    constexpr node_handle() noexcept : ptr_(), alloc_() {} node_handle(node_handle&&) noexcept;
    node_handle& operator=(node_handle&&);
// exposition only // exposition only
// exposition only // exposition only
    allocator_type get_allocator() const;
    explicit operator bool() const noexcept;
    [[nodiscard]] bool empty() const noexcept;
// 24.2.5.5, modifiers void swap(node-handle&)
    noexcept(ator_traits::propagate_on_container_swap::value ||
             ator_traits::is_always_equal::value);
    friend void swap(node_handle& x, node_handle& y) noexcept(noexcept(x.swap(y))) {
        x.swap(y);
    }
};
// 24.2.5.2 Constructors, copy, and assignment [container.node.cons]
node_handle(node_handle&& nh) noexcept;
// Effects: Constructs a node-handle object initializing ptr_ with nh.ptr_. Move constructs alloc_ with nh.alloc_. Assigns nullptr to nh.ptr_ and assigns nullopt to nh.alloc_. node-handle& operator=(node-handle&& nh);
// Preconditions: Either !alloc_, or ator_traits::propagate_on_container_move_assignment::- value is true, or alloc_ == nh.alloc_.
// Effects:— If ptr_ != nullptr, destroys the value_type subobject in the container_node_type object pointed to by ptr_ by calling ator_traits::destroy, then deallocates ptr_ by calling ator_- traits::template rebind_traits<container_node_type>::deallocate.
// — Assigns nh.ptr_ to ptr_.
// — If !alloc_ or ator_traits::propagate_on_container_move_assignment::value is true, move assigns nh.alloc_ to alloc_.
// — Assigns nullptr to nh.ptr_ and assigns nullopt to nh.alloc_.
// Returns: *this.
// Throws: Nothing.
// 24.2.5.3 Destructor [container.node.dtor]
~node_handle();
// Effects: If ptr_ != nullptr, destroys the value_type subobject in the container_node_type ob- ject pointed to by ptr_ by calling ator_traits::destroy, then deallocates ptr_ by calling ator_- traits::template rebind_traits<container_node_type>::deallocate.
// 24.2.5.4 Observers [container.node.observers]
value_type& value() const;
// Preconditions: empty() == false.
// Returns: A reference to the value_type subobject in the container_node_type object pointed to by ptr_.
// Throws: Nothing.
key_type& key() const;
// Preconditions: empty() == false.
// Returns: A non-const reference to the key_type member of the value_type subobject in the contain- er_node_type object pointed to by ptr_.
// Throws: Nothing.
// Remarks: Modifying the key through the returned reference is permitted.
mapped_type& mapped() const;
// Preconditions: empty() == false.
// Returns: A reference to the mapped_type member of the value_type subobject in the container_-
node_type object pointed to by ptr_.
// Throws: Nothing.
allocator_type get_allocator() const;
// Preconditions: empty() == false. Returns: *alloc_.
// Throws: Nothing.
//  The associative containers with unique keys and the unordered containers with unique keys have a member function insert that returns a nested type insert_return_type. That return type is a specialization of the template specified in this subclause.
template<class Iterator, class NodeType> struct insert-return-type
{
    Iterator position;
    bool     inserted;
    NodeType node;
};
//  The name insert-return-type is exposition only. insert-return-type has the template parameters, data members, and special members specified above. It has no base classes or members other than those specified.
// 24.2.7 Associative containers [associative.reqmts]
// 24.2.7.1 General [associative.reqmts.general]
//  Associative containers provide fast retrieval of data based on keys. The library provides four basic kinds of associative containers: set, multiset, map and multimap.
//  Each associative container is parameterized on Key and an ordering relation Compare that induces a strict weak ordering (27.8) on elements of Key. In addition, map and multimap associate an arbitrary mapped type T with the Key. The object of type Compare is called the comparison object of a container.
//  The phrase “equivalence of keys” means the equivalence relation imposed by the comparison object. That is, two keys k1 and k2 are considered to be equivalent if for the comparison object comp, comp(k1, k2) == false && comp(k2, k1) == false.
// [Note 1: This is not necessarily the same as the result of k1 == k2.
// For any two keys k1 and k2 in the same container, calling comp(k1, k2) shall always return the same value.
//  An associative container supports unique keys if it may contain at most one element for each key. Otherwise, it supports equivalent keys. The set and map classes support unique keys; the multiset and multimap classes support equivalent keys. For multiset and multimap, insert, emplace, and erase preserve the relative ordering of equivalent elements.
explicit operator bool() const noexcept;
// Returns: ptr_ != nullptr.
[[nodiscard]] bool empty() const noexcept;
// Returns: ptr_ == nullptr.
// 24.2.5.5 Modifiers [container.node.modifiers]
void swap(node_handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
                                    ator_traits::is_always_equal::value);
// Preconditions: !alloc_, or !nh.alloc_, or ator_traits::propagate_on_container_swap::value is true, or alloc_ == nh.alloc_.
// Effects: Calls swap(ptr_, nh.ptr_). If !alloc_, or !nh.alloc_, or ator_traits::propagate_on_- container_swap::value is true calls swap(alloc_, nh.alloc_).
// 24.2.6 Insert return type [container.insert.return]
// — X denotes an associative container class,
// — a denotes a value of type X,
// — a2 denotes a value of a type with nodes compatible with type X (Table 79),
// — b denotes a possibly const value of type X,
// — u denotes the name of a variable being declared,
// — a_uniq denotes a value of type X when X supports unique keys,
// — a_eq denotes a value of type X when X supports multiple keys,
// — a_tran denotes a possibly const value of type X when the qualified-id X::key_compare::is_transpa- rent is valid and denotes a type (13.10.3),
// — i and j meet the Cpp17InputIterator requirements and refer to elements implicitly convertible to value_type,
// — [i, j) denotes a valid range,
// — rg denotes a value of a type R that models container-compatible-range <value_type>,
// — p denotes a valid constant iterator to a,
// — q denotes a valid dereferenceable constant iterator to a,
// — r denotes a valid dereferenceable iterator to a,
// — [q1, q2) denotes a valid range of constant iterators in a,
// — il designates an object of type initializer_list<value_type>,
// — t denotes a value of type X::value_type,
// — k denotes a value of type X::key_type, and
// — c denotes a possibly const value of type X::key_compare;
// — kl is a value such that a is partitioned (27.8) with respect to c(x, kl), with x the key value of e and e in a;
// — ku is a value such that a is partitioned with respect to !c(ku, x), with x the key value of e and e in a;
// — ke is a value such that a is partitioned with respect to c(x, ke) and !c(ke, x), with c(x, ke) implying !c(ke, x) and with x the key value of e and e in a;
// — kx is a value such that
// — a is partitioned with respect to c(x, kx) and !c(kx, x), with c(x, kx) implying !c(kx, x) andwithxthekeyvalueof eandeina,and
// — kx is not convertible to either iterator or const_iterator; and
// — A denotes the storage allocator used by X, if any, or allocator<X::value_type> otherwise,
// — m denotes an allocator of a type convertible to A, and nh denotes a non-const rvalue of type X::node_- type.
//  For set and multiset the value type is the same as the key type. For map and multimap it is equal to pair<const Key, T>.
//  iterator of an associative container is of the bidirectional iterator category. For associative containers where the value type is the same as the key type, both iterator and const_iterator are constant iterators. It is unspecified whether or not iterator and const_iterator are the same type.
// [Note 2: iterator and const_iterator have identical semantics in this case, and iterator is convertible to const_- iterator. Users can avoid violating the one-definition rule by always using const_iterator in their function parameter lists.
// In this subclause,
// A type X meets the associative container requirements if X meets all the requirements of an allocator-aware container (24.2.2.1) and the following types, statements, and expressions are well-formed and have the specified semantics, except that for map and multimap, the requirements placed on value_type in 24.2.2.5 apply instead to key_type and mapped_type.
// [Note 3: For example, in some cases key_type and mapped_type are required to be Cpp17CopyAssignable even though the associated value_type, pair<const key_type, mapped_type>, is not Cpp17CopyAssignable.
typename X::key_type
// Result: Key.
X(c)
typename X::mapped_type
// Result: T.
// Remarks: For map and multimap only.
typename X::value_type
// Result: Key for set and multiset only; pair<const Key, T> for map and multimap only. Preconditions: X::value_type is Cpp17Erasable from X.
typename X::key_compare
// Result: Compare.
// Preconditions: key_compare is Cpp17CopyConstructible.
typename X::value_compare
// Result: A binary predicate type. It is the same as key_compare for set and multiset; is an ordering relation on pairs induced by the first component (i.e., Key) for map and multimap.
typename X::node_type
X u = X();
X u;
X(i, j, c)
// Result: A specialization of the node-handle class template (24.2.5), such that the public nested types are the same types as the corresponding types in X.
// Effects: Constructs an empty container. Uses a copy of c as a comparison object. Complexity: Constant.
// Preconditions: key_compare meets the Cpp17DefaultConstructible requirements. Effects: Constructs an empty container. Uses Compare() as a comparison object. Complexity: Constant.
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *i.
// Effects: Constructs an empty container and inserts elements from the range [i, j) into it; uses c as a comparison object.
// Complexity: N log N in general, where N has the value distance(i, j); linear if [i, j) is sorted with value_comp().
X(i, j)
// Preconditions: key_compare meets the Cpp17DefaultConstructible requirements. value_type is Cpp17EmplaceConstructible into X from *i.
// Effects: Constructs an empty container and inserts elements from the range [i, j) into it; uses Compare() as a comparison object.
// Complexity: N log N in general, where N has the value distance(i, j); linear if [i, j) is sorted with value_comp().
X(from_range, rg, c)
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *range::begin(rg).
// Effects: Constructs an empty container and inserts each element from rg into it. Uses c as the comparison object.
// Complexity: N log N in general, where N has the value ranges::distance(rg); linear if rg is sorted with value_comp().
// Result: X&
// Preconditions: value_type is Cpp17CopyInsertable into X and Cpp17CopyAssignable.
// Effects: Assigns the range [il.begin(), il.end()) into a. All existing elements of a are either assigned to or destroyed.
// Complexity: N log N in general, where N has the value il.size() + a.size(); linear if [il.begin(), il.end()) is sorted with value_comp().
X(from_range, rg)
// Preconditions: key_compare meets the Cpp17DefaultConstructible requirements. value_type is Cpp17EmplaceConstructible into X from *ranges::begin(rg).
// Effects: Constructs an empty container and inserts each element from rg into it. Uses Compare() as the comparison object.
// Complexity: Same as X(from_range, rg, c). X(il, c)
// Effects: Equivalent to X(il.begin(), il.end(), c). X(il)
a = il
// Effects: Equivalent to X(il.begin(), il.end()).
    b.key_comp()
// Result: X::key_compare
// Returns: The comparison object out of which b was constructed.
// Complexity: Constant.
    b.value_comp()
// Result: X::value_compare
// Returns: An object of value_compare constructed out of the comparison object. Complexity: Constant.
    a_uniq.emplace(args)
// Result: pair<iterator, bool>
// Preconditions: value_type is Cpp17EmplaceConstructible into X from args.
// Effects: Inserts a value_type object t constructed with std::forward<Args>(args)... if and only if there is no element in the container with key equivalent to the key of t.
// Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t.
// Complexity: Logarithmic.
    a_eq.emplace(args)
// Result: iterator
// Preconditions: value_type is Cpp17EmplaceConstructible into X from args.
// Effects: Inserts a value_type object t constructed with std::forward<Args>(args).... If a range containing elements equivalent to t exists in a_eq, t is inserted at the end of that range.
// Returns: An iterator pointing to the newly inserted element.
// Complexity: Logarithmic.
    a.emplace_hint(p, args)
// Result: iterator
// Effects: Equivalent to a.emplace(std::forward<Args>(args)...), except that the element is inserted as close as possible to the position just prior to p.
// Returns: An iterator pointing to the element with the key equivalent to the newly inserted element. Complexity: Logarithmic in general, but amortized constant if the element is inserted right before p.
    a_uniq.insert(t)
// Result: pair<iterator, bool>
// Preconditions: If t is a non-const rvalue, value_type is Cpp17MoveInsertable into X; otherwise, value_type is Cpp17CopyInsertable into X.
// Effects: Inserts t if and only if there is no element in the container with key equivalent to the key of t.
// Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t.
// Complexity: Logarithmic.
    a_eq.insert(t)
// Result: iterator
// Preconditions: If t is a non-const rvalue, value_type is  Cpp17MoveInsertable into X; otherwise, value_type is Cpp17CopyInsertable into X.
// Effects: Inserts t and returns the iterator pointing to the newly inserted element. If a range containing elements equivalent to t exists in a_eq, t is inserted at the end of that range. Complexity: Logarithmic.
    a.insert(p, t)
// Result: iterator
// Preconditions: If t is a non-const rvalue, value_type is Cpp17MoveInsertable into X; otherwise, value_type is Cpp17CopyInsertable into X.
// Effects: Inserts t if and only if there is no element with key equivalent to the key of t in containers with unique keys; always inserts t in containers with equivalent keys. t is inserted as close as possible to the position just prior to p.
// Returns: An iterator pointing to the element with key equivalent to the key of t. Complexity: Logarithmic in general, but amortized constant if t is inserted right before p.
    a.insert(i, j)
// Result: void
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *i. Neither i nor j are iterators into a.
// Effects: Inserts each element from the range [i, j) if and only if there is no element with key equivalent to the key of that element in containers with unique keys; always inserts that element in containers with equivalent keys.
// Complexity: N log(a.size() + N), where N has the value distance(i, j).
    a.insert_range(rg)
// Result: void
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *ranges::begin(rg). rg and a do not overlap.
// Effects: Inserts each element from rg if and only if there is no element with key equivalent to the key of that element in containers with unique keys; always inserts that element in containers with equivalent keys.
// Complexity: N log(a.size() + N), where N has the value ranges::distance(rg).
    a.insert(il)
// Effects: Equivalent to a.insert(il.begin(), il.end()).
    a_uniq.insert(nh)
// Result: insert_return_type
// Preconditions: nh is empty or a_uniq.get_allocator() == nh.get_allocator() is true.
// Effects: If nh is empty, has no effect. Otherwise, inserts the element owned by nh if and only if there is no element in the container with a key equivalent to nh.key().
// Returns: If nh is empty, inserted is false, position is end(), and node is empty. Otherwise if the insertion took place, inserted is true, position points to the inserted element, and node is empty; if the insertion failed, inserted is false, node has the previous value of nh, and position points to an element with a key equivalent to nh.key().
// Complexity: Logarithmic.
    a_eq.insert(nh)
// Result: iterator
// Preconditions: nh is empty or a_eq.get_allocator() == nh.get_allocator() is true.
// Effects: If nh is empty, has no effect and returns a_eq.end(). Otherwise, inserts the element owned by nh and returns an iterator pointing to the newly inserted element. If a range containing elements with keys equivalent to nh.key() exists in a_eq, the element is inserted at the end of that range.
// Postconditions: nh is empty. Complexity: Logarithmic.
    a.insert(p, nh)
// Result: iterator
// Preconditions: nh is empty or a.get_allocator() == nh.get_allocator() is true.
// Effects: If nh is empty, has no effect and returns a.end(). Otherwise, inserts the element owned by nh if and only if there is no element with key equivalent to nh.key() in containers with unique keys; always inserts the element owned by nh in containers with equivalent keys. The element is inserted as close as possible to the position just prior to p.
// Postconditions: nh is empty if insertion succeeds, unchanged if insertion fails.
// Returns: An iterator pointing to the element with key equivalent to nh.key().
// Complexity: Logarithmic in general, but amortized constant if the element is inserted right before p.
    a.extract(k)
// Result: node_type
// Effects: Removes the first element in the container with key equivalent to k. Returns: A node_type owning the element if found, otherwise an empty node_type. Complexity: log(a.size())
    a_tran.extract(kx)
// Result: node_type
// Effects: Removes the first element in the container with key r such that !c(r, kx) && !c(kx, r) is true.
// Returns: A node_type owning the element if found, otherwise an empty node_type. Complexity: log(a_tran.size())
    a.extract(q)
// Result: node_type
// Effects: Removes the element pointed to by q. Returns: A node_type owning that element.
// Complexity: Amortized constant.
    a.merge(a2)
// Result: void
// Preconditions: a.get_allocator() == a2.get_allocator().
// Effects: Attempts to extract each element in a2 and insert it into a using the comparison object of a. In containers with unique keys, if there is an element in a with key equivalent to the key of an element from a2, then that element is not extracted from a2.
// Postconditions: Pointers and references to the transferred elements of a2 refer to those same elements but as members of a. Iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into a, not into a2.
// Throws: Nothing unless the comparison object throws.
// Complexity: N log(a.size()+N), where N has the value a2.size().
    a.erase(k)
    a.erase(q)
    a.erase(r)
    a.clear()
// Result: size_type
// Effects: Erases all elements in the container with key equivalent to k. // Returns: The number of erased elements.
// Complexity: log(a.size()) + a.count(k)
    a_tran.erase(kx)
// Result: size_type
// Effects: Erases all elements in the container with key r such that !c(r, kx) && !c(kx, r) is true. Returns: The number of erased elements.
// Complexity: log(a_tran.size()) + a_tran.count(kx)
// Result: iterator
// Effects: Erases the element pointed to by q.
// Returns: An iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns a.end().
// Complexity: Amortized constant.
// Result: iterator
// Effects: Erases the element pointed to by r.
// Returns: An iterator pointing to the element immediately following r prior to the element being erased. If no such element exists, returns a.end().
// Complexity: Amortized constant.
    a.erase(q1, q2)
// Result: iterator
// Effects: Erases all the elements in the range [q1, q2).
// Returns: An iterator pointing to the element pointed to by q2 prior to any elements being erased. If no such element exists, a.end() is returned.
// Complexity: log(a.size()) + N, where N has the value distance(q1, q2).
// Effects: Equivalent to a.erase(a.begin(), a.end()). Postconditions: a.empty() is true.
// Complexity: Linear in a.size().
    b.find(k)
    b.count(k)
// Result: iterator; const_iterator for constant b.
// Returns: An iterator pointing to an element with the key equivalent to k, or b.end() if such an element is not found.
// Complexity: Logarithmic.
    a_tran.find(ke)
// Result: iterator; const_iterator for constant a_tran.
// Returns: An iterator pointing to an element with key r such that !c(r, ke) && !c(ke, r) is true, or a_tran.end() if such an element is not found. Complexity: Logarithmic.
// Result: size_type
// Returns: The number of elements with key equivalent to k. Complexity: log(b.size()) + b.count(k)
    a_tran.count(ke)
// Result: size_type
// Returns: The number of elements with key r such that !c(r, ke) && !c(ke, r). Complexity: log(a_tran.size()) + a_tran.count(ke)
    b.contains(k)
// Result: bool
// Effects: Equivalent to: return b.find(k) != b.end();
    a_tran.contains(ke)
// Result: bool
// Effects: Equivalent to: return a_tran.find(ke) != a_tran.end();
    b.lower_bound(k)
// Result: iterator; const_iterator for constant b.
// Returns: An iterator pointing to the first element with key not less than k, or b.end() if such an element is not found. Complexity: Logarithmic.
    a_tran.lower_bound(kl)
// Result: iterator; const_iterator for constant a_tran.
// Returns: An iterator pointing to the first element with key r such that !c(r, kl), or a_tran.end() if such an element is not found. Complexity: Logarithmic.
    b.upper_bound(k)
// Result: iterator; const_iterator for constant b.
// Returns: An iterator pointing to the first element with key greater than k, or b.end() if such an element is not found. Complexity: Logarithmic,
    a_tran.upper_bound(ku)
// Result: iterator; const_iterator for constant a_tran.
// Returns: An iterator pointing to the first element with key r such that c(ku, r), or a_tran.end() if such an element is not found.
// — It has an InputIterator template parameter and a type that does not qualify as an input iterator is deduced for that parameter.
// — It has an Allocator template parameter and a type that does not qualify as an allocator is deduced for that parameter.
// — It has a Compare template parameter and a type that qualifies as an allocator is deduced for that parameter.
// 24.2.7.2 Exception safety guarantees [associative.reqmts.except]
// Complexity: Logarithmic.
    b.equal_range(k)
// Result: pair<iterator, iterator>; pair<const_iterator, const_iterator> for constant b. Effects: Equivalent to: return make_pair(b.lower_bound(k), b.upper_bound(k)); Complexity: Logarithmic.
    a_tran.equal_range(ke)
// Result: pair<iterator, iterator>; pair<const_iterator, const_iterator> for constant a_tran. Effects: Equivalent to: return make_pair(a_tran.lower_bound(ke), a_tran.upper_bound(ke)); Complexity: Logarithmic.
//  The insert, insert_range, and emplace members shall not affect the validity of iterators and references to the container, and the erase members shall invalidate only iterators and references to the erased elements.
//  The extract members invalidate only iterators to the removed element; pointers and references to the removed element remain valid. However, accessing the element through such pointers and references while the element is owned by a node_type is undefined behavior. References and pointers to an element obtained while it is owned by a node_type are invalidated if the element is successfully inserted.
//  The fundamental property of iterators of associative containers is that they iterate through the containers in the non-descending order of keys where non-descending is defined by the comparison that was used to construct them. For any two dereferenceable iterators i and j such that distance from i to j is positive, the following condition holds:
    value_comp(*j, *i) == false
//  For associative containers with unique keys the stronger condition holds: value_comp(*i, *j) != false
//  When an associative container is constructed by passing a comparison object the container shall not store a pointer or reference to the passed object, even if that object is passed by reference. When an associative container is copied, through either a copy constructor or an assignment operator, the target container shall then use the comparison object from the container being copied, as if that comparison object had been passed to the target container in its constructor.
//  The member function templates find, count, contains, lower_bound, upper_bound, equal_range, erase, and extract shall not participate in overload resolution unless the qualified-id Compare::is_transparent is valid and denotes a type (13.10.3). Additionally, the member function templates extract and erase shall not participate in overload resolution if is_convertible_v<K&&, iterator> || is_convertible_v<K&&, const_iterator> is true, where K is the type substituted as the first template argument.
//  A deduction guide for an associative container shall not participate in overload resolution if any of the following are true:
//  For associative containers, no clear() function throws an exception. erase(k) does not throw an exception unless that exception is thrown by the container’s Compare object (if any).
//  For associative containers, if an exception is thrown by any operation from within an insert or emplace function inserting a single element, the insertion has no effect.
//  For associative containers, no swap function throws an exception unless that exception is thrown by the swap of the container’s Compare object (if any).
// — X denotes an unordered associative container class,
// — a denotes a value of type X,
// — a2 denotes a value of a type with nodes compatible with type X (Table 79),
// — b denotes a possibly const value of type X,
// — a_uniq denotes a value of type X when X supports unique keys,
// — a_eq denotes a value of type X when X supports equivalent keys,
// — a_tran denotes a possibly const value of type X when the qualified-ids X::key_equal::is_transparent and X::hasher::is_transparent are both valid and denote types (13.10.3),
// 24.2.8 Unordered associative containers
// 24.2.8.1 General  [unord.req.general]
// Unordered associative containers provide an ability for fast retrieval of data based on keys. The worst-case complexity for most operations is linear, but the average case is much faster. The library provides four unordered associative containers: unordered_set, unordered_map, unordered_multiset, and unordered_- multimap.
// Unordered associative containers conform to the requirements for Containers (24.2), except that the expressions a == b and a != b have different semantics than for the other container types.
//  Each unordered associative container is parameterized by Key, by a function object type Hash that meets the Cpp17Hash requirements (16.4.4.5) and acts as a hash function for argument values of type Key, and by a binary predicate Pred that induces an equivalence relation on values of type Key. Additionally, unordered_map and unordered_multimap associate an arbitrary mapped type T with the Key.
// The container’s object of type Hash — denoted by hash — is called the hash function of the container. The container’s object of type Pred — denoted by pred — is called the key equality predicate of the container.
//  Two values k1 and k2 are considered equivalent if the container’s key equality predicate pred(k1, k2) is valid and returns true when passed those values. If k1 and k2 are equivalent, the container’s hash function shall return the same value for both.
// [Note 1: Thus, when an unordered associative container is instantiated with a non-default Pred parameter it usually needs a non-default Hash parameter as well.
// For any two keys k1 and k2 in the same container, calling pred(k1, k2) shall always return the same value. For any key k in a container, calling hash(k) shall always return the same value.
//  An unordered associative container supports unique keys if it may contain at most one element for each key. Otherwise, it supports equivalent keys. unordered_set and unordered_map support unique keys. unordered_multiset and unordered_multimap support equivalent keys. In containers that support equiva- lent keys, elements with equivalent keys are adjacent to each other in the iteration order of the container. Thus, although the absolute order of elements in an unordered container is not specified, its elements are grouped into equivalent-key groups such that all elements of each group have equivalent keys. Mutating operations on unordered containers shall preserve the relative order of elements within each equivalent-key group unless otherwise specified.
// For unordered_set and unordered_multiset the value type is the same as the key type. For unordered_map and unordered_multimap it is pair<const Key, T>.
//  For unordered containers where the value type is the same as the key type, both iterator and const_- iterator are constant iterators. It is unspecified whether or not iterator and const_iterator are the same type.
// [Note 2: iterator and const_iterator have identical semantics in this case, and iterator is convertible to const_- iterator. Users can avoid violating the one-definition rule by always using const_iterator in their function parameter lists.
//  The elements of an unordered associative container are organized into buckets. Keys with the same hash code appear in the same bucket. The number of buckets is automatically increased as elements are added to an unordered associative container, so that the average number of elements per bucket is kept below a bound. Rehashing invalidates iterators, changes ordering between elements, and changes which buckets elements appear in, but does not invalidate pointers or references to elements. For unordered_multiset and unordered_multimap, rehashing preserves the relative ordering of equivalent elements.
//  In this subclause,
// — i and j denote input iterators that refer to value_type,
// — [i, j) denotes a valid range,
// — rg denotes a value of a type R that models container-compatible-range <value_type>,
// — p and q2 denote valid constant iterators to a,
// — q and q1 denote valid dereferenceable constant iterators to a,
// — r denotes a valid dereferenceable iterator to a,
// — [q1, q2) denotes a valid range in a,
// — il denotes a value of type initializer_list<value_type>,
// — t denotes a value of type X::value_type,
// — k denotes a value of type key_type,
// — hf denotes a possibly const value of type hasher,
// — eq denotes a possibly const value of type key_equal,
// — ke is a value such that
// — eq(r1, ke) == eq(ke, r1),
// — hf(r1) == hf(ke) if eq(r1, ke) is true, and — (eq(r1, ke) && eq(r1, r2)) == eq(r2, ke), where r1 and r2 are keys of elements in a_tran,
// — kx is a value such that
// — eq(r1, kx) == eq(kx, r1),
// — hf(r1) == hf(kx) if eq(r1, kx) is true,
// — (eq(r1, kx) && eq(r1, r2)) == eq(r2, kx), and
// — kx is not convertible to either iterator or const_iterator, where r1 and r2 are keys of elements in a_tran,
// — n denotes a value of type size_type,
// — z denotes a value of type float, and
// — nh denotes a non-const rvalue of type X::node_type.
//  A type X meets the unordered associative container requirements if X meets all the requirements of an allocator-aware container (24.2.2.1) and the following types, statements, and expressions are well-formed and have the specified semantics, except that for unordered_map and unordered_multimap, the requirements placed on value_type in 24.2.2.5 apply instead to key_type and mapped_type.
// [Note 3: For example, key_type and mapped_type are sometimes required to be Cpp17CopyAssignable even though the associated value_type, pair<const key_type, mapped_type>, is not Cpp17CopyAssignable.
    typename X::key_type
// Result: Key.
    typename X::mapped_type
// Result: T.
// Remarks: For unordered_map and unordered_multimap only.
    typename X::value_type
// Result: Key for unordered_set and unordered_multiset only; pair<const Key, T> for unordered_- map and unordered_multimap only.
// Preconditions: value_type is Cpp17Erasable from X.
    typename X::hasher
// Result: Hash.
// Preconditions: Hash is a unary function object type such that the expression hf(k) has type size_t.
    typename X::key_equal
// Result: Pred.
// Preconditions: Pred meets the Cpp17CopyConstructible requirements. Pred is a binary predicate that takes two arguments of type Key. Pred is an equivalence relation. typename X::local_iterator
// Result: An iterator type whose category, value type, difference type, and pointer and reference types are the same as X::iterator’s.
// [Note 4: A local_iterator object can be used to iterate through a single bucket, but cannot be used to iterate across buckets.
    typename X::const_local_iterator
// Result: An iterator type whose category, value type, difference type, and pointer and reference types are the same as X::const_iterator’s.
// [Note 5: A const_local_iterator object can be used to iterate through a single bucket, but cannot be used to iterate across buckets.
    typename X::node_type
// Result: A specialization of a node-handle class template (24.2.5), such that the public nested types are the same types as the corresponding types in X.
    X(n, hf, eq)
    X(n, hf)
    X a = X();
X a;
// Effects: Constructs an empty container with at least n buckets, using hf as the hash function and eq as the key equality predicate.
// Complexity: O(n)
// Preconditions: key_equal meets the Cpp17DefaultConstructible requirements.
// Effects: Constructs an empty container with at least n buckets, using hf as the hash function and key_equal() as the key equality predicate. Complexity: O(n)
// Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements.
// Effects: Constructs an empty container with at least n buckets, using hasher() as the hash function and key_equal() as the key equality predicate. Complexity: O(n)
// Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements.
// Effects: Constructs an empty container with an unspecified number of buckets, using hasher() as the hash function and key_equal() as the key equality predicate.
// Complexity: Constant.
X(i, j, n, hf, eq)
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *i.
// Effects: Constructs an empty container with at least n buckets, using hf as the hash function and eq as the key equality predicate, and inserts elements from [i, j) into it. Complexity: Average case O(N) (N is distance(i, j)), worst case O(N2).
X(i, j, n, hf)
// Preconditions: key_equal meets the Cpp17DefaultConstructible requirements. value_type is Cpp17- EmplaceConstructible into X from *i.
// Effects: Constructs an empty container with at least n buckets, using hf as the hash function and key_equal() as the key equality predicate, and inserts elements from [i, j) into it.
// Complexity: Average case O(N) (N is distance(i, j)), worst case O(N2). X(i, j, n)
// Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements. value_type is Cpp17EmplaceConstructible into X from *i.
// Effects: Constructs an empty container with at least n buckets, using hasher() as the hash function and key_equal() as the key equality predicate, and inserts elements from [i, j) into it.
// Complexity: Average case O(N) (N is distance(i, j)), worst case O(N2). X(i, j)
// Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements. value_type is Cpp17EmplaceConstructible into X from *i.
// Effects: Constructs an empty container with an unspecified number of buckets, using hasher() as the hash function and key_equal() as the key equality predicate, and inserts elements from [i, j) into it.
// Complexity: Average case O(N) (N is distance(i, j)), worst case O(N2).
X(from_range, rg, n, hf, eq)
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *ranges::begin(rg).
// Effects: Constructs an empty container with at least n buckets, using hf as the hash function and eq as the key equality predicate, and inserts elements from rg into it.
// Complexity: Average case O(N) (N is ranges::distance(rg)), worst case O(N2).
X(from_range, rg, n, hf)
// Preconditions: key_equal meets the Cpp17DefaultConstructible requirements. value_type is Cpp17- EmplaceConstructible into X from *ranges::begin(rg).
// Effects: Constructs an empty container with at least n buckets, using hf as the hash function and key_equal() as the key equality predicate, and inserts elements from rg into it.
// Complexity: Average case O(N) (N is ranges::distance(rg)), worst case O(N2). X(from_range, rg, n)
// Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements. value_type is Cpp17EmplaceConstructible into X from *ranges::begin(rg).
// Effects: Constructs an empty container with at least n buckets, using hasher() as the hash function and key_equal() as the key equality predicate, and inserts elements from rg into it.
// Complexity: Average case O(N) (N is ranges::distance(rg)), worst case O(N2). X(from_range, rg)
// Preconditions: hasher and key_equal meet the Cpp17DefaultConstructible requirements. value_type is Cpp17EmplaceConstructible into X from *ranges::begin(rg).
// Effects: Constructs an empty container with an unspecified number of buckets, using hasher() as the hash function and key_equal() as the key equality predicate, and inserts elements from rg into it.
// Complexity: Average case O(N) (N is ranges::distance(rg)), worst case O(N2). X(il)
// Effects: Equivalent to X(il.begin(), il.end()).
X(il, n)
// Effects: Equivalent to X(il.begin(), il.end(), n).
X(il, n, hf)
// Effects: Equivalent to X(il.begin(), il.end(), n, hf).
X(il, n, hf, eq)
// Effects: Equivalent to X(il.begin(), il.end(), n, hf, eq).
X(b)
// Result: X&
// Preconditions: value_type is Cpp17CopyInsertable into X and Cpp17CopyAssignable.
// Effects: Assigns the range [il.begin(), il.end()) into a. All existing elements of a are either assigned to or destroyed.
// Complexity: Average case linear in il.size(), worst case quadratic.
a = il
    b.key_eq()
// Effects: In addition to the container requirements (24.2.2.1), copies the hash function, predicate, and maximum load factor.
// Complexity: Average case linear in b.size(), worst case quadratic. a=b
// Result: X&
// Effects: In addition to the container requirements, copies the hash function, predicate, and maximum load factor.
// Complexity: Average case linear in b.size(), worst case quadratic.
    b.hash_function()
// Result: hasher
// Returns: b’s hash function.  Complexity: Constant.
// Result: key_equal
// Returns: b’s key equality predicate. Complexity: Constant.
    a_uniq.emplace(args)
// Result: pair<iterator, bool>
// Preconditions: value_type is Cpp17EmplaceConstructible into X from args.
// Effects: Inserts a value_type object t constructed with std::forward<Args>(args)... if and only if there is no element in the container with key equivalent to the key of t.
// Returns: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of t.
// Complexity: Average case O(1), worst case O(a_uniq.size()).
    a_eq.emplace(args)
// Result: iterator
// Preconditions: value_type is Cpp17EmplaceConstructible into X from args.
// Effects: Inserts a value_type object t constructed with std::forward<Args>(args)... and Returns: An iterator pointing to the newly inserted element.
// Complexity: Average case O(1), worst case O(a_eq.size()).
    a.emplace_hint(p, args)
// Result: iterator
// Preconditions: value_type is Cpp17EmplaceConstructible into X from args. Effects: Equivalent to a.emplace(std::forward<Args>(args)...).
// Returns: An iterator pointing to the element with the key equivalent to the newly inserted element. The const_iterator p is a hint pointing to where the search should start. Implementations are permitted to ignore the hint.
// Complexity: Average case O(1), worst case O(a.size()).
    a_uniq.insert(t)
// Result: pair<iterator, bool>
// Preconditions: If t is a non-const rvalue, value_type is Cpp17MoveInsertable into X; otherwise, value_type is Cpp17CopyInsertable into X.
// Effects: Inserts t if and only if there is no element in the container with key equivalent to the key of t.
// Returns: The bool component of the returned pair indicates whether the insertion takes place, and the iterator component points to the element with key equivalent to the key of t.
// Complexity: Average case O(1), worst case O(a_uniq.size()).
    a_eq.insert(t)
// Result: iterator
// Preconditions: If t is a non-const rvalue, value_type is Cpp17MoveInsertable into X; otherwise, value_type is Cpp17CopyInsertable into X.
// Effects: Inserts t.
// Returns: An iterator pointing to the newly inserted element.
// Complexity: Average case O(1), worst case O(a_eq.size()).
    a.insert(p, t)
// Result: iterator
// Preconditions: If t is a non-const rvalue, value_type is Cpp17MoveInsertable into X; otherwise, value_type is Cpp17CopyInsertable into X.
// Effects: Equivalent to a.insert(t). The iterator p is a hint pointing to where the search should start. Implementations are permitted to ignore the hint.
// Returns: An iterator pointing to the element with the key equivalent to that of t. Complexity: Average case O(1), worst case O(a.size()).
    a.insert(i, j)
// Result: void
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *i. Neither i nor j are iterators into a.
// Effects: Equivalent to a.insert(t) for each element in [i,j).
// Complexity: Average case O(N), where N is distance(i, j), worst case O(N(a.size() + 1)).
    a.insert_range(rg)
// Result: void
// Preconditions: value_type is Cpp17EmplaceConstructible into X from *ranges::begin(rg). rg and a do not overlap.
// Effects: Equivalent to a.insert(t) for each element t in rg.
// Complexity: Average case O(N), where N is ranges::distance(rg), worst case O(N(a.size() + 1)).
    a.insert(il)
// Effects: Equivalent to a.insert(il.begin(), il.end()).
    a_uniq.insert(nh)
// Result: insert_return_type
// Preconditions: nh is empty or a_uniq.get_allocator() == nh.get_allocator() is true.
// Effects: If nh is empty, has no effect. Otherwise, inserts the element owned by nh if and only if there is no element in the container with a key equivalent to nh.key().
// Postconditions: If nh is empty, inserted is false, position is end(), and node is empty. Otherwise if the insertion took place, inserted is true, position points to the inserted element, and node is empty; if the insertion failed, inserted is false, node has the previous value of nh, and position points to an element with a key equivalent to nh.key().
// Complexity: Average case O(1), worst case O(a_uniq.size()).
    a_eq.insert(nh)
// Result: iterator
// Preconditions: nh is empty or a_eq.get_allocator() == nh.get_allocator() is true.
// Effects: If nh is empty, has no effect and returns a_eq.end(). Otherwise, inserts the element owned by nh and returns an iterator pointing to the newly inserted element.
// Postconditions: nh is empty.
// Complexity: Average case O(1), worst case O(a_eq.size()).
    a.insert(q, nh)
// Result: iterator
// Preconditions: nh is empty or a.get_allocator() == nh.get_allocator() is true.
// Effects: If nh is empty, has no effect and returns a.end(). Otherwise, inserts the element owned by nh if and only if there is no element with key equivalent to nh.key() in containers with unique keys; always inserts the element owned by nh in containers with equivalent keys. The iterator q is a hint pointing to where the search should start. Implementations are permitted to ignore the hint.
// Postconditions: nh is empty if insertion succeeds, unchanged if insertion fails. Returns: An iterator pointing to the element with key equivalent to nh.key(). Complexity: Average case O(1), worst case O(a.size()).
    a.extract(k)
// Result: node_type
// Effects: Removes an element in the container with key equivalent to k.
// Returns: A node_type owning the element if found, otherwise an empty node_type. Complexity: Average case O(1), worst case O(a.size()).
    a_tran.extract(kx)
// Result: node_type
// Effects: Removes an element in the container with key equivalent to kx.
// Returns: A node_type owning the element if found, otherwise an empty node_type. Complexity: Average case O(1), worst case O(a_tran.size()).
    a.extract(q)
// Result: node_type
// Effects: Removes the element pointed to by q.
// Returns: A node_type owning that element.
// Complexity: Average case O(1), worst case O(a.size()).
    a.merge(a2)
// Result: void
// Preconditions: a.get_allocator() == a2.get_allocator().
// Effects: Attempts to extract each element in a2 and insert it into a using the hash function and key equality predicate of a. In containers with unique keys, if there is an element in a with key equivalent to the key of an element from a2, then that element is not extracted from a2.
// Postconditions: Pointers and references to the transferred elements of a2 refer to those same elements but as members of a. Iterators referring to the transferred elements and all iterators referring to a will be invalidated, but iterators to elements remaining in a2 will remain valid.
// Complexity: Average case O(N), where N is a2.size(), worst case O(N*a.size() + N).
    a.erase(k)
    a.clear()
    b.find(k)
// Result: size_type
// Effects: Erases all elements with key equivalent to k.
// Returns: The number of elements erased.
// Complexity: Average case O(a.count(k)), worst case O(a.size()).
    a_tran.erase(kx)
    a.erase(q)
    a.erase(r)
// Result: size_type
// Effects: Erases all elements with key equivalent to kx.
// Returns: The number of elements erased.
// Complexity: Average case O(a_tran.count(kx)), worst case O(a_tran.size()).
// Result: iterator
// Effects: Erases the element pointed to by q.
// Returns: The iterator immediately following q prior to the erasure.
// Complexity: Average case O(1), worst case O(a.size()).
// Result: iterator
// Effects: Erases the element pointed to by r.
// Returns: The iterator immediately following r prior to the erasure.
// Complexity: Average case O(1), worst case O(a.size()).
    a.erase(q1, q2)
// Result: iterator
// Effects: Erases all elements in the range [q1, q2).
// Returns: The iterator immediately following the erased elements prior to the erasure. Complexity: Average case linear in distance(q1, q2), worst case O(a.size()).
// Result: void
// Effects: Erases all elements in the container. Postconditions: a.empty() is true. Complexity: Linear in a.size().
// Result: iterator; const_iterator for const b.
// Returns: An iterator pointing to an element with key equivalent to k, or b.end() if no such element exists.
// Complexity: Average case O(1), worst case O(b.size()).
    a_tran.find(ke)
// Result: iterator; const_iterator for const a_tran.
// Returns: An iterator pointing to an element with key equivalent to ke, or a_tran.end() if no such element exists.
// Complexity: Average case O(1), worst case O(a_tran.size()).
    b.count(k)
// Result: size_type
// Returns: The number of elements with key equivalent to k. Complexity: Average case O(b.count(k)), worst case O(b.size()).
    a_tran.count(ke)
// Result: size_type
// Returns: The number of elements with key equivalent to ke.
// Complexity: Average case O(a_tran.count(ke)), worst case O(a_tran.size()).
    b.contains(k)
// Effects: Equivalent to b.find(k) != b.end().
    a_tran.contains(ke)
// Effects: Equivalent to a_tran.find(ke) != a_tran.end().
    b.equal_range(k)
// Result: pair<iterator, iterator>; pair<const_iterator, const_iterator> for const b. Returns: A range containing all elements with keys equivalent to k. Returns make_pair(b.end(), b.end()) if no such elements exist.
// Complexity: Average case O(b.count(k)), worst case O(b.size()).
    a_tran.equal_range(ke)
// Result: pair<iterator, iterator>; pair<const_iterator, const_iterator> for const a_tran. Returns: A range containing all elements with keys equivalent to ke. Returns make_pair(a_tran.end(), a_tran.end()) if no such elements exist.
// Complexity: Average case O(a_tran.count(ke)), worst case O(a_tran.size()).
    b.bucket_count()
// Result: size_type
// Returns: The number of buckets that b contains. Complexity: Constant.
    b.max_bucket_count()
// Result: size_type
// Returns: An upper bound on the number of buckets that b can ever contain. Complexity: Constant.
    b.bucket(k)
// Result: size_type
// Preconditions: b.bucket_count() > 0.
// Returns: The index of the bucket in which elements with keys equivalent to k would be found, if any such element existed. The return value is in the range [0, b.bucket_count()).
// Complexity: Constant.
    b.bucket_size(n)
// Result: size_type
// Preconditions: n shall be in the range [0, b.bucket_count()). Returns: The number of elements in the nth bucket. Complexity: O(b.bucket_size(n))
    b.begin(n)
    b.end(n)
    b.cend(n)
// Result: local_iterator; const_local_iterator for const b.
// Preconditions: n is in the range [0, b.bucket_count()).
// Returns: An iterator referring to the first element in the bucket. If the bucket is empty, then b.begin(n) == b.end(n). Complexity: Constant.
// Result: local_iterator; const_local_iterator for const b. Preconditions: n is in the range [0, b.bucket_count()).
// Returns: An iterator which is the past-the-end value for the bucket. Complexity: Constant.
    b.cbegin(n)
// Result: const_local_iterator
// Preconditions: n shall be in the range [0, b.bucket_count()).
// Returns: An iterator referring to the first element in the bucket. If the bucket is empty, then b.cbegin(n) == b.cend(n).
// Complexity: Constant.
// Result: const_local_iterator
// Preconditions: n is in the range [0, b.bucket_count()).
// Returns: An iterator which is the past-the-end value for the bucket.  Complexity: Constant.
    b.load_factor()
// Result: float
// Returns: The average number of elements per bucket. Complexity: Constant.
    b.max_load_factor()
// Result: float
// Returns: A positive number that the container attempts to keep the load factor less than or equal to. The container automatically increases the number of buckets as necessary to keep the load factor below this number.
// Complexity: Constant.
    a.max_load_factor(z)
// Result: void
// Preconditions: z is positive. May change the container’s maximum load factor, using z as a hint. Complexity: Constant.
    a.rehash(n)
// Result: void
// Postconditions: a.bucket_count() >= a.size() / a.max_load_factor() and a.bucket_count() >= n.
// Complexity: Average case linear in a.size(), worst case quadratic.
    a.reserve(n)
// Effects: Equivalent to a.rehash(ceil(n / a.max_load_factor())).
// — It has an InputIterator template parameter and a type that does not qualify as an input iterator is deduced for that parameter.
// — It has an Allocator template parameter and a type that does not qualify as an allocator is deduced for that parameter.
// — It has a Hash template parameter and an integral type or a type that qualifies as an allocator is deduced for that parameter.
// — It has a Pred template parameter and a type that qualifies as an allocator is deduced for that parameter. 24.2.8.2 Exception safety guarantees [unord.req.except]
//  Two unordered containers a and b compare equal if a.size() == b.size() and, for every equivalent- key group [Ea1, Ea2) obtained from a.equal_range(Ea1), there exists an equivalent-key group [Eb1, Eb2) obtained from b.equal_range(Ea1), such that is_permutation(Ea1, Ea2, Eb1, Eb2) returns true. For unordered_set and unordered_map, the complexity of operator== (i.e., the number of calls to the == operator of the value_type, to the predicate returned by key_eq(), and to the hasher returned by hash_- function()) is proportional to N in the average case and to N2 in the worst case, where N is a.size(). For unordered_multiset and unordered_multimap, the complexity of operator== is proportional to 􏰒 Ei2 in the average case and to N2 in the worst case, where N is a.size(), and Ei is the size of the ith equivalent-key group in a. However, if the respective elements of each corresponding pair of equivalent-key groups Eai and Ebi are arranged in the same order (as is commonly the case, e.g., if a and b are unmodified copies of the same container), then the average-case complexity for unordered_multiset and unordered_multimap becomes proportional to N (but worst-case complexity remains O(N2), e.g., for a pathologically bad hash function). The behavior of a program that uses operator== or operator!= on unordered containers is undefined unless the Pred function object has the same behavior for both containers and the equality comparison function for Key is a refinement214 of the partition into equivalent-key groups produced by Pred.
// The iterator types iterator and const_iterator of an unordered associative container are of at least the forward iterator category. For unordered associative containers where the key type and value type are the same, both iterator and const_iterator are constant iterators.
//  The insert, insert_range, and emplace members shall not affect the validity of references to container elements, but may invalidate all iterators to the container. The erase members shall invalidate only iterators and references to the erased elements, and preserve the relative order of the elements that are not erased.
//  The insert, insert_range, and emplace members shall not affect the validity of iterators if (N+n) <= z * B, where N is the number of elements in the container prior to the insert operation, n is the number of elements inserted, B is the container’s bucket count, and z is the container’s maximum load factor.
//  The extract members invalidate only iterators to the removed element, and preserve the relative order of the elements that are not erased; pointers and references to the removed element remain valid. However, accessing the element through such pointers and references while the element is owned by a node_type is undefined behavior. References and pointers to an element obtained while it is owned by a node_type are invalidated if the element is successfully inserted.
//  The member function templates find, count, equal_range, contains, extract, and erase shall not participate in overload resolution unless the qualified-ids Pred::is_transparent and Hash::is_transparent are both valid and denote types (13.10.3). Additionally, the member function templates extract and erase shall not participate in overload resolution if is_convertible_v<K&&, iterator> || is_convertible_- v<K&&, const_iterator> is true, where K is the type substituted as the first template argument.
//  A deduction guide for an unordered associative container shall not participate in overload resolution if any of the following are true:
//  For unordered associative containers, no clear() function throws an exception. erase(k) does not throw an exception unless that exception is thrown by the container’s Hash or Pred object (if any).
//  For unordered associative containers, if an exception is thrown by any operation other than the container’s hash function from within an insert or emplace function inserting a single element, the insertion has no effect.
//  For unordered associative containers, no swap function throws an exception unless that exception is thrown by the swap of the container’s Hash or Pred object (if any).
// For unordered associative containers, if an exception is thrown from within a rehash() function other than by the container’s hash function or comparison function, the rehash() function has no effect.
int main() {
    cout  <<  n4910 << endl;
    return EXIT_SUCCESS;
}

編纂・実行結果(compile and go)

bash
$ clang++ p841.cpp -std=03 -o p841l -I. -Wall
In file included from p841.cpp:10:
In file included from ./N4910.h:11:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/atomic:38:
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/c++0x_warning.h:32:2: error: This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
 ^
p841.cpp:19:1: error: unknown type name 'i'
i// [Example 1: The copy constructor of type vector<vector<int>> has linear complexity, even though the complexity of copying each contained vector<int> is itself linear.
^
p841.cpp:26:13: error: use of undeclared identifier 'X'
   typename X::value_type
            ^
p841.cpp:30:10: error: use of undeclared identifier 'X'
typename X::const_reference
         ^
p841.cpp:32:10: error: use of undeclared identifier 'X'
typename X::iterator
         ^
p841.cpp:37:2: error: expected ';' after top level declarator
X u(a); X u = a;
 ^
 ;
p841.cpp:37:9: error: unknown type name 'X'
X u(a); X u = a;
        ^
p841.cpp:37:15: error: use of undeclared identifier 'a'
X u(a); X u = a;
              ^
p841.cpp:38:1: error: unknown type name 'X'
X u(rv);
^
p841.cpp:38:5: error: unknown type name 'rv'
X u(rv);
    ^
p841.cpp:39:1: error: unknown type name 'X'
X u = rv;
^
p841.cpp:39:7: error: use of undeclared identifier 'rv'
X u = rv;
      ^
p841.cpp:40:1: error: C++ requires a type specifier for all declarations
a = rv
^
p841.cpp:40:5: error: use of undeclared identifier 'rv'
a = rv
    ^
p841.cpp:40:7: error: expected ';' after top level declarator
a = rv
      ^
      ;
p841.cpp:44:10: error: 'X' is not a class, namespace, or enumeration
typename X::difference_type
         ^
p841.cpp:37:1: note: 'X' declared here
X u(a); X u = a;
^
p841.cpp:47:2: error: expected ';' after top level declarator
X u = X();
 ^
 ;
p841.cpp:54:1: error: unknown type name 'a'
a.~X()
^
p841.cpp:54:2: error: cannot use dot operator on a type
a.~X()
 ^
p841.cpp:67:3: warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior [-Wc++20-compat]
i <=> j
  ^
     
p841.cpp:105:3: warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior [-Wc++20-compat]
i <=> j i-j
  ^
     
p841.cpp:147:3: warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior [-Wc++20-compat]
a <=> b
  ^
     
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
$ clang++ p841.cpp -std=2b -o p841l -I. -Wall
p841.cpp:19:1: error: unknown type name 'i'
i// [Example 1: The copy constructor of type vector<vector<int>> has linear complexity, even though the complexity of copying each contained vector<int> is itself linear.
^
p841.cpp:26:13: error: use of undeclared identifier 'X'
   typename X::value_type
            ^
p841.cpp:30:10: error: use of undeclared identifier 'X'
typename X::const_reference
         ^
p841.cpp:32:10: error: use of undeclared identifier 'X'
typename X::iterator
         ^
p841.cpp:37:2: error: expected ';' after top level declarator
X u(a); X u = a;
 ^
 ;
p841.cpp:37:9: error: unknown type name 'X'
X u(a); X u = a;
        ^
p841.cpp:37:15: error: use of undeclared identifier 'a'
X u(a); X u = a;
              ^
p841.cpp:38:1: error: unknown type name 'X'
X u(rv);
^
p841.cpp:38:5: error: unknown type name 'rv'
X u(rv);
    ^
p841.cpp:39:1: error: unknown type name 'X'
X u = rv;
^
p841.cpp:39:7: error: use of undeclared identifier 'rv'
X u = rv;
      ^
p841.cpp:40:1: error: C++ requires a type specifier for all declarations
a = rv
^
p841.cpp:40:5: error: use of undeclared identifier 'rv'
a = rv
    ^
p841.cpp:40:7: error: expected ';' after top level declarator
a = rv
      ^
      ;
p841.cpp:44:10: error: 'X' is not a class, namespace, or enumeration
typename X::difference_type
         ^
p841.cpp:37:1: note: 'X' declared here
X u(a); X u = a;
^
p841.cpp:47:2: error: expected ';' after top level declarator
X u = X();
 ^
 ;
p841.cpp:54:1: error: unknown type name 'a'
a.~X()
^
p841.cpp:54:2: error: cannot use dot operator on a type
a.~X()
 ^
p841.cpp:175:1: error: C++ requires a type specifier for all declarations
a=t
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

$ g++ p841.cpp -std=03 -o p841g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
                 from N4910.h:11,
                 from p841.cpp:10:
/usr/local/include/c++/12.1.0/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
   32 | #error This file requires compiler and library support \
      |  ^~~~~
p841.cpp:434:1: warning: identifier 'constexpr' is a keyword in C++11 [-Wc++11-compat]
  434 | constexpr node-handle() noexcept : ptr_(), alloc_() {} node-handle(node-handle&&) noexcept;
      | ^~~~~~~~~
p841.cpp:434:25: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
  434 | constexpr node-handle() noexcept : ptr_(), alloc_() {} node-handle(node-handle&&) noexcept;
      |                         ^~~~~~~~
p841.cpp:19:1: error: 'i' does not name a type
   19 | i// [Example 1: The copy constructor of type vector<vector<int>> has linear complexity, even though the complexity of copying each contained vector<int> is itself linear.
      | ^
p841.cpp:37:9: error: 'X' does not name a type
   37 | X u(a); X u = a;
      |         ^
p841.cpp:38:1: error: 'X' does not name a type
   38 | X u(rv);
      | ^
p841.cpp:39:1: error: 'X' does not name a type
   39 | X u = rv;
      | ^
p841.cpp:40:1: error: 'a' does not name a type
   40 | a = rv
      | ^
p841.cpp:54:1: error: 'a' does not name a type
   54 | a.~X()
      | ^
p841.cpp:175:1: error: 'a' does not name a type
  175 | a=t
      | ^
p841.cpp:185:1: error: 'X' does not name a type
  185 | X u = X();
      | ^
p841.cpp:186:1: error: 'X' does not name a type
  186 | X u(m);
      | ^
p841.cpp:187:1: error: 'X' does not name a type
  187 | X u(t, m);
      | ^
p841.cpp:188:1: error: 'X' does not name a type
  188 | X u(rv);
      | ^
p841.cpp:191:1: error: 'c' does not name a type
  191 | c.get_allocator()
      | ^
p841.cpp:217:1: error: 'a' does not name a type
  217 | a.swap(b)
      | ^
p841.cpp:251:1: error: 'X' does not name a type
  251 | X u(i, j);
      | ^
p841.cpp:252:1: error: 'a' does not name a type
  252 | a = il
      | ^
p841.cpp:305:1: error: 'a' does not name a type
  305 | a.clear()
      | ^
p841.cpp:330:1: error: 'return_type' does not name a type
  330 | return_type F(InputIterator first, InputIterator last);
      | ^~~~~~~~~~~
p841.cpp:334:1: error: 'return_type' does not name a type
  334 | return_type F(const_iterator i1, const_iterator i2,
      | ^~~~~~~~~~~
p841.cpp:342:1: error: 'a' does not name a type
  342 | a.front()
      | ^
p841.cpp:346:3: error: expected unqualified-id before '--' token
  346 |   --tmp;
      |   ^~
p841.cpp:347:3: error: expected unqualified-id before 'return'
  347 |   return *tmp;
      |   ^~~~~~
p841.cpp:349:1: error: 'a' does not name a type
  349 | a.emplace_front(args)
      | ^
p841.cpp:447:1: error: 'node' does not name a type
  447 | node-handle(node-handle&& nh) noexcept;
      | ^~~~
p841.cpp:457:6: error: expected class-name before '-' token
  457 | ~node-handle();
      |      ^
p841.cpp:460:1: error: 'value_type' does not name a type
  460 | value_type& value() const;
      | ^~~~~~~~~~
p841.cpp:464:1: error: 'key_type' does not name a type; did you mean 'key_t'?
  464 | key_type& key() const;
      | ^~~~~~~~
      | key_t
p841.cpp:469:1: error: 'mapped_type' does not name a type
  469 | mapped_type& mapped() const;
      | ^~~~~~~~~~~
p841.cpp:472:1: error: 'node_type' does not name a type
  472 | node_type object pointed to by ptr_.
      | ^~~~~~~~~
p841.cpp:478:55: error: expected unqualified-id before '-' token
  478 | template<class Iterator, class NodeType> struct insert-return-type
      |                                                       ^
p841.cpp:493:32: error: expected initializer before 'noexcept'
  493 | explicit operator bool() const noexcept;
      |                                ^~~~~~~~
p841.cpp:495:1: error: expected unqualified-id before '[' token
  495 | [[nodiscard]] bool empty() const noexcept;
      | ^
p841.cpp:498:6: error: variable or field 'swap' declared void
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |      ^~~~
p841.cpp:498:11: error: 'node' was not declared in this scope
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |           ^~~~
p841.cpp:498:16: error: 'handle' was not declared in this scope
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |                ^~~~~~
p841.cpp:498:24: error: 'nh' was not declared in this scope
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |                        ^~
p841.cpp:536:10: error: 'X' has not been declared
  536 | typename X::key_type
      |          ^
p841.cpp:538:3: error: 'c' was not declared in this scope
  538 | X(c)
      |   ^
p841.cpp:550:12: error: 'X' does not name a type
  550 | X u = X(); X u;
      |            ^
p841.cpp:551:2: error: expected constructor, destructor, or type conversion before '(' token
  551 | X(i, j, c)
      |  ^
p841.cpp:810:12: error: 'X' does not name a type
  810 | X a = X(); X a;
      |            ^
p841.cpp:820:2: error: expected constructor, destructor, or type conversion before '(' token
  820 | X(i, j, n, hf, eq)
      |  ^

$ g++ p841.cpp -std=2b -o p841g -I. -Wall
p841.cpp:19:1: error: 'i' does not name a type
   19 | i// [Example 1: The copy constructor of type vector<vector<int>> has linear complexity, even though the complexity of copying each contained vector<int> is itself linear.
      | ^
p841.cpp:37:9: error: 'X' does not name a type
   37 | X u(a); X u = a;
      |         ^
p841.cpp:38:1: error: 'X' does not name a type
   38 | X u(rv);
      | ^
p841.cpp:39:1: error: 'X' does not name a type
   39 | X u = rv;
      | ^
p841.cpp:40:1: error: 'a' does not name a type
   40 | a = rv
      | ^
p841.cpp:54:1: error: 'a' does not name a type
   54 | a.~X()
      | ^
p841.cpp:175:1: error: 'a' does not name a type
  175 | a=t
      | ^
p841.cpp:185:1: error: 'X' does not name a type
  185 | X u = X();
      | ^
p841.cpp:186:1: error: 'X' does not name a type
  186 | X u(m);
      | ^
p841.cpp:187:1: error: 'X' does not name a type
  187 | X u(t, m);
      | ^
p841.cpp:188:1: error: 'X' does not name a type
  188 | X u(rv);
      | ^
p841.cpp:191:1: error: 'c' does not name a type
  191 | c.get_allocator()
      | ^
p841.cpp:217:1: error: 'a' does not name a type
  217 | a.swap(b)
      | ^
p841.cpp:251:1: error: 'X' does not name a type
  251 | X u(i, j);
      | ^
p841.cpp:252:1: error: 'a' does not name a type
  252 | a = il
      | ^
p841.cpp:305:1: error: 'a' does not name a type
  305 | a.clear()
      | ^
p841.cpp:330:1: error: 'return_type' does not name a type
  330 | return_type F(InputIterator first, InputIterator last);
      | ^~~~~~~~~~~
p841.cpp:334:1: error: 'return_type' does not name a type
  334 | return_type F(const_iterator i1, const_iterator i2,
      | ^~~~~~~~~~~
p841.cpp:342:1: error: 'a' does not name a type
  342 | a.front()
      | ^
p841.cpp:346:3: error: expected unqualified-id before '--' token
  346 |   --tmp;
      |   ^~
p841.cpp:347:3: error: expected unqualified-id before 'return'
  347 |   return *tmp;
      |   ^~~~~~
p841.cpp:349:1: error: 'a' does not name a type
  349 | a.emplace_front(args)
      | ^
p841.cpp:447:1: error: 'node' does not name a type
  447 | node-handle(node-handle&& nh) noexcept;
      | ^~~~
p841.cpp:457:6: error: expected class-name before '-' token
  457 | ~node-handle();
      |      ^
p841.cpp:460:1: error: 'value_type' does not name a type
  460 | value_type& value() const;
      | ^~~~~~~~~~
p841.cpp:464:1: error: 'key_type' does not name a type; did you mean 'key_t'?
  464 | key_type& key() const;
      | ^~~~~~~~
      | key_t
p841.cpp:469:1: error: 'mapped_type' does not name a type
  469 | mapped_type& mapped() const;
      | ^~~~~~~~~~~
p841.cpp:472:1: error: 'node_type' does not name a type
  472 | node_type object pointed to by ptr_.
      | ^~~~~~~~~
p841.cpp:478:55: error: expected unqualified-id before '-' token
  478 | template<class Iterator, class NodeType> struct insert-return-type
      |                                                       ^
p841.cpp:493:1: error: 'explicit' outside class declaration
  493 | explicit operator bool() const noexcept;
      | ^~~~~~~~
p841.cpp:493:32: error: non-member function 'operator bool()' cannot have cv-qualifier
  493 | explicit operator bool() const noexcept;
      |                                ^~~~~~~~
p841.cpp:493:10: error: 'operator bool()' must be a non-static member function
  493 | explicit operator bool() const noexcept;
      |          ^~~~~~~~
p841.cpp:495:34: error: non-member function 'bool empty()' cannot have cv-qualifier
  495 | [[nodiscard]] bool empty() const noexcept;
      |                                  ^~~~~~~~
p841.cpp:498:6: error: variable or field 'swap' declared void
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |      ^~~~
p841.cpp:498:11: error: 'node' was not declared in this scope
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |           ^~~~
p841.cpp:498:16: error: 'handle' was not declared in this scope
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |                ^~~~~~
p841.cpp:498:24: error: 'nh' was not declared in this scope
  498 | void swap(node-handle& nh) noexcept(ator_traits::propagate_on_container_swap::value ||
      |                        ^~
p841.cpp:536:10: error: 'X' has not been declared
  536 | typename X::key_type
      |          ^
p841.cpp:538:3: error: 'c' was not declared in this scope
  538 | X(c)
      |   ^
p841.cpp:550:12: error: 'X' does not name a type
  550 | X u = X(); X u;
      |            ^
p841.cpp:551:2: error: expected constructor, destructor, or type conversion before '(' token
  551 | X(i, j, c)
      |  ^
p841.cpp:810:12: error: 'X' does not name a type
  810 | X a = X(); X a;
      |            ^
p841.cpp:820:2: error: expected constructor, destructor, or type conversion before '(' token
  820 | X(i, j, n, hf, eq)
      |  ^

検討事項(agenda)

コンパイルエラーを取るか、コンパイルエラーの理由を解説する。

参考資料(reference)

関連する自己参照以外は、こちらの先頭に移転。

C言語(C++)に対する誤解、曲解、無理解、爽快。

#include "N4910.h"

C++N4910資料の改善点

dockerにclang

docker gnu(gcc/g++) and llvm(clang/clang++)

コンパイル用shell script C版(clangとgcc)とC++版(clang++とg++)

C++N4910:2022 tag follower 300人超えました。ありがとうございます。

astyle 使ってみた

DoCAP(ドゥーキャップ)って何ですか?

小川メソッド 覚え(書きかけ)

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>

文書履歴(document history)

ver. 0.01 初稿  20220804

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?