はじめに(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.3 Sequence containers [sequences] C++N4910:2022 (639) p876.cpp
算譜(source code)
// 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.3 Sequence containers [sequences] C++N4910:2022 (639) p876.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.3.1 In general [sequences.general]
// The headers <array> (24.3.2), <deque> (24.3.3), <forward_list> (24.3.4), <list> (24.3.5), and <vector> (24.3.6) define class templates that meet the requirements for sequence containers. The following exposition-only alias template may appear in deduction guides for sequence containers:
template<class InputIterator>
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
// 24.3.2 Header <array> synopsis [array.syn]
#include <compare> // see 17.11.1
#include <initializer_list> // see 17.10.2
namespace std {
// 24.3.7, class template array template<class T, size_t N> struct array;
template<class T, size_t N>
constexpr bool operator==(const array<T, N>& x, const array<T, N>& y);
template<class T, size_t N>
constexpr synth-three-way-result<T>
operator<=>(const array<T, N>& x, const array<T, N>& y);
// 24.3.7.4, specialized algorithms template<class T, size_t N>
// exposition only
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
// 24.3.7.6, array creation functions template<class T, size_t N>
constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
template<class T, size_t N>
constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
// 24.3.7.7, tuple interface
template<class T> struct tuple_size;
template<size_t I, class T> struct tuple_element;
template<class T, size_t N>
struct tuple_size<array<T, N>>;
template<size_t I, class T, size_t N>
struct tuple_element<I, array<T, N>>;
template<size_t I, class T, size_t N>
constexpr T& get(array<T, N>&) noexcept;
template<size_t I, class T, size_t N>
constexpr T&& get(array<T, N>&&) noexcept;
template<size_t I, class T, size_t N>
constexpr const T& get(const array<T, N>&) noexcept;
template<size_t I, class T, size_t N>
constexpr const T&& get(const array<T, N>&&) noexcept;
}
// 24.3.3 Header <deque> synopsis [deque.syn]
#include <compare> // see 17.11.1
#include <initializer_list> // see 17.10.2
namespace std {
// 24.3.8, class template deque
template<class T, class Allocator = allocator<T>> class deque;
template<class T, class Allocator>
bool operator==(const deque<T, Allocator>& x, const deque<T, Allocator>& y);
template<class T, class Allocator>
synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
const deque<T, Allocator>& y);
template<class T, class Allocator>
void swap(deque<T, Allocator>& x, deque<T, Allocator>& y)
noexcept(noexcept(x.swap(y)));
template<class T, class Allocator, class U>
typename deque<T, Allocator>::size_type
erase(deque<T, Allocator>& c, const U& value);
template<class T, class Allocator, class Predicate>
typename deque<T, Allocator>::size_type
erase_if(deque<T, Allocator>& c, Predicate pred);
namespace pmr {
template<class T>
using deque = std::deque<T, polymorphic_allocator<T>>;
}
}
// 24.3.4 Header <forward_list> synopsis [forward.list.syn]
#include <compare> // see 17.11.1
#include <initializer_list> // see 17.10.2
namespace std {
// 24.3.9, class template forward_list
template<class T, class Allocator = allocator<T>> class forward_list;
template<class T, class Allocator>
bool operator==(const forward_list<T, Allocator>& x, const forward_list<T, Allocator>& y);
template<class T, class Allocator>
synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
const forward_list<T, Allocator>& y);
template<class T, class Allocator>
void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
noexcept(noexcept(x.swap(y)));
template<class T, class Allocator, class U>
typename forward_list<T, Allocator>::size_type
erase(forward_list<T, Allocator>& c, const U& value);
template<class T, class Allocator, class Predicate>
typename forward_list<T, Allocator>::size_type
erase_if(forward_list<T, Allocator>& c, Predicate pred);
namespace pmr {
template<class T>
using forward_list = std::forward_list<T, polymorphic_allocator<T>>;
}
}
// 24.3.5 Header <list> synopsis [list.syn]
#include <compare> // see 17.11.1
#include <initializer_list> // see 17.10.2
namespace std {
// 24.3.10, class template list
template<class T, class Allocator = allocator<T>> class list;
template<class T, class Allocator>
bool operator==(const list<T, Allocator>& x, const list<T, Allocator>& y);
template<class T, class Allocator>
synth-three-way-result<T> operator<=>(const list<T, Allocator>& x,
const list<T, Allocator>& y);
template<class T, class Allocator>
void swap(list<T, Allocator>& x, list<T, Allocator>& y)
noexcept(noexcept(x.swap(y)));
template<class T, class Allocator, class U>
typename list<T, Allocator>::size_type
erase(list<T, Allocator>& c, const U& value);
template<class T, class Allocator, class Predicate>
typename list<T, Allocator>::size_type
erase_if(list<T, Allocator>& c, Predicate pred);
namespace pmr {
template<class T>
using list = std::list<T, polymorphic_allocator<T>>;
}
}
// 24.3.6 Header <vector> synopsis [vector.syn]
#include <compare> // see 17.11.1
#include <initializer_list> // see 17.10.2
namespace std {
// 24.3.11, class template vector
template<class T, class Allocator = allocator<T>> class vector;
template<class T, class Allocator>
constexpr bool operator==(const vector<T, Allocator>& x, const vector<T, Allocator>& y);
template<class T, class Allocator>
constexpr synth-three-way-result<T> operator<=>(const vector<T, Allocator>& x,
const vector<T, Allocator>& y);
template<class T, class Allocator>
constexpr void swap(vector<T, Allocator>& x, vector<T, Allocator>& y)
noexcept(noexcept(x.swap(y)));
template<class T, class Allocator, class U>
constexpr typename vector<T, Allocator>::size_type
erase(vector<T, Allocator>& c, const U& value);
template<class T, class Allocator, class Predicate>
constexpr typename vector<T, Allocator>::size_type
erase_if(vector<T, Allocator>& c, Predicate pred);
// 24.3.12, class vector<bool>
template<class Allocator> class vector<bool, Allocator>;
// hash support
template<class T> struct hash;
template<class Allocator> struct hash<vector<bool, Allocator>>;
namespace pmr {
template<class T>
using vector = std::vector<T, polymorphic_allocator<T>>;
}
}
// 24.3.7 Class template array [array]
// 24.3.7.1 Overview [array.overview]
// The header <array> defines a class template for storing fixed-size sequences of objects. An array is a contiguous container (24.2.2.1). An instance of array<T, N> stores N elements of type T, so that size() == N is an invariant.
// An array is an aggregate (9.4.2) that can be list-initialized with up to N elements whose types are convertible to T.
// An array meets all of the requirements of a container (24.2.2.2) and of a reversible container (24.2.2.3), except that a default constructed array object is not empty if N > 0. An array meets some of the requirements of a sequence container (24.2.4). Descriptions are provided here only for operations on array that are not described in one of these tables and for operations where there is additional semantic information.
// array<T, N> is a structural type (13.2) if T is a structural type. Two values a1 and a2 of type array<T, N> are template-argument-equivalent (13.6) if and only if each pair of corresponding elements in a1 and a2 are template-argument-equivalent.
// The types iterator and const_iterator meet the constexpr iterator requirements (25.3.1).
namespace std {
template<class T, size_t N>
struct array {
// types
using value_type =T;
using pointer = T*;
using const_pointer = const T*;
using reference = T&;
using const_reference = const T&;
using size_type = size_t;
using difference_type = ptrdiff_t;
using iterator = implementation-defined ; // see 24.2
using const_iterator = implementation-defined ; // see 24.2
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// no explicit construct/copy/destroy for aggregate type
constexpr void fill(const T& u);
constexpr void swap(array&) noexcept(is_nothrow_swappable_v<T>);
// iterators
constexpr iterator
constexpr const_iterator
constexpr iterator
constexpr const_iterator
constexpr reverse_iterator
constexpr const_reverse_iterator rbegin() const noexcept;
constexpr reverse_iterator rend() noexcept;
constexpr const_reverse_iterator rend() const noexcept;
constexpr const_iterator cbegin() const noexcept;
constexpr const_iterator cend() const noexcept;
constexpr const_reverse_iterator crbegin() const noexcept;
constexpr const_reverse_iterator crend() const noexcept;
// capacity
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr size_type size() const noexcept;
constexpr size_type max_size() const noexcept;
// element access
constexpr reference operator[](size_type n);
constexpr const_reference operator[](size_type n) const;
begin() noexcept;
begin() const noexcept;
end() noexcept;
end() const noexcept;
rbegin() noexcept;
constexpr reference at(size_type n);
constexpr const_reference at(size_type n) const;
constexpr reference front();
constexpr const_reference front() const;
constexpr reference back();
constexpr const_reference back() const;
constexpr T * data() noexcept;
constexpr const T * data() const noexcept;
};
template<class T, class... U>
array(T, U...) -> array<T, 1 + sizeof...(U)>;
}
// 24.3.7.2 Constructors, copy, and assignment [array.cons]
// The conditions for an aggregate (9.4.2) shall be met. Class array relies on the implicitly-declared special member functions (11.4.5.2, 11.4.7, 11.4.5.3) to conform to the container requirements table in 24.2. In addition to the requirements specified in the container requirements table, the implicit move constructor and move assignment operator for array require that T be Cpp17MoveConstructible or Cpp17MoveAssignable, respectively.
template<class T, class... U>
array(T, U...) -> array<T, 1 + sizeof...(U)>;
// Mandates: (is_same_v<T, U> && ...) is true.
// 24.3.7.3 Member functions [array.members]
constexpr size_type size() const noexcept;
// Returns: N.
constexpr T* data() noexcept;
constexpr const T* data() const noexcept;
// Returns: A pointer such that [data(),data() + size()) is a valid range. For a non-empty array, data() == addressof(front()).
constexpr void fill(const T& u);
// Effects: As if by fill_n(begin(), N, u).
constexpr void swap(array& y) noexcept(is_nothrow_swappable_v<T>);
// Effects: Equivalent to swap_ranges(begin(), end(), y.begin()).
// [Note 1 : Unlike the swap function for other containers, array::swap takes linear time, can exit via an exception, and does not cause iterators to become associated with the other container. —end note]
// 24.3.7.4 Specialized algorithms [array.special]
template<class T, size_t N>
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
// Constraints: N == 0 or is_swappable_v<T> is true. Effects: As if by x.swap(y).
// Complexity: Linear in N.
// 24.3.7.5 Zero-sized arrays [array.zero]
// array shall provide support for the special case N == 0.
// In the case that N == 0, begin() == end() == unique value. The return value of data() is unspecified.
// The effect of calling front() or back() for a zero-sized array is undefined.
// Member function swap() shall have a non-throwing exception specification.
// 24.3.7.6 Array creation functions [array.creation]
template<class T, size_t N>
constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
// Mandates: is_array_v<T> is false and is_constructible_v<T, T&> is true. // Preconditions: T meets the Cpp17CopyConstructible requirements.
// Returns: {{ a[0], ..., a[N - 1] }}.
template<class T, size_t N>
constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
// Mandates: is_array_v<T> is false and is_move_constructible_v<T> is true. Preconditions: T meets the Cpp17MoveConstructible requirements.
// Returns: {{ std::move(a[0]), ..., std::move(a[N - 1]) }}.
// 24.3.7.7 Tuple interface [array.tuple]
template<class T, size_t N>
struct tuple_size<array<T, N>> : integral_constant<size_t, N> { };
template<size_t I, class T, size_t N>
struct tuple_element<I, array<T, N>> {
using type = T;
};
// Mandates: I < N is true.
template<size_t I, class T, size_t N>
constexpr T& get(array<T, N>& a) noexcept;
template<size_t I, class T, size_t N>
constexpr T&& get(array<T, N>&& a) noexcept;
template<size_t I, class T, size_t N>
constexpr const T& get(const array<T, N>& a) noexcept;
template<size_t I, class T, size_t N>
constexpr const T&& get(const array<T, N>&& a) noexcept;
// Mandates: I < N is true.
// Returns: A reference to the Ith element of a, where indexing is zero-based.
// 24.3.8 Class template deque [deque]
// 24.3.8.1 Overview [deque.overview]
// A deque is a sequence container that supports random access iterators (25.3.5.7). In addition, it supports constant time insert and erase operations at the beginning or the end; insert and erase in the middle take linear time. That is, a deque is especially optimized for pushing and popping elements at the beginning and end. Storage management is handled automatically.
// A deque meets all of the requirements of a container (24.2.2.2), of a reversible container (24.2.2.3), of an allocator-aware container (24.2.2.5), and of a sequence container, including the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on deque that are not described in one of these tables or for operations where there is additional semantic information.
namespace std {
template<class T, class Allocator = allocator<T>>
class deque {
public:
// types
using value_type =T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
= value_type&;
using reference = const value_type&;
using const_reference = implementation-defined ; // see 24.2
using size_type = implementation-defined ; // see 24.2
using difference_type = implementation-defined ; // see 24.2
iterator
const_iterator
iterator
const_iterator
iterator
const_iterator
reverse_iterator
const_reverse_iterator rbegin() const noexcept;
reverse_iterator rend() noexcept;
const_reverse_iterator rend() const noexcept;
const_iterator cbegin() const noexcept;
const_iterator cend() const noexcept;
const_reverse_iterator crbegin() const noexcept;
const_reverse_iterator crend() const noexcept;
// 24.3.8.3, capacity
[[nodiscard]] bool empty() const noexcept;
size_type size() const noexcept;
size_type max_size() const noexcept;
void
void
void
// element
reference
const_reference operator[](size_type n) const;
reference at(size_type n);
const_reference at(size_type n) const;
reference front();
const_reference front() const;
reference back();
resize(size_type sz);
resize(size_type sz, const T& c);
shrink_to_fit();
access
operator[](size_type n);
= implementation-defined ; // see 24.2
= std::reverse_iterator<iterator>;
using
using
using reverse_iterator
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// 24.3.8.2, construct/copy/destroy
deque() : deque(Allocator()) { }
explicit deque(const Allocator&);
explicit deque(size_type n, const Allocator& = Allocator());
deque(size_type n, const T& value, const Allocator& = Allocator());
template<class InputIterator>
deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
template<container-compatible-range<T> R>
deque(from_range_t, R&& rg, const Allocator& = Allocator());
deque(const deque& x);
deque(deque&&);
deque(const deque&, const type_identity_t<Allocator>&);
deque(deque&&, const type_identity_t<Allocator>&);
deque(initializer_list<T>, const Allocator& = Allocator());
~deque();
deque& operator=(const deque& x);
deque& operator=(deque&& x)
noexcept(allocator_traits<Allocator>::is_always_equal::value);
deque& operator=(initializer_list<T>);
template<class InputIterator>
void assign(InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
void assign_range(R&& rg);
void assign(size_type n, const T& t);
void assign(initializer_list<T>);
allocator_type get_allocator() const noexcept;
// iterators
begin() noexcept;
begin() const noexcept;
end() noexcept;
end() const noexcept;
rbegin() noexcept;
Effects:
Constructs an empty deque, using the specified allocator. Complexity:
Constant.
const_reference back() const;
// 24.3.8.4, modifiers
template<class... Args> reference emplace_front(Args&&... args);
template<class... Args> reference emplace_back(Args&&... args);
template<class... Args> iterator emplace(const_iterator position, Args&&... args);
void push_front(const T& x);
void push_front(T&& x);
template<container-compatible-range<T> R>
void prepend_range(R&& rg);
void push_back(const T& x);
void push_back(T&& x);
template<container-compatible-range<T> R>
void append_range(R&& rg);
iterator insert(const_iterator position, const T& x);
iterator insert(const_iterator position, T&& x);
iterator insert(const_iterator position, size_type n, const T& x);
template<class InputIterator>
iterator insert(const_iterator position, InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
iterator insert_range(const_iterator position, R&& rg);
iterator insert(const_iterator position, initializer_list<T>);
void pop_front();
void pop_back();
iterator erase(const_iterator position);
iterator erase(const_iterator first, const_iterator last);
void swap(deque&)
noexcept(allocator_traits<Allocator>::is_always_equal::value);
void clear() noexcept;
};
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
-> deque<iter-value-type<InputIterator>, Allocator>;
template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
deque(from_range_t, R&&, Allocator = Allocator())
-> deque<ranges::range_value_t<R>, Allocator>;
}
// 24.3.8.2 Constructors, copy, and assignment [deque.cons]
explicit deque(const Allocator&);
explicit deque(size_type n, const Allocator& = Allocator());
Preconditions:
T is Cpp17DefaultInsertable into *this.
// Effects: Constructs a deque with n default-inserted elements using the specified allocator. Complexity: Linear in n.
deque(size_type n, const T& value, const Allocator& = Allocator());
// Preconditions: T is Cpp17CopyInsertable into *this.
// Effects: Constructs a deque with n copies of value, using the specified allocator. Complexity: Linear in n.
template<class InputIterator>
deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
// Effects: Constructs a deque equal to the range [first, last), using the specified allocator. Complexity: Linear in distance(first, last).
template<container-compatible-range<T> R>
deque(from_range_t, R&& rg, const Allocator& = Allocator());
// ffects: Constructs a deque with the elements of the range rg, using the specified allocator. Complexity: Linear in ranges::distance(rg).
// 24.3.8.3 Capacity [deque.capacity]
void resize(size_type sz);
// Preconditions: T is Cpp17MoveInsertable and Cpp17DefaultInsertable into *this.
// Effects: If sz < size(), erases the last size() - sz elements from the sequence. Otherwise, appends
sz - size() default-inserted elements to the sequence.
void resize(size_type sz, const T& c);
// Preconditions: T is Cpp17CopyInsertable into *this.
// Effects: If sz < size(), erases the last size() - sz elements from the sequence. Otherwise, appends
sz - size() copies of c to the sequence.
void shrink_to_fit();
// Preconditions: T is Cpp17MoveInsertable into *this.
// Effects: shrink_to_fit is a non-binding request to reduce memory use but does not change the size of
the sequence.
// [Note 1: The request is non-binding to allow latitude for implementation-specific optimizations. —end note] If the size is equal to the old capacity, or if an exception is thrown other than by the move constructor of a non-Cpp17CopyInsertable T, then there are no effects.
// Complexity: If the size is not equal to the old capacity, linear in the size of the sequence; otherwise
constant.
// Remarks: If the size is not equal to the old capacity, then invalidates all the references, pointers, and iterators referring to the elements in the sequence, as well as the past-the-end iterator.
// 24.3.8.4 Modifiers [deque.modifiers]
iterator insert(const_iterator position, const T& x);
iterator insert(const_iterator position, T&& x);
iterator insert(const_iterator position, size_type n, const T& x);
template<class InputIterator>
iterator insert(const_iterator position,
InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
iterator insert_range(const_iterator position, R&& rg);
iterator insert(const_iterator position, initializer_list<T>);
template<class... Args> reference emplace_front(Args&&... args);
template<class... Args> reference emplace_back(Args&&... args);
template<class... Args> iterator emplace(const_iterator position, Args&&... args);
void push_front(const T& x);
void push_front(T&& x);
template<container-compatible-range<T> R>
void prepend_range(R&& rg);
void push_back(const T& x);
void push_back(T&& x);
template<container-compatible-range<T> R> void append_range(R&& rg);
// Effects: An insertion in the middle of the deque invalidates all the iterators and references to elements of the deque. An insertion at either end of the deque invalidates all the iterators to the deque, but has no effect on the validity of references to elements of the deque.
// Complexity: The complexity is linear in the number of elements inserted plus the lesser of the distances to the beginning and end of the deque. Inserting a single element at either the beginning or end of a deque always takes constant time and causes a single call to a constructor of T.
Remarks:
If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move assignment operator of T there are no effects. If an exception is thrown while inserting a single element at either end, there are no effects. Otherwise, if an exception is thrown by the move constructor of a non-Cpp17CopyInsertable T, the effects are unspecified.
iterator erase(const_iterator position);
iterator erase(const_iterator first, const_iterator last);
void pop_front();
void pop_back();
// Effects: An erase operation that erases the last element of a deque invalidates only the past-the-end iterator and all iterators and references to the erased elements. An erase operation that erases the first element of a deque but not the last element invalidates only iterators and references to the erased elements. An erase operation that erases neither the first element nor the last element of a deque invalidates the past-the-end iterator and all iterators and references to all the elements of the deque.
// [Note 1: pop_front and pop_back are erase operations.
Throws:
Nothing unless an exception is thrown by the assignment operator of T.
// Complexity: The number of calls to the destructor of T is the same as the number of elements erased, but the number of calls to the assignment operator of T is no more than the lesser of the number of elements before the erased elements and the number of elements after the erased elements.
// 24.3.8.5 Erasure [deque.erasure]
template<class T, class Allocator, class U>
typename deque<T, Allocator>::size_type
erase(deque<T, Allocator>& c, const U& value);
// Effects: Equivalent to:
auto it = remove(c.begin(), c.end(), value);
auto r = distance(it, c.end());
c.erase(it, c.end());
return r;
template<class T, class Allocator, class Predicate>
typename deque<T, Allocator>::size_type
erase_if(deque<T, Allocator>& c, Predicate pred);
// Effects: Equivalent to:
auto it = remove_if(c.begin(), c.end(), pred);
auto r = distance(it, c.end());
c.erase(it, c.end());
return r;
// 24.3.9 Class template forward_list [forward.list]
// 24.3.9.1 Overview [forward.list.overview]
// A forward_list is a container that supports forward iterators and allows constant time insert and erase operations anywhere within the sequence, with storage management handled automatically. Fast random access to list elements is not supported.
// [Note 1: It is intended that forward_list have zero space or time overhead relative to a hand-written C-style singly linked list. Features that would conflict with that goal have been omitted. —end note]
// A forward_list meets all of the requirements of a container (24.2.2.2), except that the size() member function is not provided and operator== has linear complexity, A forward_list also meets all of the
requirements for an allocator-aware container (24.2.2.5). In addition, a forward_list provides the assign member functions and several of the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on forward_list that are not described in that table or for operations where there is additional semantic information.
// [Note 2 : Modifying any list requires access to the element preceding the first element of interest, but in a forward_list there is no constant-time way to access a preceding element. For this reason, erase_after and splice_after take fully-open ranges, not semi-open ranges. —end note]
namespace std {
template<class T, class Allocator = allocator<T>>
class forward_list {
public:
// types
using value_type =T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = implementation-defined ; // see 24.2
using difference_type = implementation-defined ; // see 24.2
using iterator = implementation-defined ; // see 24.2
using const_iterator = implementation-defined ; // see 24.2
// 24.3.9.2, construct/copy/destroy
forward_list() : forward_list(Allocator()) { }
explicit forward_list(const Allocator&);
explicit forward_list(size_type n, const Allocator& = Allocator());
forward_list(size_type n, const T& value, const Allocator& = Allocator());
template<class InputIterator>
forward_list(InputIterator first, InputIterator last, const Allocator& = Allocator());
template<container-compatible-range<T> R>
forward_list(from_range_t, R&& rg, const Allocator& = Allocator());
forward_list(const forward_list& x);
forward_list(forward_list&& x);
forward_list(const forward_list& x, const type_identity_t<Allocator>&);
forward_list(forward_list&& x, const type_identity_t<Allocator>&);
forward_list(initializer_list<T>, const Allocator& = Allocator());
~forward_list();
forward_list& operator=(const forward_list& x);
forward_list& operator=(forward_list&& x)
noexcept(allocator_traits<Allocator>::is_always_equal::value);
forward_list& operator=(initializer_list<T>);
template<class InputIterator>
void assign(InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
void assign_range(R&& rg);
void assign(size_type n, const T& t);
void assign(initializer_list<T>);
allocator_type get_allocator() const noexcept;
// 24.3.9.3, iterators
iterator before_begin() noexcept;
const_iterator before_begin() const noexcept;
iterator begin() noexcept;
const_iterator begin() const noexcept;
iterator end() noexcept;
const_iterator end() const noexcept;
const_iterator cbegin() const noexcept;
const_iterator cbefore_begin() const noexcept;
const_iterator cend() const noexcept;
// capacity
[[nodiscard]] bool empty() const noexcept;
size_type max_size() const noexcept;
// 24.3.9.4, element access reference front(); const_reference front() const;
// 24.3.9.5, modifiers
template<class... Args> reference emplace_front(Args&&... args);
void push_front(const T& x);
void push_front(T&& x);
template<container-compatible-range<T> R>
void prepend_range(R&& rg);
void pop_front();
template<class... Args> iterator emplace_after(const_iterator position, Args&&... args);
iterator insert_after(const_iterator position, const T& x);
iterator insert_after(const_iterator position, T&& x);
iterator insert_after(const_iterator position, size_type n, const T& x);
template<class InputIterator>
iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
iterator insert_after(const_iterator position, initializer_list<T> il);
template<container-compatible-range<T> R>
iterator insert_range_after(const_iterator position, R&& rg);
iterator erase_after(const_iterator position);
iterator erase_after(const_iterator position, const_iterator last);
void swap(forward_list&)
noexcept(allocator_traits<Allocator>::is_always_equal::value);
void resize(size_type sz);
void resize(size_type sz, const value_type& c);
void clear() noexcept;
// 24.3.9.6, forward_list operations
void splice_after(const_iterator position, forward_list& x);
void splice_after(const_iterator position, forward_list&& x);
void splice_after(const_iterator position, forward_list& x, const_iterator i);
void splice_after(const_iterator position, forward_list&& x, const_iterator i);
void splice_after(const_iterator position, forward_list& x,
const_iterator first, const_iterator last);
void splice_after(const_iterator position, forward_list&& x,
const_iterator first, const_iterator last);
size_type remove(const T& value);
template<class Predicate> size_type remove_if(Predicate pred);
size_type unique();
template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
void merge(forward_list& x);
void merge(forward_list&& x);
template<class Compare> void merge(forward_list& x, Compare comp);
template<class Compare> void merge(forward_list&& x, Compare comp);
void sort();
template<class Compare> void sort(Compare comp);
void reverse() noexcept;
};
// Effects: Constructs an empty forward_list object using the specified allocator. Complexity: Constant.
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> forward_list(InputIterator, InputIterator, Allocator = Allocator())
-> forward_list<iter-value-type<InputIterator>, Allocator>;
template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
forward_list(from_range_t, R&&, Allocator = Allocator())
-> forward_list<ranges::range_value_t<R>, Allocator>;
}
// An incomplete type T may be used when instantiating forward_list if the allocator meets the allocator completeness requirements (16.4.4.6.2). T shall be complete before any member of the resulting specialization of forward_list is referenced.
// 24.3.9.2 Constructors, copy, and assignment [forward.list.cons]
explicit forward_list(const Allocator&);
explicit forward_list(size_type n, const Allocator& = Allocator());
// Preconditions: T is Cpp17DefaultInsertable into *this.
// Effects: Constructs a forward_list object with n default-inserted elements using the specified allocator. Complexity: Linear in n.
forward_list(size_type n, const T& value, const Allocator& = Allocator());
// Preconditions: T is Cpp17CopyInsertable into *this.
// Effects: Constructs a forward_list object with n copies of value using the specified allocator. Complexity: Linear in n.
template<class InputIterator>
forward_list(InputIterator first, InputIterator last, const Allocator& = Allocator());
// Effects: Constructs a forward_list object equal to the range [first, last). Complexity: Linear in distance(first, last).
template<container-compatible-range<T> R>
forward_list(from_range_t, R&& rg, const Allocator& = Allocator());
// Effects: Constructs a forward_list object with the elements of the range rg. Complexity: Linear in ranges::distance(rg).
// 24.3.9.3 Iterators [forward.list.iter]
iterator before_begin() noexcept;
const_iterator before_begin() const noexcept;
const_iterator cbefore_begin() const noexcept;
// Effects: cbefore_begin() is equivalent to const_cast<forward_list const&>(*this).before_- begin().
// Returns: A non-dereferenceable iterator that, when incremented, is equal to the iterator returned by begin().
// Remarks: before_begin() == end() shall equal false.
// 24.3.9.4 Element access [forward.list.access]
reference front();
const_reference front() const;
Returns:
*begin()
// Effects: Inserts an object of type value_type constructed with value_type(std::forward<Args>( args)...) at the beginning of the list.
// 24.3.9.5 Modifiers [forward.list.modifiers]
// None of the overloads of insert_after shall affect the validity of iterators and references, and erase_after shall invalidate only iterators and references to the erased elements. If an exception is thrown during insert_after there shall be no effect. Inserting n elements into a forward_list is linear in n, and the number of calls to the copy or move constructor of T is exactly equal to n. Erasing n elements from a forward_list is linear in n and the number of calls to the destructor of type T is exactly equal to n.
template<class... Args> reference emplace_front(Args&&... args);
void push_front(const T& x);
void push_front(T&& x);
// Effects: Inserts a copy of x at the beginning of the list. template<container-compatible-range<T> R>
void prepend_range(R&& rg);
// Effects: Inserts a copy of each element of rg at the beginning of the list. [Note 1: The order of elements is not reversed. —end note]
void pop_front();
// Effects: As if by erase_after(before_begin()). iterator insert_after(const_iterator position, const T& x);
iterator insert_after(const_iterator position, T&& x);
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()).
// Effects: Inserts a copy of x after position. Returns: An iterator pointing to the copy of x.
iterator insert_after(const_iterator position, size_type n, const T& x);
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()).
// Effects: Inserts n copies of x after position.
// Returns: An iterator pointing to the last inserted copy of x or position if n == 0.
template<class InputIterator>
iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()). Neither first nor last are iterators in *this.
// Effects: Inserts copies of elements in [first, last) after position.
// Returns: An iterator pointing to the last inserted element or position if first == last.
template<container-compatible-range<T> R>
iterator insert_range_after(const_iterator position, R&& rg);
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()). rg and *this do not overlap.
// Effects: Inserts copies of elements in the range rg after position.
// Returns: An iterator pointing to the last inserted element, or position if rg is empty.
iterator insert_after(const_iterator position, initializer_list<T> il);
// Effects: insert_after(p, il.begin(), il.end()).
// Returns: An iterator pointing to the last inserted element or position if il is empty.
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()). get_allocator() == x.get_allocator() is true. addressof(x) != this is true.
Effects:
Inserts the contents of x after position, and x becomes empty. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into
*this, not into x. Throws:
Nothing.
template<class... Args>
iterator emplace_after(const_iterator position, Args&&... args);
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()).
// Effects: Inserts an object of type value_type constructed with value_type(std::forward<Args>( args)...) after position.
// Returns: An iterator pointing to the new object.
iterator erase_after(const_iterator position);
// Preconditions: The iterator following position is dereferenceable.
// Effects: Erases the element pointed to by the iterator following position.
// Returns: An iterator pointing to the element following the one that was erased, or end() if no such element exists.
// Throws: Nothing.
iterator erase_after(const_iterator position, const_iterator last);
// Preconditions: All iterators in the range (position, last) are dereferenceable.
// Effects: Erases the elements in the range (position, last).
// Returns: last.
// Throws: Nothing.
void resize(size_type sz);
// Preconditions: T is Cpp17DefaultInsertable into *this.
// Effects: If sz < distance(begin(), end()), erases the last distance(begin(), end()) - sz ele- ments from the list. Otherwise, inserts sz - distance(begin(), end()) default-inserted elements at the end of the list.
void resize(size_type sz, const value_type& c);
// Preconditions: T is Cpp17CopyInsertable into *this.
// Effects: If sz < distance(begin(), end()), erases the last distance(begin(), end()) - sz ele- ments from the list. Otherwise, inserts sz - distance(begin(), end()) copies of c at the end of the list.
void clear() noexcept;
// Effects: Erases all elements in the range [begin(), end()). Remarks: Does not invalidate past-the-end iterators.
// 24.3.9.6 Operations [forward.list.ops]
// In this subclause, arguments for a template parameter named Predicate or BinaryPredicate shall meet the corresponding requirements in 27.2. The semantics of i + n, where i is an iterator into the list and n is an integer, are the same as those of next(i, n). The expression i - n, where i is an iterator into the list and n is an integer, means an iterator j such that j + n == i is true. For merge and sort, the definitions and requirements in 27.8 apply.
void splice_after(const_iterator position, forward_list& x);
void splice_after(const_iterator position, forward_list&& x);
// Complexity: O(distance(x.begin(), x.end()))
void splice_after(const_iterator position, forward_list& x, const_iterator i);
void splice_after(const_iterator position, forward_list&& x, const_iterator i);
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()). The iterator following i is a dereferenceable iterator in x. get_allocator() == x.get_- allocator() is true.
// Effects: Inserts the element following i into *this, following position, and removes it from x. The result is unchanged if position == i or position == ++i. Pointers and references to *++i continue to refer to the same element but as a member of *this. Iterators to *++i continue to refer to the same element, but now behave as iterators into *this, not into x.
// Throws: Nothing. Complexity: O(1)
void splice_after(const_iterator position, forward_list& x,
const_iterator first, const_iterator last);
void splice_after(const_iterator position, forward_list&& x,
const_iterator first, const_iterator last);
// Preconditions: position is before_begin() or is a dereferenceable iterator in the range [begin(), end()). (first,last) is a valid range in x, and all iterators in the range (first,last) are deref- erenceable. position is not an iterator in the range (first, last). get_allocator() == x.get_- allocator() is true.
// Effects: Inserts elements in the range (first, last) after position and removes the elements from x. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
// Complexity: O(distance(first, last)) size_type remove(const T& value);
template<class Predicate> size_type remove_if(Predicate pred);
// Effects: Erases all the elements in the list referred to by a list iterator i for which the following conditions hold: *i == value (for remove()), pred(*i) is true (for remove_if()). Invalidates only the iterators and references to the erased elements.
// Returns: The number of elements erased.
// Throws: Nothing unless an exception is thrown by the equality comparison or the predicate. Complexity: Exactly distance(begin(), end()) applications of the corresponding predicate. Remarks: Stable (16.4.6.8).
size_type unique();
template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
Let binary_pred be equal_to<> {} for the first overload.
Preconditions:
binary_pred is an equivalence relation.
Effects:
Erases all but the first element from every consecutive group of equivalent elements. That is, for a nonempty list, erases all elements referred to by the iterator i in the range [begin() + 1, end()) for which binary_pred(*i, *(i - 1)) is true. Invalidates only the iterators and references to the erased elements.
Returns: The number of elements erased.
Throws: Nothing unless an exception is thrown by the predicate.
Complexity: If empty() is false, exactly distance(begin(), end()) - 1 applications of the corre- sponding predicate, otherwise no applications of the predicate.
void merge(forward_list& x);
void merge(forward_list&& x);
template<class Compare> void merge(forward_list& x, Compare comp);
template<class Compare> void merge(forward_list&& x, Compare comp);
// Let comp be less<> for the first two overloads.
// Preconditions: *this and x are both sorted with respect to the comparator comp, and get_allocator()
== x.get_allocator() is true.
// Effects: If addressof(x) == this, there are no effects. Otherwise, merges the two sorted ranges [begin(), end()) and [x.begin(), x.end()). The result is a range that is sorted with respect to the comparator comp. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
// Complexity: At most distance(begin(), end()) + distance(x.begin(), x.end()) - 1 compar- isons if addressof(x) != this; otherwise, no comparisons are performed.
// Remarks: Stable (16.4.6.8). If addressof(x) != this, x is empty after the merge. No elements are copied by this operation. If an exception is thrown other than by a comparison, there are no effects.
void sort();
template<class Compare> void sort(Compare comp);
// Effects: Sorts the list according to the operator< or the comp function object. If an exception is thrown, the order of the elements in *this is unspecified. Does not affect the validity of iterators and references.
// Complexity: Approximately N log N comparisons, where N is distance(begin(), end()). Remarks: Stable (16.4.6.8).
void reverse() noexcept;
// Effects: Reverses the order of the elements in the list. Does not affect the validity of iterators and references.
// Complexity: Linear time.
// 24.3.9.7 Erasure [forward.list.erasure]
template<class T, class Allocator, class U>
typename forward_list<T, Allocator>::size_type
erase(forward_list<T, Allocator>& c, const U& value);
// Effects: Equivalent to: return erase_if(c, [&](auto& elem) { return elem == value; });
template<class T, class Allocator, class Predicate>
typename forward_list<T, Allocator>::size_type
erase_if(forward_list<T, Allocator>& c, Predicate pred);
// Effects: Equivalent to: return c.remove_if(pred);
// 24.3.10 Class template list [list]
// 24.3.10.1 Overview [list.overview]
// A list is a sequence container that supports bidirectional iterators and allows constant time insert and erase operations anywhere within the sequence, with storage management handled automatically. Unlike vectors (24.3.11) and deques (24.3.8), fast random access to list elements is not supported, but many algorithms only need sequential access anyway.
// A list meets all of the requirements of a container (24.2.2.2), of a reversible container (24.2.2.3), of an allocator-aware container (24.2.2.5), and of a sequence container, including most of the optional sequence container requirements (24.2.4). The exceptions are the operator[] and at member functions, which are not provided.Descriptions are provided here only for operations on list that are not described in one of these tables or for operations where there is additional semantic information.
namespace std {
template<class T, class Allocator = allocator<T>>
class list {
public:
// types
using value_type =T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = implementation-defined ; // see 24.2
using difference_type = implementation-defined ; // see 24.2
using iterator = implementation-defined ; // see 24.2
using const_iterator = implementation-defined ; // see 24.2
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// 24.3.10.2, construct/copy/destroy
list() : list(Allocator()) { }
explicit list(const Allocator&);
explicit list(size_type n, const Allocator& = Allocator());
list(size_type n, const T& value, const Allocator& = Allocator());
template<class InputIterator>
list(InputIterator first, InputIterator last, const Allocator& = Allocator());
template<container-compatible-range<T> R>
list(from_range_t, R&& rg, const Allocator& = Allocator());
list(const list& x);
list(list&& x);
list(const list&, const type_identity_t<Allocator>&);
list(list&&, const type_identity_t<Allocator>&);
list(initializer_list<T>, const Allocator& = Allocator());
~list();
list& operator=(const list& x);
list& operator=(list&& x)
noexcept(allocator_traits<Allocator>::is_always_equal::value);
list& operator=(initializer_list<T>);
template<class InputIterator>
void assign(InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
void assign_range(R&& rg);
void assign(size_type n, const T& t);
void assign(initializer_list<T>);
allocator_type get_allocator() const noexcept;
// iterators
iterator begin() noexcept;
const_iterator begin() const noexcept;
iterator end() noexcept;
const_iterator end() const noexcept;
reverse_iterator rbegin() noexcept;
const_reverse_iterator rbegin() const noexcept;
reverse_iterator rend() noexcept;
const_reverse_iterator rend() const noexcept;
const_iterator cbegin() const noexcept;
const_iterator cend() const noexcept;
const_reverse_iterator crbegin() const noexcept;
const_reverse_iterator crend() const noexcept;
// 24.3.10.3, capacity
[[nodiscard]] bool empty() const noexcept;
void size_type size() const noexcept;
void size_type max_size() const noexcept;
// element
reference front();
const_reference front() const;
reference back();
const_reference back() const;
// 24.3.10.4, modifiers
template<class... Args> reference emplace_front(Args&&... args);
template<class... Args> reference emplace_back(Args&&... args);
void push_front(const T& x);
void push_front(T&& x);
template<container-compatible-range<T> R>
void prepend_range(R&& rg);
void pop_front();
void push_back(const T& x);
void push_back(T&& x);
template<container-compatible-range<T> R>
void append_range(R&& rg);
void pop_back();
template<class... Args> iterator emplace(const_iterator position, Args&&... args);
iterator insert(const_iterator position, const T& x);
iterator insert(const_iterator position, T&& x);
iterator insert(const_iterator position, size_type n, const T& x);
template<class InputIterator>
iterator insert(const_iterator position, InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
iterator insert_range(const_iterator position, R&& rg);
iterator insert(const_iterator position, initializer_list<T> il);
iterator erase(const_iterator position);
iterator erase(const_iterator position, const_iterator last);
void swap(list&) noexcept(allocator_traits<Allocator>::is_always_equal::value);
void clear() noexcept;
// 24.3.10.5, list operations
void splice(const_iterator position, list& x);
void splice(const_iterator position, list&& x);
void splice(const_iterator position, list& x, const_iterator i);
void splice(const_iterator position, list&& x, const_iterator i);
void splice(const_iterator position, list& x, const_iterator first, const_iterator last);
void splice(const_iterator position, list&& x, const_iterator first, const_iterator last);
size_type remove(const T& value);
template<class Predicate> size_type remove_if(Predicate pred);
size_type unique();
template<class BinaryPredicate>
size_type unique(BinaryPredicate binary_pred);
void merge(list& x);
void merge(list&& x);
template<class Compare> void merge(list& x, Compare comp);
template<class Compare> void merge(list&& x, Compare comp);
void sort();
template<class Compare> void sort(Compare comp);
void reverse() noexcept;
};
resize(size_type sz);
resize(size_type sz, const T& c);
// access
// Effects: Constructs an empty list, using the specified allocator. Complexity: Constant.
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
-> list<iter-value-type<InputIterator>, Allocator>;
template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
list(from_range_t, R&&, Allocator = Allocator())
-> list<ranges::range_value_t<R>, Allocator>;
}
// An incomplete type T may be used when instantiating list if the allocator meets the allocator completeness requirements (16.4.4.6.2). T shall be complete before any member of the resulting specialization of list is referenced.
// 24.3.10.2 Constructors, copy, and assignment [list.cons]
explicit list(const Allocator&);
explicit list(size_type n, const Allocator& = Allocator());
// Preconditions: T is Cpp17DefaultInsertable into *this.
// Effects: Constructs a list with n default-inserted elements using the specified allocator. Complexity: Linear in n.
list(size_type n, const T& value, const Allocator& = Allocator());
// Preconditions: T is Cpp17CopyInsertable into *this.
// Effects: Constructs a list with n copies of value, using the specified allocator. Complexity: Linear in n.
template<class InputIterator>
list(InputIterator first, InputIterator last, const Allocator& = Allocator());
// Effects: Constructs a list equal to the range [first, last).
// Complexity: Linear in distance(first, last).
template<container-compatible-range<T> R>
list(from_range_t, R&& rg, const Allocator& = Allocator());
// Effects: Constructs a list object with the elements of the range rg.
// Complexity: Linear in ranges::distance(rg).
// 24.3.10.3 Capacity [list.capacity]
void resize(size_type sz);
// Preconditions: T is Cpp17DefaultInsertable into *this.
// Effects: If size() < sz, appends sz - size() default-inserted elements to the sequence. If sz <=
size(), equivalent to:
list<T>::iterator it = begin();
advance(it, sz);
erase(it, end());
void resize(size_type sz, const T& c);
// Preconditions: T is Cpp17CopyInsertable into *this. Effects: As if by:
if (sz > size())
insert(end(), sz-size(), c);
else if (sz < size()) {
iterator i = begin();
advance(i, sz);
erase(i, end());
}
else ;
// 24.3.10.4 Modifiers [list.modifiers]
// do nothing
iterator insert(const_iterator position, const T& x);
iterator insert(const_iterator position, T&& x);
iterator insert(const_iterator position, size_type n, const T& x);
template<class InputIterator>
iterator insert(const_iterator position, InputIterator first,
InputIterator last);
template<container-compatible-range<T> R>
iterator insert_range(const_iterator position, R&& rg);
iterator insert(const_iterator position, initializer_list<T>);
template<class... Args> reference emplace_front(Args&&... args);
template<class... Args> reference emplace_back(Args&&... args);
template<class... Args> iterator emplace(const_iterator position, Args&&... args);
void push_front(const T& x);
void push_front(T&& x);
template<container-compatible-range<T> R>
void prepend_range(R&& rg);
void push_back(const T& x);
void push_back(T&& x);
template<container-compatible-range<T> R>
void append_range(R&& rg);
// Complexity: Insertion of a single element into a list takes constant time and exactly one call to a constructor of T. Insertion of multiple elements into a list is linear in the number of elements inserted, and the number of calls to the copy constructor or move constructor of T is exactly equal to the number of elements inserted.
// Remarks: Does not affect the validity of iterators and references. If an exception is thrown there are no effects.
// Since lists allow fast insertion and erasing from the middle of a list, certain operations are provided specifically for them.216 In this subclause, arguments for a template parameter named Predicate or BinaryPredicate shall meet the corresponding requirements in 27.2. The semantics of i + n and i - n, where i is an iterator into the list and n is an integer, are the same as those of next(i, n) and prev(i, n), respectively. For merge and sort, the definitions and requirements in 27.8 apply.
// list provides three splice operations that destructively move elements from one list to another. The behavior of splice operations is undefined if get_allocator() != x.get_allocator().
void splice(const_iterator position, list& x);
iterator erase(const_iterator position);
iterator erase(const_iterator first, const_iterator last);
void pop_front();
void pop_back();
void clear() noexcept;
// Effects: Invalidates only the iterators and references to the erased elements.
// Throws: Nothing.
// Complexity: Erasing a single element is a constant time operation with a single call to the destructor of T. Erasing a range in a list is linear time in the size of the range and the number of calls to the destructor of type T is exactly equal to the size of the range.
// 24.3.10.5 Operations [list.ops]
void splice(const_iterator position, list&& x);
// Preconditions: addressof(x) != this is true.
// Effects: Inserts the contents of x before position and x becomes empty. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
// Throws: Nothing. Complexity: Constant time.
void splice(const_iterator position, list& x, const_iterator i);
void splice(const_iterator position, list&& x, const_iterator i);
// Preconditions: i is a valid dereferenceable iterator of x.
// Effects: Inserts an element pointed to by i from list x before position and removes the element from x. The result is unchanged if position == i or position == ++i. Pointers and references to *i continue to refer to this same element but as a member of *this. Iterators to *i (including i itself) continue to refer to the same element, but now behave as iterators into *this, not into x.
// Throws: Nothing. Complexity: Constant time.
void splice(const_iterator position, list& x, const_iterator first,
const_iterator last);
void splice(const_iterator position, list&& x, const_iterator first,
const_iterator last);
// Preconditions: [first, last) is a valid range in x. position is not an iterator in the range [first, last).
// Effects: Inserts elements in the range [first, last) before position and removes the elements from x. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
// Throws: Nothing.
// Complexity: Constant time if addressof(x) == this; otherwise, linear time.
size_type remove(const T& value);
template<class Predicate> size_type remove_if(Predicate pred);
// Effects: Erases all the elements in the list referred to by a list iterator i for which the following conditions hold: *i == value, pred(*i) != false. Invalidates only the iterators and references to the erased elements.
// Returns: The number of elements erased.
// Throws: Nothing unless an exception is thrown by *i == value or pred(*i) != false. Complexity: Exactly size() applications of the corresponding predicate.
// Remarks: Stable (16.4.6.8).
size_type unique();
template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
// Let binary_pred be equal_to<>{} for the first overload.
// Preconditions: binary_pred is an equivalence relation.
// Effects: Erases all but the first element from every consecutive group of equivalent elements. That is, for a nonempty list, erases all elements referred to by the iterator i in the range [begin() + 1, end()) for which binary_pred(*i, *(i - 1)) is true. Invalidates only the iterators and references to the erased elements.
// Returns: The number of elements erased.
// Throws: Nothing unless an exception is thrown by the predicate.
// Complexity: If empty() is false, exactly size() - 1 applications of the corresponding predicate, otherwise no applications of the predicate.
void merge(list& x);
void merge(list&& x);
template<class Compare> void merge(list& x, Compare comp);
template<class Compare> void merge(list&& x, Compare comp);
// Let comp be less<> for the first two overloads.
// Preconditions: *this and x are both sorted with respect to the comparator comp, and get_allocator() == x.get_allocator() is true.
// Effects: If addressof(x) == this, there are no effects. Otherwise, merges the two sorted ranges [begin(), end()) and [x.begin(), x.end()). The result is a range that is sorted with respect to the comparator comp. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into *this, not into x.
// Complexity: At most size() + x.size() - 1 comparisons if addressof(x) != this; otherwise, no comparisons are performed.
// Remarks: Stable (16.4.6.8). If addressof(x) != this, x is empty after the merge. No elements are copied by this operation. If an exception is thrown other than by a comparison there are no effects.
void reverse() noexcept;
// Effects: Reverses the order of the elements in the list. Does not affect the validity of iterators and references.
// Complexity: Linear time. void sort();
template<class Compare> void sort(Compare comp);
// Effects: Sorts the list according to the operator< or a Compare function object. If an exception is thrown, the order of the elements in *this is unspecified. Does not affect the validity of iterators and references.
// Complexity: Approximately N log N comparisons, where N == size().
// Remarks: Stable (16.4.6.8).
// 24.3.10.6 Erasure [list.erasure]
template<class T, class Allocator, class U>
typename list<T, Allocator>::size_type
erase(list<T, Allocator>& c, const U& value);
// Effects: Equivalent to: return erase_if(c, [&](auto& elem) { return elem == value; });
template<class T, class Allocator, class Predicate>
typename list<T, Allocator>::size_type
erase_if(list<T, Allocator>& c, Predicate pred);
// Effects: Equivalent to: return c.remove_if(pred);
// 24.3.11 Class template vector [vector]
// 24.3.11.1 Overview [vector.overview]
// A vector is a sequence container that supports (amortized) constant time insert and erase operations at the end; insert and erase in the middle take linear time. Storage management is handled automatically, though hints can be given to improve efficiency.
// A vector meets all of the requirements of a container (24.2.2.2), of a reversible container (24.2.2.3), of an allocator-aware container (24.2.2.5), of a sequence container, including most of the optional sequence container requirements (24.2.4), and, for an element type other than bool, of a contiguous container (24.2.2.1). The exceptions are the push_front, prepend_range, pop_front, and emplace_front member functions, which are not provided. Descriptions are provided here only for operations on vector that are not described in one of these tables or for operations where there is additional semantic information.
// The types iterator and const_iterator meet the constexpr iterator requirements (25.3.1).
namespace std {
template<class T, class Allocator = allocator<T>>
class vector {
public:
// types
using value_type =T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = implementation-defined ; // see 24.2
using difference_type = implementation-defined ; // see 24.2
using iterator = implementation-defined ; // see 24.2
using const_iterator = implementation-defined ; // see 24.2
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// 24.3.11.2, construct/copy/destroy
constexpr vector() noexcept(noexcept(Allocator())) : vector(Allocator()) { } constexpr explicit vector(const Allocator&) noexcept;
constexpr explicit vector(size_type n, const Allocator& = Allocator());
constexpr vector(size_type n, const T& value, const Allocator& = Allocator());
template<class InputIterator>
constexpr vector(InputIterator first, InputIterator last, const Allocator& = Allocator());
template<container-compatible-range<T> R>
constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
constexpr vector(const vector& x);
constexpr vector(vector&&) noexcept;
constexpr vector(const vector&, const type_identity_t<Allocator>&);
constexpr vector(vector&&, const type_identity_t<Allocator>&);
constexpr vector(initializer_list<T>, const Allocator& = Allocator());
constexpr ~vector();
constexpr vector& operator=(const vector& x);
constexpr vector& operator=(vector&& x)
noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
allocator_traits<Allocator>::is_always_equal::value);
constexpr vector& operator=(initializer_list<T>);
template<class InputIterator>
constexpr void assign(InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
constexpr void assign_range(R&& rg);
constexpr void assign(size_type n, const T& u);
constexpr void assign(initializer_list<T>);
constexpr allocator_type get_allocator() const noexcept;
// iterators
constexpr iterator
constexpr const_iterator
constexpr iterator
constexpr const_iterator
constexpr reverse_iterator
constexpr const_reverse_iterator rbegin() const noexcept;
constexpr reverse_iterator rend() noexcept;
constexpr const_reverse_iterator rend() const noexcept;
constexpr const_iterator cbegin() const noexcept;
constexpr const_iterator cend() const noexcept;
constexpr const_reverse_iterator crbegin() const noexcept;
constexpr const_reverse_iterator crend() const noexcept;
begin() noexcept;
begin() const noexcept;
end() noexcept;
end() const noexcept;
rbegin() noexcept;
// 24.3.11.3, capacity
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr size_type size() const noexcept;
constexpr size_type max_size() const noexcept;
constexpr size_type capacity() const noexcept;
constexpr void
constexpr void
constexpr void
constexpr void
// element access
constexpr reference
constexpr const_reference operator[](size_type n) const;
constexpr const_reference at(size_type n) const;
constexpr reference at(size_type n);
constexpr reference front();
constexpr const_reference front() const;
constexpr reference back();
constexpr const_reference back() const;
// 24.3.11.4, data access
constexpr T* data() noexcept;
constexpr const T* data() const noexcept;
// 24.3.11.5, modifiers
template<class... Args> constexpr reference emplace_back(Args&&... args);
constexpr void push_back(const T& x);
constexpr void push_back(T&& x);
template<container-compatible-range<T> R>
constexpr void append_range(R&& rg);
constexpr void pop_back();
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
constexpr iterator insert(const_iterator position, const T& x);
constexpr iterator insert(const_iterator position, T&& x);
constexpr iterator insert(const_iterator position, size_type n, const T& x);
template<class InputIterator>
constexpr iterator insert(const_iterator position,
InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
constexpr iterator insert_range(const_iterator position, R&& rg);
constexpr iterator insert(const_iterator position, initializer_list<T> il);
constexpr iterator erase(const_iterator position);
constexpr iterator erase(const_iterator first, const_iterator last);
constexpr void swap(vector&)
noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
allocator_traits<Allocator>::is_always_equal::value);
constexpr void clear() noexcept;
};
template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
-> vector<iter-value-type<InputIterator>, Allocator>;
template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
vector(from_range_t, R&&, Allocator = Allocator())
-> vector<ranges::range_value_t<R>, Allocator>;
}
// An incomplete type T may be used when instantiating vector if the allocator meets the allocator completeness requirements (16.4.4.6.2). T shall be complete before any member of the resulting specialization of vector is referenced.
resize(size_type sz);
resize(size_type sz, const T& c);
reserve(size_type n);
shrink_to_fit();
operator[](size_type n);
// 24.3.11.2 Constructors [vector.cons]
constexpr explicit vector(const Allocator&) noexcept;
// Effects: Constructs an empty vector, using the specified allocator. Complexity: Constant.
constexpr explicit vector(size_type n, const Allocator& = Allocator());
// Preconditions: T is Cpp17DefaultInsertable into *this.
// Effects: Constructs a vector with n default-inserted elements using the specified allocator. Complexity: Linear in n.
constexpr vector(size_type n, const T& value,
const Allocator& = Allocator());
// Preconditions: T is Cpp17CopyInsertable into *this.
// Effects: Constructs a vector with n copies of value, using the specified allocator. Complexity: Linear in n.
template<class InputIterator>
constexpr vector(InputIterator first, InputIterator last,
const Allocator& = Allocator());
// Effects: Constructs a vector equal to the range [first, last), using the specified allocator.
// Complexity: Makes only N calls to the copy constructor of T (where N is the distance between first and last) and no reallocations if iterators first and last are of forward, bidirectional, or random access categories. It makes order N calls to the copy constructor of T and order log N reallocations if they are just input iterators.
template<container-compatible-range<T> R>
constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
// Effects: Constructs a vector object with the elements of the range rg, using the specified allocator.
// Complexity: Initializes exactly N elements from the results of dereferencing successive iterators of rg, where N is ranges::distance(rg). Performs no reallocations if R models ranges::forward_range or ranges::sized_range; otherwise, performs order log N reallocations and order N calls to the copy or move constructor of T.
// 24.3.11.3 Capacity [vector.capacity]
constexpr size_type capacity() const noexcept;
// Returns: The total number of elements that the vector can hold without requiring reallocation. Complexity: Constant time.
constexpr void reserve(size_type n);
// Preconditions: T is Cpp17MoveInsertable into *this.
// Effects: A directive that informs a vector of a planned change in size, so that it can manage the storage allocation accordingly. After reserve(), capacity() is greater or equal to the argument of reserve if reallocation happens; and equal to the previous value of capacity() otherwise. Reallocation happens at this point if and only if the current capacity is less than the argument of reserve(). If an exception is thrown other than by the move constructor of a non-Cpp17CopyInsertable type, there are no effects.
// Throws: length_error if n > max_size().217
// Complexity: It does not change the size of the sequence and takes at most linear time in the size of the sequence.
// Remarks: Reallocation invalidates all the references, pointers, and iterators referring to the elements in the sequence, as well as the past-the-end iterator.
// [Note 1: If no reallocation happens, they remain valid.
// No reallocation shall take place during insertions that happen after a call to reserve() until an insertion would make the size of the vector greater than the value of capacity().
constexpr void shrink_to_fit();
// Preconditions: T is Cpp17MoveInsertable into *this.
// Effects: shrink_to_fit is a non-binding request to reduce capacity() to size().
// [Note 2: The request is non-binding to allow latitude for implementation-specific optimizations.
// It does not increase capacity(), but may reduce capacity() by causing reallocation. If an exception is thrown other than by the move constructor of a non-Cpp17CopyInsertable T there are no effects.
// Complexity: If reallocation happens, linear in the size of the sequence.
// Remarks: Reallocation invalidates all the references, pointers, and iterators referring to the elements in the sequence as well as the past-the-end iterator.
// [Note 3: If no reallocation happens, they remain valid.
constexpr void swap(vector& x)
noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
allocator_traits<Allocator>::is_always_equal::value);
// Effects: Exchanges the contents and capacity() of *this with that of x.
// Complexity: Constant time.
constexpr void resize(size_type sz);
// Preconditions: T is Cpp17MoveInsertable and Cpp17DefaultInsertable into *this.
// Effects: If sz < size(), erases the last size() - sz elements from the sequence. Otherwise, appends sz - size() default-inserted elements to the sequence.
// Remarks: If an exception is thrown other than by the move constructor of a non-Cpp17CopyInsertable
T there are no effects.
constexpr void resize(size_type sz, const T& c);
// Preconditions: T is Cpp17CopyInsertable into *this.
// Effects: If sz < size(), erases the last size() - sz elements from the sequence. Otherwise, appends
sz - size() copies of c to the sequence.
// Remarks: If an exception is thrown there are no effects.
// 24.3.11.4 Data [vector.data]
constexpr T*
constexpr const T*
data() noexcept;
data() const noexcept;
// Returns: A pointer such that [data(),data() + size()) is a valid range. // For a non-empty vector, data() == addressof(front()).
// Complexity: Constant time.
// 24.3.11.5 Modifiers [vector.modifiers]
constexpr iterator insert(const_iterator position, const T& x);
constexpr iterator insert(const_iterator position, T&& x);
constexpr iterator insert(const_iterator position, size_type n, const T& x);
template<class InputIterator>
constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last);
template<container-compatible-range<T> R>
constexpr iterator insert_range(const_iterator position, R&& rg);
constexpr iterator insert(const_iterator position, initializer_list<T>);
template<class... Args> constexpr reference emplace_back(Args&&... args);
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
constexpr void push_back(const T& x);
constexpr void push_back(T&& x);
// Effects: Invalidates iterators and references at or after the point of the erase.
// Throws: Nothing unless an exception is thrown by the assignment operator or move assignment operator of T.
// Complexity: The destructor of T is called the number of times equal to the number of the elements erased, but the assignment operator of T is called the number of times equal to the number of elements in the vector after the erased elements.
template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
// Complexity: If reallocation happens, linear in the number of elements of the resulting vector; otherwise, linear in the number of elements inserted plus the distance to the end of the vector.
// Remarks: Causes reallocation if the new size is greater than the old capacity. Reallocation invalidates all the references, pointers, and iterators referring to the elements in the sequence, as well as the past- the-end iterator. If no reallocation happens, then references, pointers, and iterators before the insertion point remain valid but those at or after the insertion point, including the past-the-end iterator, are invalidated. If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move assignment operator of T or by any InputIterator operation there are no effects. If an exception is thrown while inserting a single element at the end and T is Cpp17CopyInsertable or is_nothrow_move_constructible_v<T> is true, there are no effects. Otherwise, if an exception is thrown by the move constructor of a non-Cpp17CopyInsertable T, the effects are unspecified.
constexpr iterator erase(const_iterator position);
constexpr iterator erase(const_iterator first, const_iterator last);
constexpr void pop_back();
// 24.3.11.6 Erasure [vector.erasure]
template<class T, class Allocator, class U>
constexpr typename vector<T, Allocator>::size_type
erase(vector<T, Allocator>& c, const U& value);
// Effects: Equivalent to:
auto it = remove(c.begin(), c.end(), value);
auto r = distance(it, c.end());
c.erase(it, c.end());
return r;
template<class T, class Allocator, class Predicate>
constexpr typename vector<T, Allocator>::size_type
erase_if(vector<T, Allocator>& c, Predicate pred);
// Effects: Equivalent to:
auto it = remove_if(c.begin(), c.end(), pred);
auto r = distance(it, c.end());
c.erase(it, c.end());
return r;
// 24.3.12 Class vector<bool> [vector.bool]
// To optimize space allocation, a specialization of vector for bool elements is provided:
namespace std {
template<class Allocator>
class vector<bool, Allocator> {
public:
// types
using value_type = bool;
using allocator_type = Allocator;
using pointer = implementation-defined ;
using const_pointer = implementation-defined ;
using const_reference = bool;
using size_type = implementation-defined ;
using difference_type = implementation-defined ;
using iterator = implementation-defined ;
// see 24.2 // see 24.2 // see 24.2
class reference {
friend class vector;
constexpr reference() noexcept;
public:
constexpr reference(const reference&) = default;
constexpr ~reference();
constexpr operator bool() const noexcept;
constexpr reference& operator=(bool x) noexcept;
constexpr reference& operator=(const reference& x) noexcept;
constexpr const reference& operator=(bool x) const noexcept;
constexpr void flip() noexcept; // flips the bit
};
// construct/copy/destroy
constexpr vector() : vector(Allocator()) { }
constexpr explicit vector(const Allocator&);
constexpr explicit vector(size_type n, const Allocator& = Allocator());
constexpr vector(size_type n, const bool& value, const Allocator& = Allocator());
template<class InputIterator>
constexpr vector(InputIterator first, InputIterator last, const Allocator& = Allocator());
template<container-compatible-range<bool> R>
constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
constexpr vector(const vector& x);
constexpr vector(vector&& x);
constexpr vector(const vector&, const type_identity_t<Allocator>&);
constexpr vector(vector&&, const type_identity_t<Allocator>&);
constexpr vector(initializer_list<bool>, const Allocator& = Allocator());
constexpr ~vector();
constexpr vector& operator=(const vector& x);
constexpr vector& operator=(vector&& x);
constexpr vector& operator=(initializer_list<bool>);
template<class InputIterator>
constexpr void assign(InputIterator first, InputIterator last);
template<container-compatible-range<bool> R>
constexpr void assign_range(R&& rg);
constexpr void assign(size_type n, const bool& t);
constexpr void assign(initializer_list<bool>);
constexpr allocator_type get_allocator() const noexcept;
// iterators
constexpr iterator
constexpr const_iterator
constexpr iterator
constexpr const_iterator
constexpr reverse_iterator
constexpr const_reverse_iterator rbegin() const noexcept;
constexpr reverse_iterator rend() noexcept;
constexpr const_reverse_iterator rend() const noexcept;
constexpr const_iterator cbegin() const noexcept;
constexpr const_iterator cend() const noexcept;
constexpr const_reverse_iterator crbegin() const noexcept;
constexpr const_reverse_iterator crend() const noexcept;
// capacity
[[nodiscard]] constexpr bool empty() const noexcept;
constexpr size_type size() const noexcept;
constexpr size_type max_size() const noexcept;
constexpr size_type capacity() const noexcept;
using const_iterator = implementation-defined ; // see 24.2
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
// bit reference
begin() noexcept;
begin() const noexcept;
end() noexcept;
end() const noexcept;
rbegin() noexcept;
// Effects: Replaces each element in the container with its complement.
constexpr void
constexpr void
constexpr void
// element access
constexpr reference
constexpr const_reference operator[](size_type n) const;
constexpr const_reference at(size_type n) const;
constexpr reference at(size_type n);
constexpr reference front();
constexpr const_reference front() const;
constexpr reference back();
constexpr const_reference back() const;
// modifiers
template<class... Args> constexpr reference emplace_back(Args&&... args);
constexpr void push_back(const bool& x);
template<container-compatible-range<bool> R>
constexpr void append_range(R&& rg);
constexpr void pop_back();
template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
constexpr iterator insert(const_iterator position, const bool& x);
constexpr iterator insert(const_iterator position, size_type n, const bool& x);
template<class InputIterator>
constexpr iterator insert(const_iterator position,
InputIterator first, InputIterator last);
template<container-compatible-range<bool> R>
constexpr iterator insert_range(const_iterator position, R&& rg);
constexpr iterator insert(const_iterator position, initializer_list<bool> il);
constexpr iterator erase(const_iterator position);
constexpr iterator erase(const_iterator first, const_iterator last);
constexpr void swap(vector&);
constexpr static void swap(reference x, reference y) noexcept;
constexpr void flip() noexcept; // flips all bits
constexpr void clear() noexcept;
};
}
// Unless described below, all operations have the same requirements and semantics as the primary vector template, except that operations dealing with the bool value type map to bit values in the container storage and allocator_traits::construct (20.2.8.3) is not used to construct these values.
// There is no requirement that the data be stored as a contiguous allocation of bool values. A space-optimized representation of bits is recommended instead.
// reference is a class that simulates the behavior of references of a single bit in vector<bool>. The conversion function returns true when the bit is set, and false otherwise. The assignment operators set the bit when the argument is (convertible to) true and clear it otherwise. flip reverses the state of the bit.
constexpr void flip() noexcept;
resize(size_type sz, bool c = false);
reserve(size_type n);
shrink_to_fit();
constexpr static void swap(reference x, reference y) noexcept;
// Effects: Exchanges the contents of x and y as if by:
bool b = x;
x = y;
y = b;
template<class Allocator> struct hash<vector<bool, Allocator>>;
// The specialization is enabled (22.10.19).
int main() {
cout << n4910 << endl;
return EXIT_SUCCESS;
}
編纂・実行結果(compile and go)
$ clang++ p876.cpp -std=03 -o p876l -I. -Wall
In file included from p876.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 \
^
p876.cpp:17:1: error: cannot template a using declaration
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:17:11: error: expected external declaration
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:17:12: error: unknown type name 'value'
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:17:17: error: expected unqualified-id
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:24:7: error: unknown type name 'constexpr'
constexpr bool operator==(const array<T, N>& x, const array<T, N>& y);
^
p876.cpp:24:39: error: no template named 'array'
constexpr bool operator==(const array<T, N>& x, const array<T, N>& y);
^
p876.cpp:24:61: error: no template named 'array'
constexpr bool operator==(const array<T, N>& x, const array<T, N>& y);
^
p876.cpp:26:1: error: unknown type name 'constexpr'
constexpr synth-three-way-result<T>
^
p876.cpp:26:11: warning: variable templates are a C++14 extension [-Wc++14-extensions]
constexpr synth-three-way-result<T>
^
p876.cpp:26:16: error: expected ';' at end of declaration
constexpr synth-three-way-result<T>
^
;
p876.cpp:26:16: error: expected external declaration
p876.cpp:26:17: error: unknown type name 'three'
constexpr synth-three-way-result<T>
^
p876.cpp:26:22: error: expected unqualified-id
constexpr synth-three-way-result<T>
^
p876.cpp:27:17: warning: '<=>' is a single token in C++20; add a space to avoid a change in behavior [-Wc++20-compat]
operator<=>(const array<T, N>& x, const array<T, N>& y);
^
p876.cpp:30:7: error: unknown type name 'constexpr'
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
^
p876.cpp:30:33: error: use of undeclared identifier 'T'
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
^
p876.cpp:30:49: error: use of undeclared identifier 'T'
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
^
p876.cpp:30:59: error: expected function body after function declarator
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
^
p876.cpp:32:7: error: unknown type name 'constexpr'
constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
^
p876.cpp:32:35: error: use of undeclared identifier 'T'
constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
$ clang++ p876.cpp -std=2b -o p876l -I. -Wall
p876.cpp:17:1: error: cannot template a using declaration
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:17:11: error: expected external declaration
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:17:12: error: unknown type name 'value'
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:17:17: error: expected unqualified-id
using iter-value-type = typename iterator_traits<InputIterator>::value_type;
^
p876.cpp:26:11: error: unknown type name 'synth'
constexpr synth-three-way-result<T>
^
p876.cpp:26:16: error: expected unqualified-id
constexpr synth-three-way-result<T>
^
p876.cpp:30:33: error: use of undeclared identifier 'T'
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
^
p876.cpp:30:49: error: use of undeclared identifier 'T'
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
^
p876.cpp:32:35: error: use of undeclared identifier 'T'
constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
^
p876.cpp:32:55: error: use of undeclared identifier 'a'
constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
^
p876.cpp:32:58: error: use of undeclared identifier 'N'
constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
^
p876.cpp:34:42: error: 'to_array' is missing exception specification 'noexcept(is_nothrow_move_constructible_v<_Tp>)'
constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
^
noexcept(is_nothrow_move_constructible_v<_Tp>)
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/array:397:5: note: previous declaration is here
to_array(_Tp (&&__a)[_Nm])
^
p876.cpp:58:1: error: unknown type name 'synth'
synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
^
p876.cpp:58:6: error: expected unqualified-id
synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
^
p876.cpp:83:1: error: unknown type name 'synth'
synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
^
p876.cpp:83:6: error: expected unqualified-id
synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
^
p876.cpp:108:1: error: unknown type name 'synth'
synth-three-way-result<T> operator<=>(const list<T, Allocator>& x,
^
p876.cpp:108:6: error: expected unqualified-id
synth-three-way-result<T> operator<=>(const list<T, Allocator>& x,
^
p876.cpp:129:37: error: template parameter redefines default argument
template<class T, class Allocator = allocator<T>> class vector;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:388:44: note: previous default template argument defined here
template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
$ g++ p876.cpp -std=03 -o p876g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
from N4910.h:11,
from p876.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 \
| ^~~~~
p876.cpp:24:7: warning: identifier 'constexpr' is a keyword in C++11 [-Wc++11-compat]
24 | constexpr bool operator==(const array<T, N>& x, const array<T, N>& y);
| ^~~~~~~~~
p876.cpp:30:59: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^~~~~~~~
p876.cpp:469:48: error: too many decimal points in number
469 | requirements for an allocator-aware container (24.2.2.5). In addition, a forward_list provides the assign member functions and several of the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on forward_list that are not described in that table or for operations where there is additional semantic information.
| ^~~~~~~~
p876.cpp:469:185: error: too many decimal points in number
469 | he assign member functions and several of the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on forward_list that are not described in that table or for operations where there is additional semantic information.
| ^~~~~~
p876.cpp:17:1: error: expected unqualified-id before 'using'
17 | using iter-value-type = typename iterator_traits<InputIterator>::value_type;
| ^~~~~
p876.cpp:24:7: error: 'constexpr' does not name a type
24 | constexpr bool operator==(const array<T, N>& x, const array<T, N>& y);
| ^~~~~~~~~
p876.cpp:24:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:26:1: error: 'constexpr' does not name a type
26 | constexpr synth-three-way-result<T>
| ^~~~~~~~~
p876.cpp:26:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:30:7: error: 'constexpr' does not name a type
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^~~~~~~~~
p876.cpp:30:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:32:7: error: 'constexpr' does not name a type
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^~~~~~~~~
p876.cpp:32:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:34:7: error: 'constexpr' does not name a type
34 | constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
| ^~~~~~~~~
p876.cpp:34:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:37:25: error: 'array' was not declared in this scope
37 | struct tuple_size<array<T, N>>;
| ^~~~~
p876.cpp:37:25: note: 'std::array' is only available from C++11 onwards
p876.cpp:37:35: error: spurious '>>', use '>' to terminate a template argument list
37 | struct tuple_size<array<T, N>>;
| ^~
p876.cpp:37:35: error: wrong number of template arguments (2, should be 1)
p876.cpp:36:26: note: provided for 'template<class T> struct std::tuple_size'
36 | template<class T> struct tuple_size; template<size_t I, class T> struct tuple_element; template<class T, size_t N>
| ^~~~~~~~~~
p876.cpp:39:31: error: 'array' was not declared in this scope
39 | struct tuple_element<I, array<T, N>>;
| ^~~~~
p876.cpp:39:31: note: 'std::array' is only available from C++11 onwards
p876.cpp:39:41: error: spurious '>>', use '>' to terminate a template argument list
39 | struct tuple_element<I, array<T, N>>;
| ^~
p876.cpp:39:41: error: wrong number of template arguments (3, should be 2)
p876.cpp:36:73: note: provided for 'template<long unsigned int I, class T> struct std::tuple_element'
36 | template<class T> struct tuple_size; template<size_t I, class T> struct tuple_element; template<class T, size_t N>
| ^~~~~~~~~~~~~
p876.cpp:41:7: error: 'constexpr' does not name a type
41 | constexpr T& get(array<T, N>&) noexcept;
| ^~~~~~~~~
p876.cpp:41:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:43:7: error: 'constexpr' does not name a type
43 | constexpr T&& get(array<T, N>&&) noexcept;
| ^~~~~~~~~
p876.cpp:43:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:45:7: error: 'constexpr' does not name a type
45 | constexpr const T& get(const array<T, N>&) noexcept;
| ^~~~~~~~~
p876.cpp:45:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:47:7: error: 'constexpr' does not name a type
47 | constexpr const T&& get(const array<T, N>&&) noexcept;
| ^~~~~~~~~
p876.cpp:47:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:54:48: error: spurious '>>', use '>' to terminate a template argument list
54 | template<class T, class Allocator = allocator<T>> class deque;
| ^~
p876.cpp:54:37: error: two or more data types in declaration of 'type name'
54 | template<class T, class Allocator = allocator<T>> class deque;
| ^~~~~~~~~~~~~
p876.cpp:54:62: error: expected '>' before ';' token
54 | template<class T, class Allocator = allocator<T>> class deque;
| ^
p876.cpp:54:62: error: expected unqualified-id before ';' token
p876.cpp:56:29: error: 'std::deque' is not a template
56 | bool operator==(const deque<T, Allocator>& x, const deque<T, Allocator>& y);
| ^~~~~
p876.cpp:56:59: error: 'std::deque' is not a template
56 | bool operator==(const deque<T, Allocator>& x, const deque<T, Allocator>& y);
| ^~~~~
p876.cpp:58:1: error: 'synth' does not name a type
58 | synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
| ^~~~~
p876.cpp:61:17: error: 'std::deque' is not a template
61 | void swap(deque<T, Allocator>& x, deque<T, Allocator>& y)
| ^~~~~
p876.cpp:61:41: error: 'std::deque' is not a template
61 | void swap(deque<T, Allocator>& x, deque<T, Allocator>& y)
| ^~~~~
p876.cpp:62:9: error: expected initializer before 'noexcept'
62 | noexcept(noexcept(x.swap(y)));
| ^~~~~~~~
p876.cpp:64:16: error: expected nested-name-specifier before 'deque'
64 | typename deque<T, Allocator>::size_type
| ^~~~~
p876.cpp:64:21: error: expected initializer before '<' token
64 | typename deque<T, Allocator>::size_type
| ^
p876.cpp:67:16: error: expected nested-name-specifier before 'deque'
67 | typename deque<T, Allocator>::size_type
| ^~~~~
p876.cpp:67:21: error: expected initializer before '<' token
67 | typename deque<T, Allocator>::size_type
| ^
p876.cpp:71:9: error: expected unqualified-id before 'using'
71 | using deque = std::deque<T, polymorphic_allocator<T>>;
| ^~~~~
p876.cpp:79:48: error: spurious '>>', use '>' to terminate a template argument list
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^~
p876.cpp:79:37: error: two or more data types in declaration of 'type name'
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^~~~~~~~~~~~~
p876.cpp:79:69: error: expected '>' before ';' token
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^
p876.cpp:79:69: error: expected unqualified-id before ';' token
p876.cpp:81:29: error: 'std::forward_list' is not a template
81 | bool operator==(const forward_list<T, Allocator>& x, const forward_list<T, Allocator>& y);
| ^~~~~~~~~~~~
p876.cpp:81:66: error: 'std::forward_list' is not a template
81 | bool operator==(const forward_list<T, Allocator>& x, const forward_list<T, Allocator>& y);
| ^~~~~~~~~~~~
p876.cpp:83:1: error: 'synth' does not name a type
83 | synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
| ^~~~~
p876.cpp:86:17: error: 'std::forward_list' is not a template
86 | void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
| ^~~~~~~~~~~~
p876.cpp:86:48: error: 'std::forward_list' is not a template
86 | void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y)
| ^~~~~~~~~~~~
p876.cpp:87:9: error: expected initializer before 'noexcept'
87 | noexcept(noexcept(x.swap(y)));
| ^~~~~~~~
p876.cpp:89:16: error: expected nested-name-specifier before 'forward_list'
89 | typename forward_list<T, Allocator>::size_type
| ^~~~~~~~~~~~
p876.cpp:89:28: error: expected initializer before '<' token
89 | typename forward_list<T, Allocator>::size_type
| ^
p876.cpp:92:16: error: expected nested-name-specifier before 'forward_list'
92 | typename forward_list<T, Allocator>::size_type
| ^~~~~~~~~~~~
p876.cpp:92:28: error: expected initializer before '<' token
92 | typename forward_list<T, Allocator>::size_type
| ^
p876.cpp:96:9: error: expected unqualified-id before 'using'
96 | using forward_list = std::forward_list<T, polymorphic_allocator<T>>;
| ^~~~~
p876.cpp:104:48: error: spurious '>>', use '>' to terminate a template argument list
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~
p876.cpp:104:37: error: two or more data types in declaration of 'type name'
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~~~~~~~~~~
p876.cpp:104:61: error: expected '>' before ';' token
104 | template<class T, class Allocator = allocator<T>> class list;
| ^
p876.cpp:104:61: error: expected unqualified-id before ';' token
p876.cpp:106:27: error: 'std::list' is not a template
106 | bool operator==(const list<T, Allocator>& x, const list<T, Allocator>& y);
| ^~~~
p876.cpp:106:56: error: 'std::list' is not a template
106 | bool operator==(const list<T, Allocator>& x, const list<T, Allocator>& y);
| ^~~~
p876.cpp:108:1: error: 'synth' does not name a type
108 | synth-three-way-result<T> operator<=>(const list<T, Allocator>& x,
| ^~~~~
p876.cpp:111:15: error: 'std::list' is not a template
111 | void swap(list<T, Allocator>& x, list<T, Allocator>& y)
| ^~~~
p876.cpp:111:38: error: 'std::list' is not a template
111 | void swap(list<T, Allocator>& x, list<T, Allocator>& y)
| ^~~~
p876.cpp:112:7: error: expected initializer before 'noexcept'
112 | noexcept(noexcept(x.swap(y)));
| ^~~~~~~~
p876.cpp:114:14: error: expected nested-name-specifier before 'list'
114 | typename list<T, Allocator>::size_type
| ^~~~
p876.cpp:114:18: error: expected initializer before '<' token
114 | typename list<T, Allocator>::size_type
| ^
p876.cpp:117:14: error: expected nested-name-specifier before 'list'
117 | typename list<T, Allocator>::size_type
| ^~~~
p876.cpp:117:18: error: expected initializer before '<' token
117 | typename list<T, Allocator>::size_type
| ^
p876.cpp:121:7: error: expected unqualified-id before 'using'
121 | using list = std::list<T, polymorphic_allocator<T>>;
| ^~~~~
p876.cpp:129:48: error: spurious '>>', use '>' to terminate a template argument list
129 | template<class T, class Allocator = allocator<T>> class vector;
| ^~
p876.cpp:129:57: error: template argument required for 'class vector'
129 | template<class T, class Allocator = allocator<T>> class vector;
| ^~~~~~
p876.cpp:129:37: error: two or more data types in declaration of 'type name'
129 | template<class T, class Allocator = allocator<T>> class vector;
| ^~~~~~~~~~~~~
p876.cpp:129:63: error: expected '>' before ';' token
129 | template<class T, class Allocator = allocator<T>> class vector;
| ^
p876.cpp:129:63: error: expected unqualified-id before ';' token
p876.cpp:131:7: error: 'constexpr' does not name a type
131 | constexpr bool operator==(const vector<T, Allocator>& x, const vector<T, Allocator>& y);
| ^~~~~~~~~
p876.cpp:131:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:133:1: error: 'constexpr' does not name a type
133 | constexpr synth-three-way-result<T> operator<=>(const vector<T, Allocator>& x,
| ^~~~~~~~~
p876.cpp:133:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:136:7: error: 'constexpr' does not name a type
136 | constexpr void swap(vector<T, Allocator>& x, vector<T, Allocator>& y)
| ^~~~~~~~~
p876.cpp:136:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:139:7: error: 'constexpr' does not name a type
139 | constexpr typename vector<T, Allocator>::size_type
| ^~~~~~~~~
p876.cpp:139:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:142:7: error: 'constexpr' does not name a type
142 | constexpr typename vector<T, Allocator>::size_type
| ^~~~~~~~~
p876.cpp:142:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:148:65: error: '>>' should be '> >' within a nested template argument list
148 | template<class Allocator> struct hash<vector<bool, Allocator>>;
| ^~
| > >
p876.cpp:151:9: error: expected unqualified-id before 'using'
151 | using vector = std::vector<T, polymorphic_allocator<T>>;
| ^~~~~
p876.cpp:165:11: error: expected nested-name-specifier before 'value_type'
165 | using value_type =T;
| ^~~~~~~~~~
p876.cpp:166:11: error: expected nested-name-specifier before 'pointer'
166 | using pointer = T*;
| ^~~~~~~
p876.cpp:167:11: error: expected nested-name-specifier before 'const_pointer'
167 | using const_pointer = const T*;
| ^~~~~~~~~~~~~
p876.cpp:168:11: error: expected nested-name-specifier before 'reference'
168 | using reference = T&;
| ^~~~~~~~~
p876.cpp:169:11: error: expected nested-name-specifier before 'const_reference'
169 | using const_reference = const T&;
| ^~~~~~~~~~~~~~~
p876.cpp:170:11: error: expected nested-name-specifier before 'size_type'
170 | using size_type = size_t;
| ^~~~~~~~~
p876.cpp:171:7: error: expected nested-name-specifier before 'difference_type'
171 | using difference_type = ptrdiff_t;
| ^~~~~~~~~~~~~~~
p876.cpp:172:7: error: expected nested-name-specifier before 'iterator'
172 | using iterator = implementation-defined ; // see 24.2
| ^~~~~~~~
p876.cpp:173:7: error: expected nested-name-specifier before 'const_iterator'
173 | using const_iterator = implementation-defined ; // see 24.2
| ^~~~~~~~~~~~~~
p876.cpp:174:7: error: expected nested-name-specifier before 'reverse_iterator'
174 | using reverse_iterator = std::reverse_iterator<iterator>;
| ^~~~~~~~~~~~~~~~
p876.cpp:175:7: error: expected nested-name-specifier before 'const_reverse_iterator'
175 | using const_reverse_iterator = std::reverse_iterator<const_iterator>;
| ^~~~~~~~~~~~~~~~~~~~~~
p876.cpp:177:1: error: 'constexpr' does not name a type
177 | constexpr void fill(const T& u);
| ^~~~~~~~~
p876.cpp:177:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:178:1: error: 'constexpr' does not name a type
178 | constexpr void swap(array&) noexcept(is_nothrow_swappable_v<T>);
| ^~~~~~~~~
p876.cpp:178:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:180:1: error: 'constexpr' does not name a type
180 | constexpr iterator
| ^~~~~~~~~
p876.cpp:180:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:186:1: error: 'constexpr' does not name a type
186 | constexpr reverse_iterator rend() noexcept;
| ^~~~~~~~~
p876.cpp:186:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:187:1: error: 'constexpr' does not name a type
187 | constexpr const_reverse_iterator rend() const noexcept;
| ^~~~~~~~~
p876.cpp:187:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:188:1: error: 'constexpr' does not name a type
188 | constexpr const_iterator cbegin() const noexcept;
| ^~~~~~~~~
p876.cpp:188:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:189:1: error: 'constexpr' does not name a type
189 | constexpr const_iterator cend() const noexcept;
| ^~~~~~~~~
p876.cpp:189:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:190:1: error: 'constexpr' does not name a type
190 | constexpr const_reverse_iterator crbegin() const noexcept;
| ^~~~~~~~~
p876.cpp:190:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:191:1: error: 'constexpr' does not name a type
191 | constexpr const_reverse_iterator crend() const noexcept;
| ^~~~~~~~~
p876.cpp:191:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:193:1: error: expected unqualified-id before '[' token
193 | [[nodiscard]] constexpr bool empty() const noexcept;
| ^
p876.cpp:194:1: error: 'constexpr' does not name a type
194 | constexpr size_type size() const noexcept;
| ^~~~~~~~~
p876.cpp:194:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:195:1: error: 'constexpr' does not name a type
195 | constexpr size_type max_size() const noexcept;
| ^~~~~~~~~
p876.cpp:195:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:197:1: error: 'constexpr' does not name a type
197 | constexpr reference operator[](size_type n);
| ^~~~~~~~~
p876.cpp:197:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:198:1: error: 'constexpr' does not name a type
198 | constexpr const_reference operator[](size_type n) const;
| ^~~~~~~~~
p876.cpp:198:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:199:1: error: ISO C++ forbids declaration of 'begin' with no type [-fpermissive]
199 | begin() noexcept;
| ^~~~~
p876.cpp:199:7: error: expected ';' at end of member declaration
199 | begin() noexcept;
| ^
| ;
p876.cpp:199:9: error: 'noexcept' does not name a type
199 | begin() noexcept;
| ^~~~~~~~
p876.cpp:199:9: note: C++11 'noexcept' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:200:1: error: ISO C++ forbids declaration of 'begin' with no type [-fpermissive]
200 | begin() const noexcept;
| ^~~~~
p876.cpp:200:9: error: expected ';' at end of member declaration
200 | begin() const noexcept;
| ^~~~~
| ;
p876.cpp:200:15: error: 'noexcept' does not name a type
200 | begin() const noexcept;
| ^~~~~~~~
p876.cpp:200:15: note: C++11 'noexcept' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:201:1: error: ISO C++ forbids declaration of 'end' with no type [-fpermissive]
201 | end() noexcept;
| ^~~
p876.cpp:201:5: error: expected ';' at end of member declaration
201 | end() noexcept;
| ^
| ;
p876.cpp:201:7: error: 'noexcept' does not name a type
201 | end() noexcept;
| ^~~~~~~~
p876.cpp:201:7: note: C++11 'noexcept' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:202:1: error: ISO C++ forbids declaration of 'end' with no type [-fpermissive]
202 | end() const noexcept;
| ^~~
p876.cpp:202:7: error: expected ';' at end of member declaration
202 | end() const noexcept;
| ^~~~~
| ;
p876.cpp:202:13: error: 'noexcept' does not name a type
202 | end() const noexcept;
| ^~~~~~~~
p876.cpp:202:13: note: C++11 'noexcept' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:203:1: error: ISO C++ forbids declaration of 'rbegin' with no type [-fpermissive]
203 | rbegin() noexcept;
| ^~~~~~
p876.cpp:203:8: error: expected ';' at end of member declaration
203 | rbegin() noexcept;
| ^
| ;
p876.cpp:203:10: error: 'noexcept' does not name a type
203 | rbegin() noexcept;
| ^~~~~~~~
p876.cpp:203:10: note: C++11 'noexcept' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:204:5: error: 'constexpr' does not name a type
204 | constexpr reference at(size_type n);
| ^~~~~~~~~
p876.cpp:204:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:205:5: error: 'constexpr' does not name a type
205 | constexpr const_reference at(size_type n) const;
| ^~~~~~~~~
p876.cpp:205:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:206:5: error: 'constexpr' does not name a type
206 | constexpr reference front();
| ^~~~~~~~~
p876.cpp:206:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:207:5: error: 'constexpr' does not name a type
207 | constexpr const_reference front() const;
| ^~~~~~~~~
p876.cpp:207:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:208:5: error: 'constexpr' does not name a type
208 | constexpr reference back();
| ^~~~~~~~~
p876.cpp:208:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:209:5: error: 'constexpr' does not name a type
209 | constexpr const_reference back() const;
| ^~~~~~~~~
p876.cpp:209:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:210:5: error: 'constexpr' does not name a type
210 | constexpr T * data() noexcept;
| ^~~~~~~~~
p876.cpp:210:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:211:5: error: 'constexpr' does not name a type
211 | constexpr const T * data() const noexcept;
| ^~~~~~~~~
p876.cpp:211:5: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:213:26: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
213 | template<class T, class... U>
| ^~~
p876.cpp:214:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
214 | array(T, U...) -> array<T, 1 + sizeof...(U)>;
| ^~~
p876.cpp:214:42: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
214 | array(T, U...) -> array<T, 1 + sizeof...(U)>;
| ^~~
p876.cpp:214:49: error: expected constructor, destructor, or type conversion before ';' token
214 | array(T, U...) -> array<T, 1 + sizeof...(U)>;
| ^
p876.cpp:218:27: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
218 | template<class T, class... U>
| ^~~
p876.cpp:219:16: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
219 | array(T, U...) -> array<T, 1 + sizeof...(U)>;
| ^~~
p876.cpp:219:43: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
219 | array(T, U...) -> array<T, 1 + sizeof...(U)>;
| ^~~
p876.cpp:219:50: error: expected constructor, destructor, or type conversion before ';' token
219 | array(T, U...) -> array<T, 1 + sizeof...(U)>;
| ^
p876.cpp:222:1: error: 'constexpr' does not name a type
222 | constexpr size_type size() const noexcept;
| ^~~~~~~~~
p876.cpp:222:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:224:1: error: 'constexpr' does not name a type
224 | constexpr T* data() noexcept;
| ^~~~~~~~~
p876.cpp:224:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:225:1: error: 'constexpr' does not name a type
225 | constexpr const T* data() const noexcept;
| ^~~~~~~~~
p876.cpp:225:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:227:1: error: 'constexpr' does not name a type
227 | constexpr void fill(const T& u);
| ^~~~~~~~~
p876.cpp:227:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:229:1: error: 'constexpr' does not name a type
229 | constexpr void swap(array& y) noexcept(is_nothrow_swappable_v<T>);
| ^~~~~~~~~
p876.cpp:229:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:234:3: error: 'constexpr' does not name a type
234 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^~~~~~~~~
p876.cpp:234:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:244:6: error: 'constexpr' does not name a type
244 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^~~~~~~~~
p876.cpp:244:6: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:248:3: error: 'constexpr' does not name a type
248 | constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
| ^~~~~~~~~
p876.cpp:248:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:253:31: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
253 | struct tuple_size<array<T, N>> : integral_constant<size_t, N> { };
| ^~
p876.cpp:253:31: note: suggest parentheses around '>>' expression
p876.cpp:253:63: error: template argument 2 is invalid
253 | struct tuple_size<array<T, N>> : integral_constant<size_t, N> { };
| ^
p876.cpp:253:65: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
253 | struct tuple_size<array<T, N>> : integral_constant<size_t, N> { };
| ^
p876.cpp:253:67: error: template argument 1 is invalid
253 | struct tuple_size<array<T, N>> : integral_constant<size_t, N> { };
| ^
p876.cpp:255:37: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
255 | struct tuple_element<I, array<T, N>> {
| ^~
p876.cpp:255:37: note: suggest parentheses around '>>' expression
p876.cpp:255:37: error: template argument 2 is invalid
p876.cpp:255:40: warning: extended initializer lists only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
255 | struct tuple_element<I, array<T, N>> {
| ^
p876.cpp:255:27: error: template argument 2 is invalid
255 | struct tuple_element<I, array<T, N>> {
| ^~~~~~~~~~~~
p876.cpp:260:3: error: 'constexpr' does not name a type
260 | constexpr T& get(array<T, N>& a) noexcept;
| ^~~~~~~~~
p876.cpp:260:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:262:3: error: 'constexpr' does not name a type
262 | constexpr T&& get(array<T, N>&& a) noexcept;
| ^~~~~~~~~
p876.cpp:262:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:264:3: error: 'constexpr' does not name a type
264 | constexpr const T& get(const array<T, N>& a) noexcept;
| ^~~~~~~~~
p876.cpp:264:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:266:3: error: 'constexpr' does not name a type
266 | constexpr const T&& get(const array<T, N>&& a) noexcept;
| ^~~~~~~~~
p876.cpp:266:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:274:55: error: spurious '>>', use '>' to terminate a template argument list
274 | template<class T, class Allocator = allocator<T>>
| ^~
p876.cpp:275:20: error: definition of 'class std::deque' inside template parameter list
275 | class deque {
| ^
p876.cpp:274:44: error: two or more data types in declaration of 'type name'
274 | template<class T, class Allocator = allocator<T>>
| ^~~~~~~~~~~~~
p876.cpp:379:2: error: expected '>' before ';' token
379 | };
| ^
p876.cpp:379:2: error: expected unqualified-id before ';' token
p876.cpp:380:59: error: 'iter' was not declared in this scope
380 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
p876.cpp:380:64: error: 'value' was not declared in this scope
380 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~~
p876.cpp:380:70: error: 'type' was not declared in this scope; did you mean 'ctype'?
380 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
| ctype
p876.cpp:380:90: error: template argument 1 is invalid
380 | emplate<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^
p876.cpp:380:97: error: expected '>' before '(' token
380 | <class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^
p876.cpp:381:52: error: expected unqualified-id before ';' token
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:382:14: error: 'ranges' has not been declared
382 | template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
| ^~~~~~
p876.cpp:382:34: error: expected '>' before 'R'
382 | template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
| ^
p876.cpp:384:54: error: expected unqualified-id before ';' token
384 | -> deque<ranges::range_value_t<R>, Allocator>;
| ^
p876.cpp:387:16: error: expected unqualified-id before 'const'
387 | explicit deque(const Allocator&);
| ^~~~~
p876.cpp:387:16: error: expected ')' before 'const'
387 | explicit deque(const Allocator&);
| ~^~~~~
| )
p876.cpp:388:25: error: expected ')' before 'n'
388 | explicit deque(size_type n, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:389:14: error: found ':' in nested-name-specifier, expected '::'
389 | Preconditions: T is Cpp17DefaultInsertable into *this.
| ^
| ::
p876.cpp:389:1: error: 'Preconditions' does not name a type
389 | Preconditions: T is Cpp17DefaultInsertable into *this.
| ^~~~~~~~~~~~~
p876.cpp:395:25: error: expected ')' before 'first'
395 | deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ~ ^~~~~~
| )
p876.cpp:397:10: error: 'container' has not been declared
397 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:397:19: error: expected '>' before '-' token
397 | template<container-compatible-range<T> R>
| ^
p876.cpp:398:19: error: expected ')' before ',' token
398 | deque(from_range_t, R&& rg, const Allocator& = Allocator());
| ~ ^
| )
p876.cpp:401:6: error: variable or field 'resize' declared void
401 | void resize(size_type sz);
| ^~~~~~
p876.cpp:401:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
401 | void resize(size_type sz);
| ^~~~~~~~~
| size_t
p876.cpp:404:1: error: 'sz' does not name a type
404 | sz - size() default-inserted elements to the sequence.
| ^~
p876.cpp:408:1: error: 'sz' does not name a type
408 | sz - size() copies of c to the sequence.
| ^~
p876.cpp:412:1: error: 'the' does not name a type
412 | the sequence.
| ^~~
p876.cpp:419:1: error: invalid use of template-name 'std::iterator' without an argument list
419 | iterator insert(const_iterator position, T&& x);
| ^~~~~~~~
p876.cpp:419:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
In file included from /usr/local/include/c++/12.1.0/string:45,
from /usr/local/include/c++/12.1.0/bits/locale_classes.h:40,
from /usr/local/include/c++/12.1.0/bits/ios_base.h:41,
from /usr/local/include/c++/12.1.0/ios:42,
from /usr/local/include/c++/12.1.0/ostream:38,
from /usr/local/include/c++/12.1.0/iostream:39,
from N4910.h:2:
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:420:1: error: invalid use of template-name 'std::iterator' without an argument list
420 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~
p876.cpp:420:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:422:3: error: invalid use of template-name 'std::iterator' without an argument list
422 | iterator insert(const_iterator position,
| ^~~~~~~~
p876.cpp:422:3: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:424:10: error: 'container' has not been declared
424 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:424:19: error: expected '>' before '-' token
424 | template<container-compatible-range<T> R>
| ^
p876.cpp:425:1: error: invalid use of template-name 'std::iterator' without an argument list
425 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~
p876.cpp:425:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:426:1: error: invalid use of template-name 'std::iterator' without an argument list
426 | iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~
p876.cpp:426:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:427:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
427 | template<class... Args> reference emplace_front(Args&&... args);
| ^~~
p876.cpp:427:25: error: 'reference' does not name a type
427 | template<class... Args> reference emplace_front(Args&&... args);
| ^~~~~~~~~
p876.cpp:428:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
428 | template<class... Args> reference emplace_back(Args&&... args);
| ^~~
p876.cpp:428:25: error: 'reference' does not name a type
428 | template<class... Args> reference emplace_back(Args&&... args);
| ^~~~~~~~~
p876.cpp:429:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
429 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~
p876.cpp:429:25: error: invalid use of template-name 'std::iterator' without an argument list
429 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~~
p876.cpp:429:25: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:429:106: error: 'T' does not name a type
429 | ss... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^
p876.cpp:430:6: error: variable or field 'push_front' declared void
430 | void push_front(T&& x);
| ^~~~~~~~~~
p876.cpp:430:17: error: 'T' was not declared in this scope
430 | void push_front(T&& x);
| ^
p876.cpp:430:21: error: 'x' was not declared in this scope
430 | void push_front(T&& x);
| ^
p876.cpp:431:10: error: 'container' has not been declared
431 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:431:19: error: expected '>' before '-' token
431 | template<container-compatible-range<T> R>
| ^
p876.cpp:432:8: error: variable or field 'prepend_range' declared void
432 | void prepend_range(R&& rg);
| ^~~~~~~~~~~~~
p876.cpp:432:22: error: 'R' was not declared in this scope
432 | void prepend_range(R&& rg);
| ^
p876.cpp:432:26: error: 'rg' was not declared in this scope
432 | void prepend_range(R&& rg);
| ^~
p876.cpp:433:22: error: 'T' does not name a type
433 | void push_back(const T& x);
| ^
p876.cpp:434:6: error: variable or field 'push_back' declared void
434 | void push_back(T&& x);
| ^~~~~~~~~
p876.cpp:434:16: error: 'T' was not declared in this scope
434 | void push_back(T&& x);
| ^
p876.cpp:434:20: error: 'x' was not declared in this scope
434 | void push_back(T&& x);
| ^
p876.cpp:435:10: error: 'container' has not been declared
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^~~~~~~~~
p876.cpp:435:19: error: expected '>' before '-' token
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^
p876.cpp:435:48: error: variable or field 'append_range' declared void
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^~~~~~~~~~~~
p876.cpp:435:61: error: 'R' was not declared in this scope
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^
p876.cpp:435:65: error: 'rg' was not declared in this scope
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^~
p876.cpp:438:8: error: found ':' in nested-name-specifier, expected '::'
438 | Remarks: If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move assignment operator of T there are no effects. If an exception is thrown while inserting a single element at either end, there are no effects. Otherwise, if an exception is thrown by the move constructor of a non-Cpp17CopyInsertable T, the effects are unspecified.
| ^
| ::
p876.cpp:438:1: error: 'Remarks' does not name a type
438 | Remarks: If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move assignment operator of T there are no effects. If an exception is thrown while inserting a single element at either end, there are no effects. Otherwise, if an exception is thrown by the move constructor of a non-Cpp17CopyInsertable T, the effects are unspecified.
| ^~~~~~~
p876.cpp:440:1: error: invalid use of template-name 'std::iterator' without an argument list
440 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~
p876.cpp:440:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:445:7: error: found ':' in nested-name-specifier, expected '::'
445 | Throws: Nothing unless an exception is thrown by the assignment operator of T.
| ^
| ::
p876.cpp:445:1: error: 'Throws' does not name a type
445 | Throws: Nothing unless an exception is thrown by the assignment operator of T.
| ^~~~~~
p876.cpp:452:4: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
452 | auto it = remove(c.begin(), c.end(), value);
| ^~~~
| ----
p876.cpp:452:9: error: 'it' does not name a type; did you mean 'int'?
452 | auto it = remove(c.begin(), c.end(), value);
| ^~
| int
p876.cpp:453:4: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
453 | auto r = distance(it, c.end());
| ^~~~
| ----
p876.cpp:453:9: error: 'r' does not name a type
453 | auto r = distance(it, c.end());
| ^
p876.cpp:454:4: error: 'c' does not name a type
454 | c.erase(it, c.end());
| ^
p876.cpp:455:4: error: expected unqualified-id before 'return'
455 | return r;
| ^~~~~~
p876.cpp:457:12: error: expected nested-name-specifier before 'deque'
457 | typename deque<T, Allocator>::size_type
| ^~~~~
p876.cpp:457:17: error: expected initializer before '<' token
457 | typename deque<T, Allocator>::size_type
| ^
p876.cpp:460:8: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
460 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~~~
| ----
p876.cpp:460:13: error: 'it' does not name a type; did you mean 'int'?
460 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~
| int
p876.cpp:461:8: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
461 | auto r = distance(it, c.end());
| ^~~~
| ----
p876.cpp:461:13: error: 'r' does not name a type
461 | auto r = distance(it, c.end());
| ^
p876.cpp:462:8: error: 'c' does not name a type
462 | c.erase(it, c.end());
| ^
p876.cpp:463:8: error: expected unqualified-id before 'return'
463 | return r;
| ^~~~~~
p876.cpp:469:1: error: 'requirements' does not name a type
469 | requirements for an allocator-aware container (24.2.2.5). In addition, a forward_list provides the assign member functions and several of the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on forward_list that are not described in that table or for operations where there is additional semantic information.
| ^~~~~~~~~~~~
p876.cpp:566:26: error: expected unqualified-id before 'const'
566 | explicit forward_list(const Allocator&);
| ^~~~~
p876.cpp:566:26: error: expected ')' before 'const'
566 | explicit forward_list(const Allocator&);
| ~^~~~~
| )
p876.cpp:567:32: error: expected ')' before 'n'
567 | explicit forward_list(size_type n, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:570:23: error: expected ')' before 'n'
570 | forward_list(size_type n, const T& value, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:574:29: error: expected ')' before 'first'
574 | forward_list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ~ ^~~~~~
| )
p876.cpp:576:10: error: 'container' has not been declared
576 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:576:19: error: expected '>' before '-' token
576 | template<container-compatible-range<T> R>
| ^
p876.cpp:577:26: error: expected ')' before ',' token
577 | forward_list(from_range_t, R&& rg, const Allocator& = Allocator());
| ~ ^
| )
p876.cpp:580:1: error: invalid use of template-name 'std::iterator' without an argument list
580 | iterator before_begin() noexcept;
| ^~~~~~~~
p876.cpp:580:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:581:1: error: 'const_iterator' does not name a type
581 | const_iterator before_begin() const noexcept;
| ^~~~~~~~~~~~~~
p876.cpp:582:1: error: 'const_iterator' does not name a type
582 | const_iterator cbefore_begin() const noexcept;
| ^~~~~~~~~~~~~~
p876.cpp:587:1: error: 'reference' does not name a type
587 | reference front();
| ^~~~~~~~~
p876.cpp:588:1: error: 'const_reference' does not name a type
588 | const_reference front() const;
| ^~~~~~~~~~~~~~~
p876.cpp:589:1: error: 'Returns' does not name a type
589 | Returns: *begin()
| ^~~~~~~
p876.cpp:594:23: error: 'T' does not name a type
594 | void push_front(const T& x);
| ^
p876.cpp:595:6: error: variable or field 'push_front' declared void
595 | void push_front(T&& x);
| ^~~~~~~~~~
p876.cpp:595:17: error: 'T' was not declared in this scope
595 | void push_front(T&& x);
| ^
p876.cpp:595:21: error: 'x' was not declared in this scope
595 | void push_front(T&& x);
| ^
p876.cpp:597:6: error: variable or field 'prepend_range' declared void
597 | void prepend_range(R&& rg);
| ^~~~~~~~~~~~~
p876.cpp:597:20: error: 'R' was not declared in this scope
597 | void prepend_range(R&& rg);
| ^
p876.cpp:597:24: error: 'rg' was not declared in this scope
597 | void prepend_range(R&& rg);
| ^~
p876.cpp:601:1: error: invalid use of template-name 'std::iterator' without an argument list
601 | iterator insert_after(const_iterator position, T&& x);
| ^~~~~~~~
p876.cpp:601:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:604:1: error: invalid use of template-name 'std::iterator' without an argument list
604 | iterator insert_after(const_iterator position, size_type n, const T& x);
| ^~~~~~~~
p876.cpp:604:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:609:3: error: invalid use of template-name 'std::iterator' without an argument list
609 | iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
| ^~~~~~~~
p876.cpp:609:3: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:613:10: error: 'container' has not been declared
613 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:613:19: error: expected '>' before '-' token
613 | template<container-compatible-range<T> R>
| ^
p876.cpp:614:1: error: invalid use of template-name 'std::iterator' without an argument list
614 | iterator insert_range_after(const_iterator position, R&& rg);
| ^~~~~~~~
p876.cpp:614:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:618:1: error: invalid use of template-name 'std::iterator' without an argument list
618 | iterator insert_after(const_iterator position, initializer_list<T> il);
| ^~~~~~~~
p876.cpp:618:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:622:8: error: found ':' in nested-name-specifier, expected '::'
622 | Effects: Inserts the contents of x after position, and x becomes empty. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into
| ^
| ::
p876.cpp:622:1: error: 'Effects' does not name a type
622 | Effects: Inserts the contents of x after position, and x becomes empty. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into
| ^~~~~~~
p876.cpp:629:1: error: invalid use of template-name 'std::iterator' without an argument list
629 | iterator erase_after(const_iterator position);
| ^~~~~~~~
p876.cpp:629:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:634:1: error: invalid use of template-name 'std::iterator' without an argument list
634 | iterator erase_after(const_iterator position, const_iterator last);
| ^~~~~~~~
p876.cpp:634:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:639:6: error: variable or field 'resize' declared void
639 | void resize(size_type sz);
| ^~~~~~
p876.cpp:639:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
639 | void resize(size_type sz);
| ^~~~~~~~~
| size_t
p876.cpp:642:6: error: variable or field 'resize' declared void
642 | void resize(size_type sz, const value_type& c);
| ^~~~~~
p876.cpp:642:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
642 | void resize(size_type sz, const value_type& c);
| ^~~~~~~~~
| size_t
p876.cpp:642:27: error: expected primary-expression before 'const'
642 | void resize(size_type sz, const value_type& c);
| ^~~~~
p876.cpp:645:14: error: expected initializer before 'noexcept'
645 | void clear() noexcept;
| ^~~~~~~~
p876.cpp:649:9: error: variable or field 'splice_after' declared void
649 | void splice_after(const_iterator position, forward_list& x);
| ^~~~~~~~~~~~
p876.cpp:649:22: error: 'const_iterator' was not declared in this scope
649 | void splice_after(const_iterator position, forward_list& x);
| ^~~~~~~~~~~~~~
p876.cpp:649:59: error: expected primary-expression before '&' token
649 | void splice_after(const_iterator position, forward_list& x);
| ^
p876.cpp:649:61: error: 'x' was not declared in this scope
649 | void splice_after(const_iterator position, forward_list& x);
| ^
p876.cpp:650:9: error: variable or field 'splice_after' declared void
650 | void splice_after(const_iterator position, forward_list&& x);
| ^~~~~~~~~~~~
p876.cpp:650:22: error: 'const_iterator' was not declared in this scope
650 | void splice_after(const_iterator position, forward_list&& x);
| ^~~~~~~~~~~~~~
p876.cpp:650:59: error: expected primary-expression before '&&' token
650 | void splice_after(const_iterator position, forward_list&& x);
| ^~
p876.cpp:650:62: error: 'x' was not declared in this scope
650 | void splice_after(const_iterator position, forward_list&& x);
| ^
p876.cpp:652:6: error: variable or field 'splice_after' declared void
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^~~~~~~~~~~~
p876.cpp:652:19: error: 'const_iterator' was not declared in this scope
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:652:56: error: expected primary-expression before '&' token
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^
p876.cpp:652:58: error: 'x' was not declared in this scope
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^
p876.cpp:652:61: error: 'const_iterator' was not declared in this scope
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:653:6: error: variable or field 'splice_after' declared void
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~~~~~~~~~~~
p876.cpp:653:19: error: 'const_iterator' was not declared in this scope
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:653:56: error: expected primary-expression before '&&' token
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~
p876.cpp:653:59: error: 'x' was not declared in this scope
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^
p876.cpp:653:62: error: 'const_iterator' was not declared in this scope
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:657:6: error: variable or field 'splice_after' declared void
657 | void splice_after(const_iterator position, forward_list& x,
| ^~~~~~~~~~~~
p876.cpp:657:19: error: 'const_iterator' was not declared in this scope
657 | void splice_after(const_iterator position, forward_list& x,
| ^~~~~~~~~~~~~~
p876.cpp:657:56: error: expected primary-expression before '&' token
657 | void splice_after(const_iterator position, forward_list& x,
| ^
p876.cpp:657:58: error: 'x' was not declared in this scope
657 | void splice_after(const_iterator position, forward_list& x,
| ^
p876.cpp:658:19: error: 'const_iterator' was not declared in this scope
658 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:658:41: error: 'const_iterator' was not declared in this scope
658 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:659:6: error: variable or field 'splice_after' declared void
659 | void splice_after(const_iterator position, forward_list&& x,
| ^~~~~~~~~~~~
p876.cpp:659:19: error: 'const_iterator' was not declared in this scope
659 | void splice_after(const_iterator position, forward_list&& x,
| ^~~~~~~~~~~~~~
p876.cpp:659:56: error: expected primary-expression before '&&' token
659 | void splice_after(const_iterator position, forward_list&& x,
| ^~
p876.cpp:659:59: error: 'x' was not declared in this scope
659 | void splice_after(const_iterator position, forward_list&& x,
| ^
p876.cpp:660:19: error: 'const_iterator' was not declared in this scope
660 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:660:41: error: 'const_iterator' was not declared in this scope
660 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:664:27: error: 'size_type' does not name a type; did you mean 'size_t'?
664 | template<class Predicate> size_type remove_if(Predicate pred);
| ^~~~~~~~~
| size_t
p876.cpp:668:1: error: 'size_type' does not name a type; did you mean 'size_t'?
668 | size_type unique();
| ^~~~~~~~~
| size_t
p876.cpp:669:33: error: 'size_type' does not name a type; did you mean 'size_t'?
669 | template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
| ^~~~~~~~~
| size_t
p876.cpp:670:1: error: 'Let' does not name a type
670 | Let binary_pred be equal_to<>{} for the first overload.
| ^~~
p876.cpp:670:33: error: expected unqualified-id before 'for'
670 | Let binary_pred be equal_to<>{} for the first overload.
| ^~~
p876.cpp:677:24: error: expected ',' or '...' before '&&' token
677 | void merge(forward_list&& x);
| ^~
p876.cpp:679:51: error: expected ',' or '...' before '&&' token
679 | template<class Compare> void merge(forward_list&& x, Compare comp);
| ^~
p876.cpp:682:1: error: expected unqualified-id before '==' token
682 | == x.get_allocator() is true.
| ^~
p876.cpp:690:16: error: expected initializer before 'noexcept'
690 | void reverse() noexcept;
| ^~~~~~~~
p876.cpp:695:12: error: expected nested-name-specifier before 'forward_list'
695 | typename forward_list<T, Allocator>::size_type
| ^~~~~~~~~~~~
p876.cpp:695:24: error: expected initializer before '<' token
695 | typename forward_list<T, Allocator>::size_type
| ^
p876.cpp:699:12: error: expected nested-name-specifier before 'forward_list'
699 | typename forward_list<T, Allocator>::size_type
| ^~~~~~~~~~~~
p876.cpp:699:24: error: expected initializer before '<' token
699 | typename forward_list<T, Allocator>::size_type
| ^
p876.cpp:707:50: error: spurious '>>', use '>' to terminate a template argument list
707 | template<class T, class Allocator = allocator<T>>
| ^~
p876.cpp:708:14: error: definition of 'class std::list' inside template parameter list
708 | class list {
| ^
p876.cpp:707:39: error: two or more data types in declaration of 'type name'
707 | template<class T, class Allocator = allocator<T>>
| ^~~~~~~~~~~~~
p876.cpp:804:2: error: expected '>' before ';' token
804 | };
| ^
p876.cpp:804:2: error: expected unqualified-id before ';' token
p876.cpp:805:7: error: expected constructor, destructor, or type conversion before '(' token
805 | resize(size_type sz);
| ^
p876.cpp:806:7: error: expected constructor, destructor, or type conversion before '(' token
806 | resize(size_type sz, const T& c);
| ^
p876.cpp:809:59: error: 'iter' was not declared in this scope
809 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
p876.cpp:809:64: error: 'value' was not declared in this scope
809 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~~
p876.cpp:809:70: error: 'type' was not declared in this scope; did you mean 'ctype'?
809 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
| ctype
p876.cpp:809:90: error: template argument 1 is invalid
809 | emplate<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^
p876.cpp:809:96: error: expected '>' before '(' token
809 | e<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^
p876.cpp:810:51: error: expected unqualified-id before ';' token
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:811:17: error: 'ranges' has not been declared
811 | template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
| ^~~~~~
p876.cpp:811:37: error: expected '>' before 'R'
811 | template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
| ^
p876.cpp:813:56: error: expected unqualified-id before ';' token
813 | -> list<ranges::range_value_t<R>, Allocator>;
| ^
p876.cpp:817:18: error: expected unqualified-id before 'const'
817 | explicit list(const Allocator&);
| ^~~~~
p876.cpp:817:18: error: expected ')' before 'const'
817 | explicit list(const Allocator&);
| ~^~~~~
| )
p876.cpp:818:24: error: expected ')' before 'n'
818 | explicit list(size_type n, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:821:15: error: expected ')' before 'n'
821 | list(size_type n, const T& value, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:825:21: error: expected ')' before 'first'
825 | list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ~ ^~~~~~
| )
p876.cpp:828:10: error: 'container' has not been declared
828 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:828:19: error: expected '>' before '-' token
828 | template<container-compatible-range<T> R>
| ^
p876.cpp:829:18: error: expected ')' before ',' token
829 | list(from_range_t, R&& rg, const Allocator& = Allocator());
| ~ ^
| )
p876.cpp:833:6: error: variable or field 'resize' declared void
833 | void resize(size_type sz);
| ^~~~~~
p876.cpp:833:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
833 | void resize(size_type sz);
| ^~~~~~~~~
| size_t
p876.cpp:836:7: error: expected constructor, destructor, or type conversion before ',' token
836 | size(), equivalent to:
| ^
p876.cpp:836:20: error: expected constructor, destructor, or type conversion before 'to'
836 | size(), equivalent to:
| ^~
p876.cpp:838:10: error: expected constructor, destructor, or type conversion before '(' token
838 | advance(it, sz);
| ^
p876.cpp:839:8: error: expected constructor, destructor, or type conversion before '(' token
839 | erase(it, end());
| ^
p876.cpp:840:6: error: variable or field 'resize' declared void
840 | void resize(size_type sz, const T& c);
| ^~~~~~
p876.cpp:840:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
840 | void resize(size_type sz, const T& c);
| ^~~~~~~~~
| size_t
p876.cpp:840:27: error: expected primary-expression before 'const'
840 | void resize(size_type sz, const T& c);
| ^~~~~
p876.cpp:842:3: error: expected unqualified-id before 'if'
842 | if (sz > size())
| ^~
p876.cpp:844:3: error: expected unqualified-id before 'else'
844 | else if (sz < size()) {
| ^~~~
p876.cpp:849:1: error: expected unqualified-id before 'else'
849 | else ;
| ^~~~
p876.cpp:852:1: error: invalid use of template-name 'std::iterator' without an argument list
852 | iterator insert(const_iterator position, const T& x);
| ^~~~~~~~
p876.cpp:852:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:853:1: error: invalid use of template-name 'std::iterator' without an argument list
853 | iterator insert(const_iterator position, T&& x);
| ^~~~~~~~
p876.cpp:853:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:854:1: error: invalid use of template-name 'std::iterator' without an argument list
854 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~
p876.cpp:854:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:856:3: error: invalid use of template-name 'std::iterator' without an argument list
856 | iterator insert(const_iterator position, InputIterator first,
| ^~~~~~~~
p876.cpp:856:3: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:858:10: error: 'container' has not been declared
858 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:858:19: error: expected '>' before '-' token
858 | template<container-compatible-range<T> R>
| ^
p876.cpp:859:1: error: invalid use of template-name 'std::iterator' without an argument list
859 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~
p876.cpp:859:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:860:1: error: invalid use of template-name 'std::iterator' without an argument list
860 | iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~
p876.cpp:860:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:861:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
861 | template<class... Args> reference emplace_front(Args&&... args);
| ^~~
p876.cpp:861:25: error: 'reference' does not name a type
861 | template<class... Args> reference emplace_front(Args&&... args);
| ^~~~~~~~~
p876.cpp:862:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
862 | template<class... Args> reference emplace_back(Args&&... args);
| ^~~
p876.cpp:862:25: error: 'reference' does not name a type
862 | template<class... Args> reference emplace_back(Args&&... args);
| ^~~~~~~~~
p876.cpp:863:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
863 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~
p876.cpp:863:25: error: invalid use of template-name 'std::iterator' without an argument list
863 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~~
p876.cpp:863:25: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:863:106: error: 'T' does not name a type
863 | ss... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^
p876.cpp:864:6: error: variable or field 'push_front' declared void
864 | void push_front(T&& x);
| ^~~~~~~~~~
p876.cpp:864:17: error: 'T' was not declared in this scope
864 | void push_front(T&& x);
| ^
p876.cpp:864:21: error: 'x' was not declared in this scope
864 | void push_front(T&& x);
| ^
p876.cpp:865:10: error: 'container' has not been declared
865 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:865:19: error: expected '>' before '-' token
865 | template<container-compatible-range<T> R>
| ^
p876.cpp:866:6: error: variable or field 'prepend_range' declared void
866 | void prepend_range(R&& rg);
| ^~~~~~~~~~~~~
p876.cpp:866:20: error: 'R' was not declared in this scope
866 | void prepend_range(R&& rg);
| ^
p876.cpp:866:24: error: 'rg' was not declared in this scope
866 | void prepend_range(R&& rg);
| ^~
p876.cpp:867:22: error: 'T' does not name a type
867 | void push_back(const T& x);
| ^
p876.cpp:868:6: error: variable or field 'push_back' declared void
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:868:16: error: 'T' was not declared in this scope
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^
p876.cpp:868:20: error: 'x' was not declared in this scope
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^
p876.cpp:868:33: error: 'container' has not been declared
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:868:42: error: expected '>' before '-' token
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^
p876.cpp:869:8: error: variable or field 'append_range' declared void
869 | void append_range(R&& rg);
| ^~~~~~~~~~~~
p876.cpp:869:21: error: 'R' was not declared in this scope
869 | void append_range(R&& rg);
| ^
p876.cpp:869:25: error: 'rg' was not declared in this scope
869 | void append_range(R&& rg);
| ^~
p876.cpp:874:9: error: variable or field 'splice' declared void
874 | void splice(const_iterator position, list& x);
| ^~~~~~
p876.cpp:874:16: error: 'const_iterator' was not declared in this scope
874 | void splice(const_iterator position, list& x);
| ^~~~~~~~~~~~~~
p876.cpp:874:45: error: expected primary-expression before '&' token
874 | void splice(const_iterator position, list& x);
| ^
p876.cpp:874:47: error: 'x' was not declared in this scope
874 | void splice(const_iterator position, list& x);
| ^
p876.cpp:875:1: error: invalid use of template-name 'std::iterator' without an argument list
875 | iterator erase(const_iterator position);
| ^~~~~~~~
p876.cpp:875:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:876:1: error: invalid use of template-name 'std::iterator' without an argument list
876 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~
p876.cpp:876:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++1'
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:879:14: error: expected initializer before 'noexcept'
879 | void clear() noexcept;
| ^~~~~~~~
p876.cpp:884:6: error: variable or field 'splice' declared void
884 | void splice(const_iterator position, list&& x);
| ^~~~~~
p876.cpp:884:13: error: 'const_iterator' was not declared in this scope
884 | void splice(const_iterator position, list&& x);
| ^~~~~~~~~~~~~~
p876.cpp:884:42: error: expected primary-expression before '&&' token
884 | void splice(const_iterator position, list&& x);
| ^~
p876.cpp:884:45: error: 'x' was not declared in this scope
884 | void splice(const_iterator position, list&& x);
| ^
p876.cpp:888:6: error: variable or field 'splice' declared void
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^~~~~~
p876.cpp:888:13: error: 'const_iterator' was not declared in this scope
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:888:42: error: expected primary-expression before '&' token
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^
p876.cpp:888:44: error: 'x' was not declared in this scope
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^
p876.cpp:888:47: error: 'const_iterator' was not declared in this scope
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:889:6: error: variable or field 'splice' declared void
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~~~~~
p876.cpp:889:13: error: 'const_iterator' was not declared in this scope
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:889:42: error: expected primary-expression before '&&' token
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~
p876.cpp:889:45: error: 'x' was not declared in this scope
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^
p876.cpp:889:48: error: 'const_iterator' was not declared in this scope
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:893:6: error: variable or field 'splice' declared void
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^~~~~~
p876.cpp:893:13: error: 'const_iterator' was not declared in this scope
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:893:42: error: expected primary-expression before '&' token
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^
p876.cpp:893:44: error: 'x' was not declared in this scope
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^
p876.cpp:893:47: error: 'const_iterator' was not declared in this scope
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:894:13: error: 'const_iterator' was not declared in this scope
894 | const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:895:6: error: variable or field 'splice' declared void
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~~~~~
p876.cpp:895:13: error: 'const_iterator' was not declared in this scope
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:895:42: error: expected primary-expression before '&&' token
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~
p876.cpp:895:45: error: 'x' was not declared in this scope
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^
p876.cpp:895:48: error: 'const_iterator' was not declared in this scope
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:896:13: error: 'const_iterator' was not declared in this scope
896 | const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:901:1: error: 'size_type' does not name a type; did you mean 'size_t'?
901 | size_type remove(const T& value);
| ^~~~~~~~~
| size_t
p876.cpp:902:27: error: 'size_type' does not name a type; did you mean 'size_t'?
902 | template<class Predicate> size_type remove_if(Predicate pred);
| ^~~~~~~~~
| size_t
p876.cpp:907:1: error: 'size_type' does not name a type; did you mean 'size_t'?
907 | size_type unique();
| ^~~~~~~~~
| size_t
p876.cpp:908:33: error: 'size_type' does not name a type; did you mean 'size_t'?
908 | template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
| ^~~~~~~~~
| size_t
p876.cpp:916:16: error: expected ',' or '...' before '&&' token
916 | void merge(list&& x);
| ^~
p876.cpp:918:40: error: expected ',' or '...' before '&&' token
918 | template<class Compare> void merge(list&& x, Compare comp);
| ^~
p876.cpp:924:16: error: expected initializer before 'noexcept'
924 | void reverse() noexcept;
| ^~~~~~~~
p876.cpp:933:12: error: expected nested-name-specifier before 'list'
933 | typename list<T, Allocator>::size_type
| ^~~~
p876.cpp:933:16: error: expected initializer before '<' token
933 | typename list<T, Allocator>::size_type
| ^
p876.cpp:937:12: error: expected nested-name-specifier before 'list'
937 | typename list<T, Allocator>::size_type
| ^~~~
p876.cpp:937:16: error: expected initializer before '<' token
937 | typename list<T, Allocator>::size_type
| ^
p876.cpp:946:55: error: spurious '>>', use '>' to terminate a template argument list
946 | template<class T, class Allocator = allocator<T>>
| ^~
p876.cpp:947:14: error: class template 'vector' redeclared as non-template
947 | class vector {
| ^~~~~~
In file included from /usr/local/include/c++/12.1.0/vector:64,
from N4910.h:8:
/usr/local/include/c++/12.1.0/bits/stl_vector.h:423:11: note: previous declaration here
423 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
p876.cpp:946:44: error: two or more data types in declaration of 'type name'
946 | template<class T, class Allocator = allocator<T>>
| ^~~~~~~~~~~~~
p876.cpp:1040:9: error: expected '>' before ';' token
1040 | };
| ^
p876.cpp:1040:9: error: expected unqualified-id before ';' token
p876.cpp:1041:59: error: 'iter' was not declared in this scope
1041 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
p876.cpp:1041:64: error: 'value' was not declared in this scope
1041 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~~
p876.cpp:1041:70: error: 'type' was not declared in this scope; did you mean 'ctype'?
1041 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
| ctype
p876.cpp:1041:90: error: template argument 1 is invalid
1041 | emplate<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^
p876.cpp:1041:92: error: expected '>' before 'vector'
1041 | plate<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~~~
p876.cpp:1042:53: error: expected unqualified-id before ';' token
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:1043:17: error: 'ranges' has not been declared
1043 | template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
| ^~~~~~
p876.cpp:1043:37: error: expected '>' before 'R'
1043 | template<ranges::input_range R, class Allocator = allocator<ranges::range_value_t<R>>>
| ^
p876.cpp:1045:58: error: expected unqualified-id before ';' token
1045 | -> vector<ranges::range_value_t<R>, Allocator>;
| ^
p876.cpp:1048:7: error: expected constructor, destructor, or type conversion before '(' token
1048 | resize(size_type sz);
| ^
p876.cpp:1049:7: error: expected constructor, destructor, or type conversion before '(' token
1049 | resize(size_type sz, const T& c);
| ^
p876.cpp:1050:8: error: expected constructor, destructor, or type conversion before '(' token
1050 | reserve(size_type n);
| ^
p876.cpp:1051:16: error: expected constructor, destructor, or type conversion before ';' token
1051 | shrink_to_fit();
| ^
p876.cpp:1052:11: error: expected constructor, destructor, or type conversion before '(' token
1052 | operator[](size_type n);
| ^
p876.cpp:1054:4: error: 'constexpr' does not name a type
1054 | constexpr explicit vector(const Allocator&) noexcept;
| ^~~~~~~~~
p876.cpp:1054:4: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1056:1: error: 'constexpr' does not name a type
1056 | constexpr explicit vector(size_type n, const Allocator& = Allocator());
| ^~~~~~~~~
p876.cpp:1056:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1059:1: error: 'constexpr' does not name a type
1059 | constexpr vector(size_type n, const T& value,
| ^~~~~~~~~
p876.cpp:1059:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1064:3: error: 'constexpr' does not name a type
1064 | constexpr vector(InputIterator first, InputIterator last,
| ^~~~~~~~~
p876.cpp:1064:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1068:10: error: 'container' has not been declared
1068 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:1068:19: error: expected '>' before '-' token
1068 | template<container-compatible-range<T> R>
| ^
p876.cpp:1069:1: error: 'constexpr' does not name a type
1069 | constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
| ^~~~~~~~~
p876.cpp:1069:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1073:1: error: 'constexpr' does not name a type
1073 | constexpr size_type capacity() const noexcept;
| ^~~~~~~~~
p876.cpp:1073:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1075:1: error: 'constexpr' does not name a type
1075 | constexpr void reserve(size_type n);
| ^~~~~~~~~
p876.cpp:1075:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1083:1: error: 'constexpr' does not name a type
1083 | constexpr void shrink_to_fit();
| ^~~~~~~~~
p876.cpp:1083:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1091:1: error: 'constexpr' does not name a type
1091 | constexpr void swap(vector& x)
| ^~~~~~~~~
p876.cpp:1091:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1096:1: error: 'constexpr' does not name a type
1096 | constexpr void resize(size_type sz);
| ^~~~~~~~~
p876.cpp:1096:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1100:1: error: 'T' does not name a type
1100 | T there are no effects.
| ^
p876.cpp:1104:1: error: 'sz' does not name a type
1104 | sz - size() copies of c to the sequence.
| ^~
p876.cpp:1110:14: error: expected constructor, destructor, or type conversion before 'noexcept'
1110 | data() const noexcept;
| ^~~~~~~~
p876.cpp:1114:1: error: 'constexpr' does not name a type
1114 | constexpr iterator insert(const_iterator position, const T& x);
| ^~~~~~~~~
p876.cpp:1114:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1115:1: error: 'constexpr' does not name a type
1115 | constexpr iterator insert(const_iterator position, T&& x);
| ^~~~~~~~~
p876.cpp:1115:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1116:1: error: 'constexpr' does not name a type
1116 | constexpr iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~
p876.cpp:1116:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1118:1: error: 'constexpr' does not name a type
1118 | constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:1118:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1118:103: error: 'container' has not been declared
1118 | ator insert(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:1118:112: error: expected '>' before '-' token
1118 | rt(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^
p876.cpp:1119:3: error: 'constexpr' does not name a type
1119 | constexpr iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~
p876.cpp:1119:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1120:1: error: 'constexpr' does not name a type
1120 | constexpr iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~~
p876.cpp:1120:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1121:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
1121 | template<class... Args> constexpr reference emplace_back(Args&&... args);
| ^~~
p876.cpp:1121:25: error: 'constexpr' does not name a type
1121 | template<class... Args> constexpr reference emplace_back(Args&&... args);
| ^~~~~~~~~
p876.cpp:1121:25: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1122:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
1122 | template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
| ^~~
p876.cpp:1122:25: error: 'constexpr' does not name a type
1122 | template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
| ^~~~~~~~~
p876.cpp:1122:25: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1123:1: error: 'constexpr' does not name a type
1123 | constexpr void push_back(const T& x);
| ^~~~~~~~~
p876.cpp:1123:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1124:1: error: 'constexpr' does not name a type
1124 | constexpr void push_back(T&& x);
| ^~~~~~~~~
p876.cpp:1124:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1128:10: error: 'container' has not been declared
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^~~~~~~~~
p876.cpp:1128:19: error: expected '>' before '-' token
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^
p876.cpp:1128:43: error: 'constexpr' does not name a type
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^~~~~~~~~
p876.cpp:1128:43: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1131:1: error: 'constexpr' does not name a type
1131 | constexpr iterator erase(const_iterator position);
| ^~~~~~~~~
p876.cpp:1131:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1132:1: error: 'constexpr' does not name a type
1132 | constexpr iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~~
p876.cpp:1132:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1133:1: error: 'constexpr' does not name a type
1133 | constexpr void pop_back();
| ^~~~~~~~~
p876.cpp:1133:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1136:3: error: 'constexpr' does not name a type
1136 | constexpr typename vector<T, Allocator>::size_type
| ^~~~~~~~~
p876.cpp:1136:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1139:4: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
1139 | auto it = remove(c.begin(), c.end(), value);
| ^~~~
| ----
p876.cpp:1139:9: error: 'it' does not name a type; did you mean 'int'?
1139 | auto it = remove(c.begin(), c.end(), value);
| ^~
| int
p876.cpp:1140:4: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
1140 | auto r = distance(it, c.end());
| ^~~~
| ----
p876.cpp:1140:9: error: 'r' does not name a type
1140 | auto r = distance(it, c.end());
| ^
p876.cpp:1141:4: error: 'c' does not name a type
1141 | c.erase(it, c.end());
| ^
p876.cpp:1142:4: error: expected unqualified-id before 'return'
1142 | return r;
| ^~~~~~
p876.cpp:1144:3: error: 'constexpr' does not name a type
1144 | constexpr typename vector<T, Allocator>::size_type
| ^~~~~~~~~
p876.cpp:1144:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1147:4: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
1147 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~~~
| ----
p876.cpp:1147:9: error: 'it' does not name a type; did you mean 'int'?
1147 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~
| int
p876.cpp:1148:4: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
1148 | auto r = distance(it, c.end());
| ^~~~
| ----
p876.cpp:1148:9: error: 'r' does not name a type
1148 | auto r = distance(it, c.end());
| ^
p876.cpp:1149:4: error: 'c' does not name a type
1149 | c.erase(it, c.end());
| ^
p876.cpp:1150:4: error: expected unqualified-id before 'return'
1150 | return r;
| ^~~~~~
p876.cpp:1155:9: error: redefinition of 'class std::vector<bool, _Alloc>'
1155 | class vector<bool, Allocator> {
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/12.1.0/vector:65:
/usr/local/include/c++/12.1.0/bits/stl_bvector.h:690:11: note: previous definition of 'class std::vector<bool, _Alloc>'
690 | class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
| ^~~~~~~~~~~~~~~~~~~~
p876.cpp:1260:4: error: 'constexpr' does not name a type
1260 | constexpr void flip() noexcept;
| ^~~~~~~~~
p876.cpp:1260:4: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1261:7: error: expected constructor, destructor, or type conversion before '(' token
1261 | resize(size_type sz, bool c = false);
| ^
p876.cpp:1262:8: error: expected constructor, destructor, or type conversion before '(' token
1262 | reserve(size_type n);
| ^
p876.cpp:1263:16: error: expected constructor, destructor, or type conversion before ';' token
1263 | shrink_to_fit();
| ^
p876.cpp:1264:1: error: 'constexpr' does not name a type
1264 | constexpr static void swap(reference x, reference y) noexcept;
| ^~~~~~~~~
p876.cpp:1264:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p876.cpp:1266:12: error: 'x' was not declared in this scope
1266 | bool b = x;
| ^
p876.cpp:1267:3: error: 'x' does not name a type
1267 | x = y;
| ^
p876.cpp:1268:3: error: 'y' does not name a type
1268 | y = b;
| ^
p876.cpp:1269:61: error: '>>' should be '> >' within a nested template argument list
1269 | template<class Allocator> struct hash<vector<bool, Allocator>>;
| ^~
| > >
$ g++ p876.cpp -std=2b -o p876g -I. -Wall
p876.cpp:469:48: error: too many decimal points in number
469 | requirements for an allocator-aware container (24.2.2.5). In addition, a forward_list provides the assign member functions and several of the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on forward_list that are not described in that table or for operations where there is additional semantic information.
| ^~~~~~~~
p876.cpp:469:185: error: too many decimal points in number
469 | he assign member functions and several of the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on forward_list that are not described in that table or for operations where there is additional semantic information.
| ^~~~~~
p876.cpp:17:11: error: expected '=' before '-' token
17 | using iter-value-type = typename iterator_traits<InputIterator>::value_type;
| ^
p876.cpp:17:11: error: expected type-specifier before '-' token
p876.cpp:26:11: error: 'synth' does not name a type
26 | constexpr synth-three-way-result<T>
| ^~~~~
p876.cpp:30:33: error: 'T' was not declared in this scope
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^
p876.cpp:30:36: error: 'N' was not declared in this scope
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^
p876.cpp:30:37: error: template argument 1 is invalid
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^
p876.cpp:30:37: error: template argument 2 is invalid
p876.cpp:30:49: error: 'T' was not declared in this scope
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^
p876.cpp:30:52: error: 'N' was not declared in this scope
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^
p876.cpp:30:53: error: template argument 1 is invalid
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^
p876.cpp:30:53: error: template argument 2 is invalid
p876.cpp:30:79: error: request for member 'swap' in 'x', which is of non-class type 'int'
30 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
| ^~~~
p876.cpp:32:35: error: 'T' was not declared in this scope
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^
p876.cpp:32:36: error: template argument 1 is invalid
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^
p876.cpp:32:39: error: 'N' was not declared in this scope
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^
p876.cpp:32:40: error: template argument 1 is invalid
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^
p876.cpp:32:40: error: template argument 2 is invalid
p876.cpp:32:55: error: 'a' was not declared in this scope
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^
p876.cpp:32:51: error: 'T' was not declared in this scope
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^
p876.cpp:32:58: error: 'N' was not declared in this scope
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^
p876.cpp:34:61: error: 'template<class T, long unsigned int N> constexpr std::array<typename std::remove_cv< <template-parameter-1-1> >::type, N> std::to_array(T (&&)[N])' redeclared as different kind of entity
34 | constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]);
| ^
p876.cpp:32:42: note: previous declaration 'constexpr const int std::to_array'
32 | constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]);
| ^~~~~~~~
p876.cpp:58:1: error: 'synth' does not name a type
58 | synth-three-way-result<T> operator<=>(const deque<T, Allocator>& x,
| ^~~~~
p876.cpp:83:1: error: 'synth' does not name a type
83 | synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x,
| ^~~~~
p876.cpp:108:1: error: 'synth' does not name a type
108 | synth-three-way-result<T> operator<=>(const list<T, Allocator>& x,
| ^~~~~
p876.cpp:129:19: error: redefinition of default argument for 'class Allocator'
129 | template<class T, class Allocator = allocator<T>> class vector;
| ^~~~~
In file included from /usr/local/include/c++/12.1.0/vector:64,
from N4910.h:8,
from p876.cpp:10:
/usr/local/include/c++/12.1.0/bits/stl_vector.h:422:26: note: original definition appeared here
422 | template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
| ^~~~~~~~
p876.cpp:133:11: error: 'synth' does not name a type
133 | constexpr synth-three-way-result<T> operator<=>(const vector<T, Allocator>& x,
| ^~~~~
p876.cpp:172:18: error: 'implementation' does not name a type
172 | using iterator = implementation-defined ; // see 24.2
| ^~~~~~~~~~~~~~
p876.cpp:173:24: error: 'implementation' does not name a type
173 | using const_iterator = implementation-defined ; // see 24.2
| ^~~~~~~~~~~~~~
p876.cpp:174:48: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
174 | using reverse_iterator = std::reverse_iterator<iterator>;
| ^~~~~~~~
In file included from /usr/local/include/c++/12.1.0/bits/stl_construct.h:61,
from /usr/local/include/c++/12.1.0/bits/char_traits.h:46,
from /usr/local/include/c++/12.1.0/ios:40,
from /usr/local/include/c++/12.1.0/ostream:38,
from /usr/local/include/c++/12.1.0/iostream:39,
from N4910.h:2:
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:174:56: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Iterator> class std::reverse_iterator'
174 | using reverse_iterator = std::reverse_iterator<iterator>;
| ^
p876.cpp:174:56: note: expected a type, got 'iterator'
p876.cpp:174:31: error: '<expression error>' in namespace 'std' does not name a type
174 | using reverse_iterator = std::reverse_iterator<iterator>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
p876.cpp:175:54: error: 'const_iterator' was not declared in this scope; did you mean 'move_iterator'?
175 | using const_reverse_iterator = std::reverse_iterator<const_iterator>;
| ^~~~~~~~~~~~~~
| move_iterator
p876.cpp:175:68: error: template argument 1 is invalid
175 | using const_reverse_iterator = std::reverse_iterator<const_iterator>;
| ^
p876.cpp:175:37: error: '<expression error>' in namespace 'std' does not name a type
175 | using const_reverse_iterator = std::reverse_iterator<const_iterator>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p876.cpp:180:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
180 | constexpr iterator
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:181:1: error: duplicate 'constexpr'
181 | constexpr const_iterator
| ^~~~~~~~~
| ---------
p876.cpp:180:11: error: invalid use of template-name 'std::iterator' without an argument list
180 | constexpr iterator
| ^~~~~~~~
p876.cpp:180:1: error: non-static data member 'const_iterator' declared 'constexpr'
180 | constexpr iterator
| ^~~~~~~~~
p876.cpp:181:11: error: expected ';' at end of member declaration
181 | constexpr const_iterator
| ^~~~~~~~~~~~~~
| ;
p876.cpp:182:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
182 | constexpr iterator
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:183:1: error: duplicate 'constexpr'
183 | constexpr const_iterator
| ^~~~~~~~~
| ---------
p876.cpp:182:11: error: invalid use of template-name 'std::iterator' without an argument list
182 | constexpr iterator
| ^~~~~~~~
p876.cpp:182:1: error: non-static data member 'const_iterator' declared 'constexpr'
182 | constexpr iterator
| ^~~~~~~~~
p876.cpp:183:11: error: expected ';' at end of member declaration
183 | constexpr const_iterator
| ^~~~~~~~~~~~~~
| ;
p876.cpp:185:1: error: duplicate 'constexpr'
185 | constexpr const_reverse_iterator rbegin() const noexcept;
| ^~~~~~~~~
| ---------
p876.cpp:184:11: error: invalid use of template-name 'std::reverse_iterator' without an argument list
184 | constexpr reverse_iterator
| ^~~~~~~~~~~~~~~~
p876.cpp:184:1: error: non-static data member 'const_reverse_iterator' declared 'constexpr'
184 | constexpr reverse_iterator
| ^~~~~~~~~
p876.cpp:185:11: error: expected ';' at end of member declaration
185 | constexpr const_reverse_iterator rbegin() const noexcept;
| ^~~~~~~~~~~~~~~~~~~~~~
| ;
p876.cpp:185:34: error: ISO C++ forbids declaration of 'rbegin' with no type [-fpermissive]
185 | constexpr const_reverse_iterator rbegin() const noexcept;
| ^~~~~~
p876.cpp:186:11: error: deduced class type 'reverse_iterator' in function return type
186 | constexpr reverse_iterator rend() noexcept;
| ^~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/12.1.0/string:47,
from /usr/local/include/c++/12.1.0/bits/locale_classes.h:40,
from /usr/local/include/c++/12.1.0/bits/ios_base.h:41,
from /usr/local/include/c++/12.1.0/ios:42:
/usr/local/include/c++/12.1.0/bits/stl_iterator.h:132:11: note: 'template<class _Iterator> class std::reverse_iterator' declared here
132 | class reverse_iterator
| ^~~~~~~~~~~~~~~~
p876.cpp:187:11: error: 'const_reverse_iterator' does not name a type; did you mean 'reverse_iterator'?
187 | constexpr const_reverse_iterator rend() const noexcept;
| ^~~~~~~~~~~~~~~~~~~~~~
| reverse_iterator
p876.cpp:188:11: error: 'const_iterator' does not name a type; did you mean 'move_iterator'?
188 | constexpr const_iterator cbegin() const noexcept;
| ^~~~~~~~~~~~~~
| move_iterator
p876.cpp:189:11: error: 'const_iterator' does not name a type; did you mean 'move_iterator'?
189 | constexpr const_iterator cend() const noexcept;
| ^~~~~~~~~~~~~~
| move_iterator
p876.cpp:190:11: error: 'const_reverse_iterator' does not name a type; did you mean 'reverse_iterator'?
190 | constexpr const_reverse_iterator crbegin() const noexcept;
| ^~~~~~~~~~~~~~~~~~~~~~
| reverse_iterator
p876.cpp:191:11: error: 'const_reverse_iterator' does not name a type; did you mean 'reverse_iterator'?
191 | constexpr const_reverse_iterator crend() const noexcept;
| ^~~~~~~~~~~~~~~~~~~~~~
| reverse_iterator
p876.cpp:199:1: error: ISO C++ forbids declaration of 'begin' with no type [-fpermissive]
199 | begin() noexcept;
| ^~~~~
p876.cpp:200:1: error: ISO C++ forbids declaration of 'begin' with no type [-fpermissive]
200 | begin() const noexcept;
| ^~~~~
p876.cpp:201:1: error: ISO C++ forbids declaration of 'end' with no type [-fpermissive]
201 | end() noexcept;
| ^~~
p876.cpp:202:1: error: ISO C++ forbids declaration of 'end' with no type [-fpermissive]
202 | end() const noexcept;
| ^~~
p876.cpp:203:1: error: ISO C++ forbids declaration of 'rbegin' with no type [-fpermissive]
203 | rbegin() noexcept;
| ^~~~~~
p876.cpp:219:6: error: deduction guide 'array(T, U ...)-> std::array<T, (1 + sizeof... (U))>' must be declared in the same scope as 'std::array<_Tp, _Nm>'
219 | array(T, U...) -> array<T, 1 + sizeof...(U)>;
| ^~~~~
p876.cpp:163:10: note: declared here
163 | struct array {
| ^~~~~
p876.cpp:222:11: error: 'size_type' does not name a type; did you mean 'size_t'?
222 | constexpr size_type size() const noexcept;
| ^~~~~~~~~
| size_t
p876.cpp:224:11: error: 'T' does not name a type
224 | constexpr T* data() noexcept;
| ^
p876.cpp:225:17: error: 'T' does not name a type
225 | constexpr const T* data() const noexcept;
| ^
p876.cpp:227:27: error: 'T' does not name a type
227 | constexpr void fill(const T& u);
| ^
p876.cpp:229:21: error: template placeholder type 'array<...auto...>' must be followed by a simple declarator-id
229 | constexpr void swap(array& y) noexcept(is_nothrow_swappable_v<T>);
| ^~~~~
In file included from /usr/local/include/c++/12.1.0/bits/stl_map.h:63,
from /usr/local/include/c++/12.1.0/map:61,
from N4910.h:10:
/usr/local/include/c++/12.1.0/tuple:1595:45: note: 'template<class _Tp, long unsigned int _Nm> struct std::array' declared here
1595 | template<typename _Tp, size_t _Nm> struct array;
| ^~~~~
p876.cpp:229:63: error: 'T' was not declared in this scope
229 | constexpr void swap(array& y) noexcept(is_nothrow_swappable_v<T>);
| ^
p876.cpp:229:40: error: template argument 1 is invalid
229 | constexpr void swap(array& y) noexcept(is_nothrow_swappable_v<T>);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
p876.cpp:274:26: error: redefinition of default argument for 'class Allocator'
274 | template<class T, class Allocator = allocator<T>>
| ^~~~~
p876.cpp:54:19: note: original definition appeared here
54 | template<class T, class Allocator = allocator<T>> class deque;
| ^~~~~
p876.cpp:380:59: error: 'iter' was not declared in this scope
380 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
p876.cpp:380:64: error: 'value' was not declared in this scope
380 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~~
p876.cpp:380:70: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
380 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
| std::__cmp_cat::type
In file included from /usr/local/include/c++/12.1.0/bits/char_traits.h:45:
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:380:88: error: template argument 1 is invalid
380 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> deque(InputIterator, InputIterator, Allocator = Allocator())
| ^~
p876.cpp:381:10: error: 'iter' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:381:15: error: 'value' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:381:21: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:381:39: error: template argument 1 is invalid
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:381:39: error: template argument 2 is invalid
p876.cpp:381:10: error: 'iter' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:381:15: error: 'value' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:381:21: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:381:39: error: template argument 1 is invalid
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:381:39: error: template argument 2 is invalid
p876.cpp:381:10: error: 'iter' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:381:15: error: 'value' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:381:21: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:381:39: error: template argument 1 is invalid
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:381:39: error: template argument 2 is invalid
p876.cpp:381:10: error: 'iter' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:381:15: error: 'value' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:381:21: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:381:39: error: template argument 1 is invalid
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:381:39: error: template argument 2 is invalid
p876.cpp:381:4: error: invalid template-id
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:381:10: error: 'iter' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:381:15: error: 'value' was not declared in this scope
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:381:21: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:381:39: error: expected primary-expression before '>' token
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:381:39: error: trailing return type 'deque<...auto...>' of deduction guide is not a specialization of 'std::deque<T, Allocator>'
p876.cpp:381:40: error: expected ';' before ',' token
381 | -> deque<iter-value-type<InputIterator>, Allocator>;
| ^
| ;
p876.cpp:383:25: error: expected ')' before ',' token
383 | deque(from_range_t, R&&, Allocator = Allocator())
| ~ ^
| )
p876.cpp:387:22: error: 'Allocator' does not name a type; did you mean 'alloca'?
387 | explicit deque(const Allocator&);
| ^~~~~~~~~
| alloca
p876.cpp:387:10: error: deduction guide for 'std::deque<T, Allocator>' must have trailing return type
387 | explicit deque(const Allocator&);
| ^~~~~
p876.cpp:54:57: note: 'template<class T, class Allocator> class std::deque' declared here
54 | template<class T, class Allocator = allocator<T>> class deque;
| ^~~~~
p876.cpp:388:25: error: expected ')' before 'n'
388 | explicit deque(size_type n, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:389:14: error: found ':' in nested-name-specifier, expected '::'
389 | Preconditions: T is Cpp17DefaultInsertable into *this.
| ^
| ::
p876.cpp:389:1: error: 'Preconditions' does not name a type
389 | Preconditions: T is Cpp17DefaultInsertable into *this.
| ^~~~~~~~~~~~~
p876.cpp:395:59: error: 'Allocator' does not name a type; did you mean 'alloca'?
395 | deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~~~~~
| alloca
p876.cpp:395:72: error: there are no arguments to 'Allocator' that depend on a template parameter, so a declaration of 'Allocator' must be available [-fpermissive]
395 | deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~~~~~
p876.cpp:395:72: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
p876.cpp:395:6: error: deduction guide for 'std::deque<T, Allocator>' must have trailing return type
395 | deque(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~
p876.cpp:54:57: note: 'template<class T, class Allocator> class std::deque' declared here
54 | template<class T, class Allocator = allocator<T>> class deque;
| ^~~~~
p876.cpp:397:10: error: 'container' has not been declared
397 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:397:19: error: expected '>' before '-' token
397 | template<container-compatible-range<T> R>
| ^
p876.cpp:398:19: error: expected ')' before ',' token
398 | deque(from_range_t, R&& rg, const Allocator& = Allocator());
| ~ ^
| )
p876.cpp:401:6: error: variable or field 'resize' declared void
401 | void resize(size_type sz);
| ^~~~~~
p876.cpp:401:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
401 | void resize(size_type sz);
| ^~~~~~~~~
| size_t
p876.cpp:404:1: error: 'sz' does not name a type
404 | sz - size() default-inserted elements to the sequence.
| ^~
p876.cpp:408:1: error: 'sz' does not name a type
408 | sz - size() copies of c to the sequence.
| ^~
p876.cpp:412:1: error: 'the' does not name a type
412 | the sequence.
| ^~~
p876.cpp:419:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
419 | iterator insert(const_iterator position, T&& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:419:17: error: 'const_iterator' was not declared in this scope
419 | iterator insert(const_iterator position, T&& x);
| ^~~~~~~~~~~~~~
p876.cpp:419:42: error: 'T' was not declared in this scope
419 | iterator insert(const_iterator position, T&& x);
| ^
p876.cpp:419:46: error: 'x' was not declared in this scope
419 | iterator insert(const_iterator position, T&& x);
| ^
p876.cpp:420:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
420 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:420:17: error: 'const_iterator' was not declared in this scope
420 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:420:42: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
420 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~
| size_t
p876.cpp:420:55: error: expected primary-expression before 'const'
420 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~
p876.cpp:422:3: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
422 | iterator insert(const_iterator position,
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:422:19: error: 'const_iterator' was not declared in this scope
422 | iterator insert(const_iterator position,
| ^~~~~~~~~~~~~~
p876.cpp:423:33: error: expected primary-expression before 'first'
423 | InputIterator first, InputIterator last);
| ^~~~~
p876.cpp:423:54: error: expected primary-expression before 'last'
423 | InputIterator first, InputIterator last);
| ^~~~
p876.cpp:424:10: error: 'container' has not been declared
424 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:424:19: error: expected '>' before '-' token
424 | template<container-compatible-range<T> R>
| ^
p876.cpp:425:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
425 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:425:23: error: 'const_iterator' was not declared in this scope
425 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~~~~~~
p876.cpp:425:48: error: 'R' was not declared in this scope
425 | iterator insert_range(const_iterator position, R&& rg);
| ^
p876.cpp:425:52: error: 'rg' was not declared in this scope
425 | iterator insert_range(const_iterator position, R&& rg);
| ^~
p876.cpp:426:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
426 | iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:426:17: error: 'const_iterator' was not declared in this scope
426 | iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~~~~~~~
p876.cpp:426:59: error: 'T' was not declared in this scope
426 | iterator insert(const_iterator position, initializer_list<T>);
| ^
p876.cpp:426:60: error: template argument 1 is invalid
426 | iterator insert(const_iterator position, initializer_list<T>);
| ^
p876.cpp:427:25: error: 'reference' does not name a type
427 | template<class... Args> reference emplace_front(Args&&... args);
| ^~~~~~~~~
p876.cpp:428:25: error: 'reference' does not name a type
428 | template<class... Args> reference emplace_back(Args&&... args);
| ^~~~~~~~~
p876.cpp:429:25: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
429 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:429:42: error: 'const_iterator' was not declared in this scope
429 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:429:71: error: expected primary-expression before '&&' token
429 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~
p876.cpp:429:106: error: 'T' does not name a type
429 | ss... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^
p876.cpp:430:6: error: variable or field 'push_front' declared void
430 | void push_front(T&& x);
| ^~~~~~~~~~
p876.cpp:430:17: error: 'T' was not declared in this scope
430 | void push_front(T&& x);
| ^
p876.cpp:430:21: error: 'x' was not declared in this scope
430 | void push_front(T&& x);
| ^
p876.cpp:431:10: error: 'container' has not been declared
431 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:431:19: error: expected '>' before '-' token
431 | template<container-compatible-range<T> R>
| ^
p876.cpp:432:8: error: variable or field 'prepend_range' declared void
432 | void prepend_range(R&& rg);
| ^~~~~~~~~~~~~
p876.cpp:432:22: error: 'R' was not declared in this scope
432 | void prepend_range(R&& rg);
| ^
p876.cpp:432:26: error: 'rg' was not declared in this scope
432 | void prepend_range(R&& rg);
| ^~
p876.cpp:433:22: error: 'T' does not name a type
433 | void push_back(const T& x);
| ^
p876.cpp:434:6: error: variable or field 'push_back' declared void
434 | void push_back(T&& x);
| ^~~~~~~~~
p876.cpp:434:16: error: 'T' was not declared in this scope
434 | void push_back(T&& x);
| ^
p876.cpp:434:20: error: 'x' was not declared in this scope
434 | void push_back(T&& x);
| ^
p876.cpp:435:10: error: 'container' has not been declared
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^~~~~~~~~
p876.cpp:435:19: error: expected '>' before '-' token
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^
p876.cpp:435:48: error: variable or field 'append_range' declared void
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^~~~~~~~~~~~
p876.cpp:435:61: error: 'R' was not declared in this scope
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^
p876.cpp:435:65: error: 'rg' was not declared in this scope
435 | template<container-compatible-range<T> R> void append_range(R&& rg);
| ^~
p876.cpp:438:8: error: found ':' in nested-name-specifier, expected '::'
438 | Remarks: If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move assignment operator of T there are no effects. If an exception is thrown while inserting a single element at either end, there are no effects. Otherwise, if an exception is thrown by the move constructor of a non-Cpp17CopyInsertable T, the effects are unspecified.
| ^
| ::
p876.cpp:438:1: error: 'Remarks' does not name a type
438 | Remarks: If an exception is thrown other than by the copy constructor, move constructor, assignment operator, or move assignment operator of T there are no effects. If an exception is thrown while inserting a single element at either end, there are no effects. Otherwise, if an exception is thrown by the move constructor of a non-Cpp17CopyInsertable T, the effects are unspecified.
| ^~~~~~~
p876.cpp:440:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
440 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:440:16: error: 'const_iterator' was not declared in this scope
440 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:440:38: error: 'const_iterator' was not declared in this scope
440 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:445:7: error: found ':' in nested-name-specifier, expected '::'
445 | Throws: Nothing unless an exception is thrown by the assignment operator of T.
| ^
| ::
p876.cpp:445:1: error: 'Throws' does not name a type
445 | Throws: Nothing unless an exception is thrown by the assignment operator of T.
| ^~~~~~
p876.cpp:452:21: error: 'c' was not declared in this scope
452 | auto it = remove(c.begin(), c.end(), value);
| ^
p876.cpp:452:32: error: 'c' was not declared in this scope
452 | auto it = remove(c.begin(), c.end(), value);
| ^
p876.cpp:452:41: error: 'value' was not declared in this scope
452 | auto it = remove(c.begin(), c.end(), value);
| ^~~~~
p876.cpp:453:26: error: 'c' was not declared in this scope
453 | auto r = distance(it, c.end());
| ^
p876.cpp:454:4: error: 'c' does not name a type
454 | c.erase(it, c.end());
| ^
p876.cpp:455:4: error: expected unqualified-id before 'return'
455 | return r;
| ^~~~~~
p876.cpp:460:28: error: 'c' was not declared in this scope
460 | auto it = remove_if(c.begin(), c.end(), pred);
| ^
p876.cpp:460:39: error: 'c' was not declared in this scope
460 | auto it = remove_if(c.begin(), c.end(), pred);
| ^
p876.cpp:460:48: error: 'pred' was not declared in this scope; did you mean 'pread'?
460 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~~~
| pread
p876.cpp:460:18: error: 'remove_if' was not declared in this scope; did you mean 'remove'?
460 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~~~~~~~~
| remove
p876.cpp:461:30: error: 'c' was not declared in this scope
461 | auto r = distance(it, c.end());
| ^
p876.cpp:462:8: error: 'c' does not name a type
462 | c.erase(it, c.end());
| ^
p876.cpp:463:8: error: expected unqualified-id before 'return'
463 | return r;
| ^~~~~~
p876.cpp:469:1: error: 'requirements' does not name a type
469 | requirements for an allocator-aware container (24.2.2.5). In addition, a forward_list provides the assign member functions and several of the optional sequence container requirements (24.2.4). Descriptions are provided here only for operations on forward_list that are not described in that table or for operations where there is additional semantic information.
| ^~~~~~~~~~~~
p876.cpp:566:32: error: 'Allocator' does not name a type; did you mean 'alloca'?
566 | explicit forward_list(const Allocator&);
| ^~~~~~~~~
| alloca
p876.cpp:566:13: error: deduction guide for 'std::forward_list<T, Allocator>' must have trailing return type
566 | explicit forward_list(const Allocator&);
| ^~~~~~~~~~~~
p876.cpp:79:57: note: 'template<class T, class Allocator> class std::forward_list' declared here
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^~~~~~~~~~~~
p876.cpp:567:32: error: expected ')' before 'n'
567 | explicit forward_list(size_type n, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:570:23: error: expected ')' before 'n'
570 | forward_list(size_type n, const T& value, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:574:63: error: 'Allocator' does not name a type; did you mean 'alloca'?
574 | forward_list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~~~~~
| alloca
p876.cpp:574:76: error: there are no arguments to 'Allocator' that depend on a template parameter, so a declaration of 'Allocator' must be available [-fpermissive]
574 | forward_list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~~~~~
p876.cpp:574:3: error: deduction guide for 'std::forward_list<T, Allocator>' must have trailing return type
574 | forward_list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~~~~~~~~
p876.cpp:79:57: note: 'template<class T, class Allocator> class std::forward_list' declared here
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^~~~~~~~~~~~
p876.cpp:576:10: error: 'container' has not been declared
576 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:576:19: error: expected '>' before '-' token
576 | template<container-compatible-range<T> R>
| ^
p876.cpp:577:26: error: expected ')' before ',' token
577 | forward_list(from_range_t, R&& rg, const Allocator& = Allocator());
| ~ ^
| )
p876.cpp:580:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
580 | iterator before_begin() noexcept;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:580:1: error: deduced class type 'iterator' in function return type
580 | iterator before_begin() noexcept;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:581:1: error: 'const_iterator' does not name a type
581 | const_iterator before_begin() const noexcept;
| ^~~~~~~~~~~~~~
p876.cpp:582:1: error: 'const_iterator' does not name a type
582 | const_iterator cbefore_begin() const noexcept;
| ^~~~~~~~~~~~~~
p876.cpp:587:1: error: 'reference' does not name a type
587 | reference front();
| ^~~~~~~~~
p876.cpp:588:1: error: 'const_reference' does not name a type
588 | const_reference front() const;
| ^~~~~~~~~~~~~~~
p876.cpp:589:1: error: 'Returns' does not name a type
589 | Returns: *begin()
| ^~~~~~~
p876.cpp:594:23: error: 'T' does not name a type
594 | void push_front(const T& x);
| ^
p876.cpp:595:6: error: variable or field 'push_front' declared void
595 | void push_front(T&& x);
| ^~~~~~~~~~
p876.cpp:595:17: error: 'T' was not declared in this scope
595 | void push_front(T&& x);
| ^
p876.cpp:595:21: error: 'x' was not declared in this scope
595 | void push_front(T&& x);
| ^
p876.cpp:597:6: error: variable or field 'prepend_range' declared void
597 | void prepend_range(R&& rg);
| ^~~~~~~~~~~~~
p876.cpp:597:20: error: 'R' was not declared in this scope
597 | void prepend_range(R&& rg);
| ^
p876.cpp:597:24: error: 'rg' was not declared in this scope; did you mean 'r'?
597 | void prepend_range(R&& rg);
| ^~
| r
p876.cpp:601:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
601 | iterator insert_after(const_iterator position, T&& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:601:23: error: 'const_iterator' was not declared in this scope
601 | iterator insert_after(const_iterator position, T&& x);
| ^~~~~~~~~~~~~~
p876.cpp:601:48: error: 'T' was not declared in this scope
601 | iterator insert_after(const_iterator position, T&& x);
| ^
p876.cpp:601:52: error: 'x' was not declared in this scope
601 | iterator insert_after(const_iterator position, T&& x);
| ^
p876.cpp:604:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
604 | iterator insert_after(const_iterator position, size_type n, const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:604:23: error: 'const_iterator' was not declared in this scope
604 | iterator insert_after(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:604:48: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
604 | iterator insert_after(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~
| size_t
p876.cpp:604:61: error: expected primary-expression before 'const'
604 | iterator insert_after(const_iterator position, size_type n, const T& x);
| ^~~~~
p876.cpp:609:3: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
609 | iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:609:25: error: 'const_iterator' was not declared in this scope
609 | iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
| ^~~~~~~~~~~~~~
p876.cpp:609:64: error: expected primary-expression before 'first'
609 | iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
| ^~~~~
p876.cpp:609:85: error: expected primary-expression before 'last'
609 | iterator insert_after(const_iterator position, InputIterator first, InputIterator last);
| ^~~~
p876.cpp:613:10: error: 'container' has not been declared
613 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:613:19: error: expected '>' before '-' token
613 | template<container-compatible-range<T> R>
| ^
p876.cpp:614:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
614 | iterator insert_range_after(const_iterator position, R&& rg);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:614:29: error: 'const_iterator' was not declared in this scope
614 | iterator insert_range_after(const_iterator position, R&& rg);
| ^~~~~~~~~~~~~~
p876.cpp:614:54: error: 'R' was not declared in this scope
614 | iterator insert_range_after(const_iterator position, R&& rg);
| ^
p876.cpp:614:58: error: 'rg' was not declared in this scope; did you mean 'r'?
614 | iterator insert_range_after(const_iterator position, R&& rg);
| ^~
| r
p876.cpp:618:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
618 | iterator insert_after(const_iterator position, initializer_list<T> il);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:618:23: error: 'const_iterator' was not declared in this scope
618 | iterator insert_after(const_iterator position, initializer_list<T> il);
| ^~~~~~~~~~~~~~
p876.cpp:618:65: error: 'T' was not declared in this scope
618 | iterator insert_after(const_iterator position, initializer_list<T> il);
| ^
p876.cpp:618:66: error: template argument 1 is invalid
618 | iterator insert_after(const_iterator position, initializer_list<T> il);
| ^
p876.cpp:622:8: error: found ':' in nested-name-specifier, expected '::'
622 | Effects: Inserts the contents of x after position, and x becomes empty. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into
| ^
| ::
p876.cpp:622:1: error: 'Effects' does not name a type
622 | Effects: Inserts the contents of x after position, and x becomes empty. Pointers and references to the moved elements of x now refer to those same elements but as members of *this. Iterators referring to the moved elements will continue to refer to their elements, but they now behave as iterators into
| ^~~~~~~
p876.cpp:629:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
629 | iterator erase_after(const_iterator position);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:629:22: error: 'const_iterator' was not declared in this scope
629 | iterator erase_after(const_iterator position);
| ^~~~~~~~~~~~~~
p876.cpp:634:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
634 | iterator erase_after(const_iterator position, const_iterator last);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:634:22: error: 'const_iterator' was not declared in this scope
634 | iterator erase_after(const_iterator position, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:634:47: error: 'const_iterator' was not declared in this scope
634 | iterator erase_after(const_iterator position, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:639:6: error: variable or field 'resize' declared void
639 | void resize(size_type sz);
| ^~~~~~
p876.cpp:639:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
639 | void resize(size_type sz);
| ^~~~~~~~~
| size_t
p876.cpp:642:6: error: variable or field 'resize' declared void
642 | void resize(size_type sz, const value_type& c);
| ^~~~~~
p876.cpp:642:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
642 | void resize(size_type sz, const value_type& c);
| ^~~~~~~~~
| size_t
p876.cpp:642:27: error: expected primary-expression before 'const'
642 | void resize(size_type sz, const value_type& c);
| ^~~~~
p876.cpp:649:9: error: variable or field 'splice_after' declared void
649 | void splice_after(const_iterator position, forward_list& x);
| ^~~~~~~~~~~~
p876.cpp:649:22: error: 'const_iterator' was not declared in this scope
649 | void splice_after(const_iterator position, forward_list& x);
| ^~~~~~~~~~~~~~
p876.cpp:649:59: error: missing template arguments before '&' token
649 | void splice_after(const_iterator position, forward_list& x);
| ^
p876.cpp:649:61: error: 'x' was not declared in this scope
649 | void splice_after(const_iterator position, forward_list& x);
| ^
p876.cpp:650:9: error: variable or field 'splice_after' declared void
650 | void splice_after(const_iterator position, forward_list&& x);
| ^~~~~~~~~~~~
p876.cpp:650:22: error: 'const_iterator' was not declared in this scope
650 | void splice_after(const_iterator position, forward_list&& x);
| ^~~~~~~~~~~~~~
p876.cpp:650:59: error: missing template arguments before '&&' token
650 | void splice_after(const_iterator position, forward_list&& x);
| ^~
p876.cpp:650:62: error: 'x' was not declared in this scope
650 | void splice_after(const_iterator position, forward_list&& x);
| ^
p876.cpp:652:6: error: variable or field 'splice_after' declared void
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^~~~~~~~~~~~
p876.cpp:652:19: error: 'const_iterator' was not declared in this scope
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:652:56: error: missing template arguments before '&' token
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^
p876.cpp:652:58: error: 'x' was not declared in this scope
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^
p876.cpp:652:61: error: 'const_iterator' was not declared in this scope
652 | void splice_after(const_iterator position, forward_list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:653:6: error: variable or field 'splice_after' declared void
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~~~~~~~~~~~
p876.cpp:653:19: error: 'const_iterator' was not declared in this scope
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:653:56: error: missing template arguments before '&&' token
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~
p876.cpp:653:59: error: 'x' was not declared in this scope
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^
p876.cpp:653:62: error: 'const_iterator' was not declared in this scope
653 | void splice_after(const_iterator position, forward_list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:657:6: error: variable or field 'splice_after' declared void
657 | void splice_after(const_iterator position, forward_list& x,
| ^~~~~~~~~~~~
p876.cpp:657:19: error: 'const_iterator' was not declared in this scope
657 | void splice_after(const_iterator position, forward_list& x,
| ^~~~~~~~~~~~~~
p876.cpp:657:56: error: missing template arguments before '&' token
657 | void splice_after(const_iterator position, forward_list& x,
| ^
p876.cpp:657:58: error: 'x' was not declared in this scope
657 | void splice_after(const_iterator position, forward_list& x,
| ^
p876.cpp:658:19: error: 'const_iterator' was not declared in this scope
658 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:658:41: error: 'const_iterator' was not declared in this scope
658 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:659:6: error: variable or field 'splice_after' declared void
659 | void splice_after(const_iterator position, forward_list&& x,
| ^~~~~~~~~~~~
p876.cpp:659:19: error: 'const_iterator' was not declared in this scope
659 | void splice_after(const_iterator position, forward_list&& x,
| ^~~~~~~~~~~~~~
p876.cpp:659:56: error: missing template arguments before '&&' token
659 | void splice_after(const_iterator position, forward_list&& x,
| ^~
p876.cpp:659:59: error: 'x' was not declared in this scope
659 | void splice_after(const_iterator position, forward_list&& x,
| ^
p876.cpp:660:19: error: 'const_iterator' was not declared in this scope
660 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:660:41: error: 'const_iterator' was not declared in this scope
660 | const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:664:27: error: 'size_type' does not name a type; did you mean 'size_t'?
664 | template<class Predicate> size_type remove_if(Predicate pred);
| ^~~~~~~~~
| size_t
p876.cpp:668:1: error: 'size_type' does not name a type; did you mean 'size_t'?
668 | size_type unique();
| ^~~~~~~~~
| size_t
p876.cpp:669:33: error: 'size_type' does not name a type; did you mean 'size_t'?
669 | template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
| ^~~~~~~~~
| size_t
p876.cpp:670:1: error: 'Let' does not name a type
670 | Let binary_pred be equal_to<>{} for the first overload.
| ^~~
p876.cpp:670:33: error: expected unqualified-id before 'for'
670 | Let binary_pred be equal_to<>{} for the first overload.
| ^~~
p876.cpp:677:12: error: template placeholder type 'forward_list<...auto...>' must be followed by a simple declarator-id
677 | void merge(forward_list&& x);
| ^~~~~~~~~~~~
p876.cpp:79:57: note: 'template<class T, class Allocator> class std::forward_list' declared here
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^~~~~~~~~~~~
p876.cpp:678:36: error: template placeholder type 'forward_list<...auto...>' must be followed by a simple declarator-id
678 | template<class Compare> void merge(forward_list& x, Compare comp);
| ^~~~~~~~~~~~
p876.cpp:79:57: note: 'template<class T, class Allocator> class std::forward_list' declared here
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^~~~~~~~~~~~
p876.cpp:678:51: error: expected ')' before ',' token
678 | template<class Compare> void merge(forward_list& x, Compare comp);
| ~ ^
| )
p876.cpp:678:51: error: expected ';' before ',' token
678 | template<class Compare> void merge(forward_list& x, Compare comp);
| ^
| ;
p876.cpp:679:39: error: template placeholder type 'forward_list<...auto...>' must be followed by a simple declarator-id
679 | template<class Compare> void merge(forward_list&& x, Compare comp);
| ^~~~~~~~~~~~
p876.cpp:79:57: note: 'template<class T, class Allocator> class std::forward_list' declared here
79 | template<class T, class Allocator = allocator<T>> class forward_list;
| ^~~~~~~~~~~~
p876.cpp:679:55: error: expected ')' before ',' token
679 | template<class Compare> void merge(forward_list&& x, Compare comp);
| ~ ^
| )
p876.cpp:679:55: error: expected ';' before ',' token
679 | template<class Compare> void merge(forward_list&& x, Compare comp);
| ^
| ;
p876.cpp:682:1: error: expected unqualified-id before '==' token
682 | == x.get_allocator() is true.
| ^~
p876.cpp:707:21: error: redefinition of default argument for 'class Allocator'
707 | template<class T, class Allocator = allocator<T>>
| ^~~~~
p876.cpp:104:19: note: original definition appeared here
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~~
p876.cpp:805:7: error: expected constructor, destructor, or type conversion before '(' token
805 | resize(size_type sz);
| ^
p876.cpp:806:7: error: expected constructor, destructor, or type conversion before '(' token
806 | resize(size_type sz, const T& c);
| ^
p876.cpp:809:59: error: 'iter' was not declared in this scope
809 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
p876.cpp:809:64: error: 'value' was not declared in this scope
809 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~~
p876.cpp:809:70: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
809 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:809:88: error: template argument 1 is invalid
809 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> list(InputIterator, InputIterator, Allocator = Allocator())
| ^~
p876.cpp:810:9: error: 'iter' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:810:14: error: 'value' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:810:20: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:810:38: error: template argument 1 is invalid
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:810:38: error: template argument 2 is invalid
p876.cpp:810:9: error: 'iter' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:810:14: error: 'value' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:810:20: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:810:38: error: template argument 1 is invalid
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:810:38: error: template argument 2 is invalid
p876.cpp:810:9: error: 'iter' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:810:14: error: 'value' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:810:20: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:810:38: error: template argument 1 is invalid
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:810:38: error: template argument 2 is invalid
p876.cpp:810:9: error: 'iter' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:810:14: error: 'value' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:810:20: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:810:38: error: template argument 1 is invalid
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:810:38: error: template argument 2 is invalid
p876.cpp:810:4: error: invalid template-id
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:810:9: error: 'iter' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:810:14: error: 'value' was not declared in this scope
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:810:20: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:810:38: error: expected primary-expression before '>' token
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:810:38: error: trailing return type 'list<...auto...>' of deduction guide is not a specialization of 'std::list<T, Allocator>'
p876.cpp:810:39: error: expected ';' before ',' token
810 | -> list<iter-value-type<InputIterator>, Allocator>;
| ^
| ;
p876.cpp:812:27: error: expected ')' before ',' token
812 | list(from_range_t, R&&, Allocator = Allocator())
| ~ ^
| )
p876.cpp:817:24: error: 'Allocator' does not name a type; did you mean 'alloca'?
817 | explicit list(const Allocator&);
| ^~~~~~~~~
| alloca
p876.cpp:817:13: error: deduction guide for 'std::list<T, Allocator>' must have trailing return type
817 | explicit list(const Allocator&);
| ^~~~
p876.cpp:104:57: note: 'template<class T, class Allocator> class std::list' declared here
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~
p876.cpp:818:24: error: expected ')' before 'n'
818 | explicit list(size_type n, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:821:15: error: expected ')' before 'n'
821 | list(size_type n, const T& value, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:825:55: error: 'Allocator' does not name a type; did you mean 'alloca'?
825 | list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~~~~~
| alloca
p876.cpp:825:68: error: there are no arguments to 'Allocator' that depend on a template parameter, so a declaration of 'Allocator' must be available [-fpermissive]
825 | list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~~~~~~
p876.cpp:825:3: error: deduction guide for 'std::list<T, Allocator>' must have trailing return type
825 | list(InputIterator first, InputIterator last, const Allocator& = Allocator());
| ^~~~
p876.cpp:104:57: note: 'template<class T, class Allocator> class std::list' declared here
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~
p876.cpp:828:10: error: 'container' has not been declared
828 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:828:19: error: expected '>' before '-' token
828 | template<container-compatible-range<T> R>
| ^
p876.cpp:829:18: error: expected ')' before ',' token
829 | list(from_range_t, R&& rg, const Allocator& = Allocator());
| ~ ^
| )
p876.cpp:833:6: error: variable or field 'resize' declared void
833 | void resize(size_type sz);
| ^~~~~~
p876.cpp:833:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
833 | void resize(size_type sz);
| ^~~~~~~~~
| size_t
p876.cpp:836:7: error: expected constructor, destructor, or type conversion before ',' token
836 | size(), equivalent to:
| ^
p876.cpp:836:20: error: expected constructor, destructor, or type conversion before 'to'
836 | size(), equivalent to:
| ^~
p876.cpp:838:10: error: expected constructor, destructor, or type conversion before '(' token
838 | advance(it, sz);
| ^
p876.cpp:839:8: error: expected constructor, destructor, or type conversion before '(' token
839 | erase(it, end());
| ^
p876.cpp:840:6: error: variable or field 'resize' declared void
840 | void resize(size_type sz, const T& c);
| ^~~~~~
p876.cpp:840:13: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
840 | void resize(size_type sz, const T& c);
| ^~~~~~~~~
| size_t
p876.cpp:840:27: error: expected primary-expression before 'const'
840 | void resize(size_type sz, const T& c);
| ^~~~~
p876.cpp:842:3: error: expected unqualified-id before 'if'
842 | if (sz > size())
| ^~
p876.cpp:844:3: error: expected unqualified-id before 'else'
844 | else if (sz < size()) {
| ^~~~
p876.cpp:849:1: error: expected unqualified-id before 'else'
849 | else ;
| ^~~~
p876.cpp:852:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
852 | iterator insert(const_iterator position, const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:852:17: error: 'const_iterator' was not declared in this scope
852 | iterator insert(const_iterator position, const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:852:42: error: expected primary-expression before 'const'
852 | iterator insert(const_iterator position, const T& x);
| ^~~~~
p876.cpp:853:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
853 | iterator insert(const_iterator position, T&& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:853:17: error: 'const_iterator' was not declared in this scope
853 | iterator insert(const_iterator position, T&& x);
| ^~~~~~~~~~~~~~
p876.cpp:853:42: error: 'T' was not declared in this scope
853 | iterator insert(const_iterator position, T&& x);
| ^
p876.cpp:853:46: error: 'x' was not declared in this scope
853 | iterator insert(const_iterator position, T&& x);
| ^
p876.cpp:854:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
854 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:854:17: error: 'const_iterator' was not declared in this scope
854 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:854:42: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
854 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~
| size_t
p876.cpp:854:55: error: expected primary-expression before 'const'
854 | iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~
p876.cpp:856:3: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
856 | iterator insert(const_iterator position, InputIterator first,
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:856:19: error: 'const_iterator' was not declared in this scope
856 | iterator insert(const_iterator position, InputIterator first,
| ^~~~~~~~~~~~~~
p876.cpp:856:58: error: expected primary-expression before 'first'
856 | iterator insert(const_iterator position, InputIterator first,
| ^~~~~
p876.cpp:857:33: error: expected primary-expression before 'last'
857 | InputIterator last);
| ^~~~
p876.cpp:858:10: error: 'container' has not been declared
858 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:858:19: error: expected '>' before '-' token
858 | template<container-compatible-range<T> R>
| ^
p876.cpp:859:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
859 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:859:10: error: redefinition of 'template<<typeprefixerror><anonymous> > iterator<...auto...> insert_range'
859 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~~~~
p876.cpp:425:10: note: 'template<<typeprefixerror><anonymous> > iterator<...auto...> insert_range<<expression error> >' previously declared here
425 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~~~~
p876.cpp:859:23: error: 'const_iterator' was not declared in this scope
859 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~~~~~~
p876.cpp:859:48: error: 'R' was not declared in this scope
859 | iterator insert_range(const_iterator position, R&& rg);
| ^
p876.cpp:859:52: error: 'rg' was not declared in this scope; did you mean 'r'?
859 | iterator insert_range(const_iterator position, R&& rg);
| ^~
| r
p876.cpp:860:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
860 | iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:860:17: error: 'const_iterator' was not declared in this scope
860 | iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~~~~~~~
p876.cpp:860:59: error: 'T' was not declared in this scope
860 | iterator insert(const_iterator position, initializer_list<T>);
| ^
p876.cpp:860:60: error: template argument 1 is invalid
860 | iterator insert(const_iterator position, initializer_list<T>);
| ^
p876.cpp:861:25: error: 'reference' does not name a type
861 | template<class... Args> reference emplace_front(Args&&... args);
| ^~~~~~~~~
p876.cpp:862:25: error: 'reference' does not name a type
862 | template<class... Args> reference emplace_back(Args&&... args);
| ^~~~~~~~~
p876.cpp:863:25: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
863 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:863:34: error: redefinition of 'template<class ... Args> iterator<...auto...> emplace'
863 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~
p876.cpp:429:34: note: 'template<class ... Args> iterator<...auto...> emplace<Args ...>' previously declared here
429 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~
p876.cpp:863:42: error: 'const_iterator' was not declared in this scope
863 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:863:71: error: expected primary-expression before '&&' token
863 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~
p876.cpp:863:106: error: 'T' does not name a type
863 | ss... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^
p876.cpp:864:6: error: variable or field 'push_front' declared void
864 | void push_front(T&& x);
| ^~~~~~~~~~
p876.cpp:864:17: error: 'T' was not declared in this scope
864 | void push_front(T&& x);
| ^
p876.cpp:864:21: error: 'x' was not declared in this scope
864 | void push_front(T&& x);
| ^
p876.cpp:865:10: error: 'container' has not been declared
865 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:865:19: error: expected '>' before '-' token
865 | template<container-compatible-range<T> R>
| ^
p876.cpp:866:6: error: variable or field 'prepend_range' declared void
866 | void prepend_range(R&& rg);
| ^~~~~~~~~~~~~
p876.cpp:866:20: error: 'R' was not declared in this scope
866 | void prepend_range(R&& rg);
| ^
p876.cpp:866:24: error: 'rg' was not declared in this scope; did you mean 'r'?
866 | void prepend_range(R&& rg);
| ^~
| r
p876.cpp:867:22: error: 'T' does not name a type
867 | void push_back(const T& x);
| ^
p876.cpp:868:6: error: variable or field 'push_back' declared void
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:868:16: error: 'T' was not declared in this scope
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^
p876.cpp:868:20: error: 'x' was not declared in this scope
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^
p876.cpp:868:33: error: 'container' has not been declared
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:868:42: error: expected '>' before '-' token
868 | void push_back(T&& x); template<container-compatible-range<T> R>
| ^
p876.cpp:869:8: error: variable or field 'append_range' declared void
869 | void append_range(R&& rg);
| ^~~~~~~~~~~~
p876.cpp:869:21: error: 'R' was not declared in this scope
869 | void append_range(R&& rg);
| ^
p876.cpp:869:25: error: 'rg' was not declared in this scope; did you mean 'r'?
869 | void append_range(R&& rg);
| ^~
| r
p876.cpp:874:9: error: variable or field 'splice' declared void
874 | void splice(const_iterator position, list& x);
| ^~~~~~
p876.cpp:874:16: error: 'const_iterator' was not declared in this scope
874 | void splice(const_iterator position, list& x);
| ^~~~~~~~~~~~~~
p876.cpp:874:45: error: missing template arguments before '&' token
874 | void splice(const_iterator position, list& x);
| ^
p876.cpp:874:47: error: 'x' was not declared in this scope
874 | void splice(const_iterator position, list& x);
| ^
p876.cpp:875:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
875 | iterator erase(const_iterator position);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:875:16: error: 'const_iterator' was not declared in this scope
875 | iterator erase(const_iterator position);
| ^~~~~~~~~~~~~~
p876.cpp:876:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
876 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:876:16: error: 'const_iterator' was not declared in this scope
876 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:876:38: error: 'const_iterator' was not declared in this scope
876 | iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:884:6: error: variable or field 'splice' declared void
884 | void splice(const_iterator position, list&& x);
| ^~~~~~
p876.cpp:884:13: error: 'const_iterator' was not declared in this scope
884 | void splice(const_iterator position, list&& x);
| ^~~~~~~~~~~~~~
p876.cpp:884:42: error: missing template arguments before '&&' token
884 | void splice(const_iterator position, list&& x);
| ^~
p876.cpp:884:45: error: 'x' was not declared in this scope
884 | void splice(const_iterator position, list&& x);
| ^
p876.cpp:888:6: error: variable or field 'splice' declared void
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^~~~~~
p876.cpp:888:13: error: 'const_iterator' was not declared in this scope
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:888:42: error: missing template arguments before '&' token
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^
p876.cpp:888:44: error: 'x' was not declared in this scope
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^
p876.cpp:888:47: error: 'const_iterator' was not declared in this scope
888 | void splice(const_iterator position, list& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:889:6: error: variable or field 'splice' declared void
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~~~~~
p876.cpp:889:13: error: 'const_iterator' was not declared in this scope
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:889:42: error: missing template arguments before '&&' token
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~
p876.cpp:889:45: error: 'x' was not declared in this scope
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^
p876.cpp:889:48: error: 'const_iterator' was not declared in this scope
889 | void splice(const_iterator position, list&& x, const_iterator i);
| ^~~~~~~~~~~~~~
p876.cpp:893:6: error: variable or field 'splice' declared void
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^~~~~~
p876.cpp:893:13: error: 'const_iterator' was not declared in this scope
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:893:42: error: missing template arguments before '&' token
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^
p876.cpp:893:44: error: 'x' was not declared in this scope
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^
p876.cpp:893:47: error: 'const_iterator' was not declared in this scope
893 | void splice(const_iterator position, list& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:894:13: error: 'const_iterator' was not declared in this scope
894 | const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:895:6: error: variable or field 'splice' declared void
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~~~~~
p876.cpp:895:13: error: 'const_iterator' was not declared in this scope
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:895:42: error: missing template arguments before '&&' token
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~
p876.cpp:895:45: error: 'x' was not declared in this scope
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^
p876.cpp:895:48: error: 'const_iterator' was not declared in this scope
895 | void splice(const_iterator position, list&& x, const_iterator first,
| ^~~~~~~~~~~~~~
p876.cpp:896:13: error: 'const_iterator' was not declared in this scope
896 | const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:901:1: error: 'size_type' does not name a type; did you mean 'size_t'?
901 | size_type remove(const T& value);
| ^~~~~~~~~
| size_t
p876.cpp:902:27: error: 'size_type' does not name a type; did you mean 'size_t'?
902 | template<class Predicate> size_type remove_if(Predicate pred);
| ^~~~~~~~~
| size_t
p876.cpp:907:1: error: 'size_type' does not name a type; did you mean 'size_t'?
907 | size_type unique();
| ^~~~~~~~~
| size_t
p876.cpp:908:33: error: 'size_type' does not name a type; did you mean 'size_t'?
908 | template<class BinaryPredicate> size_type unique(BinaryPredicate binary_pred);
| ^~~~~~~~~
| size_t
p876.cpp:915:12: error: template placeholder type 'list<...auto...>' must be followed by a simple declarator-id
915 | void merge(list& x);
| ^~~~
p876.cpp:104:57: note: 'template<class T, class Allocator> class std::list' declared here
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~
p876.cpp:916:12: error: template placeholder type 'list<...auto...>' must be followed by a simple declarator-id
916 | void merge(list&& x);
| ^~~~
p876.cpp:104:57: note: 'template<class T, class Allocator> class std::list' declared here
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~
p876.cpp:917:36: error: template placeholder type 'list<...auto...>' must be followed by a simple declarator-id
917 | template<class Compare> void merge(list& x, Compare comp);
| ^~~~
p876.cpp:104:57: note: 'template<class T, class Allocator> class std::list' declared here
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~
p876.cpp:917:43: error: expected ')' before ',' token
917 | template<class Compare> void merge(list& x, Compare comp);
| ~ ^
| )
p876.cpp:917:43: error: expected ';' before ',' token
917 | template<class Compare> void merge(list& x, Compare comp);
| ^
| ;
p876.cpp:918:36: error: template placeholder type 'list<...auto...>' must be followed by a simple declarator-id
918 | template<class Compare> void merge(list&& x, Compare comp);
| ^~~~
p876.cpp:104:57: note: 'template<class T, class Allocator> class std::list' declared here
104 | template<class T, class Allocator = allocator<T>> class list;
| ^~~~
p876.cpp:918:44: error: expected ')' before ',' token
918 | template<class Compare> void merge(list&& x, Compare comp);
| ~ ^
| )
p876.cpp:918:44: error: expected ';' before ',' token
918 | template<class Compare> void merge(list&& x, Compare comp);
| ^
| ;
p876.cpp:946:26: error: redefinition of default argument for 'class Allocator'
946 | template<class T, class Allocator = allocator<T>>
| ^~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:422:26: note: original definition appeared here
422 | template<typename _Tp, typename _Alloc = std::allocator<_Tp> >
| ^~~~~~~~
p876.cpp:1041:59: error: 'iter' was not declared in this scope
1041 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
p876.cpp:1041:64: error: 'value' was not declared in this scope
1041 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~~
p876.cpp:1041:70: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
1041 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:1041:88: error: template argument 1 is invalid
1041 | template<class InputIterator, class Allocator = allocator<iter-value-type<InputIterator>>> vector(InputIterator, InputIterator, Allocator = Allocator())
| ^~
p876.cpp:1042:11: error: 'iter' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:1042:16: error: 'value' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:1042:22: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:1042:40: error: template argument 1 is invalid
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:1042:40: error: template argument 2 is invalid
p876.cpp:1042:11: error: 'iter' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:1042:16: error: 'value' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:1042:22: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:1042:40: error: template argument 1 is invalid
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:1042:40: error: template argument 2 is invalid
p876.cpp:1042:11: error: 'iter' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:1042:16: error: 'value' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:1042:22: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:1042:40: error: template argument 1 is invalid
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:1042:40: error: template argument 2 is invalid
p876.cpp:1042:11: error: 'iter' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:1042:16: error: 'value' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:1042:22: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:1042:40: error: template argument 1 is invalid
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:1042:40: error: template argument 2 is invalid
p876.cpp:1042:4: error: invalid template-id
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~~~
p876.cpp:1042:11: error: 'iter' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
p876.cpp:1042:16: error: 'value' was not declared in this scope
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~~
p876.cpp:1042:22: error: 'type' was not declared in this scope; did you mean 'std::__cmp_cat::type'?
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^~~~
| std::__cmp_cat::type
/usr/local/include/c++/12.1.0/compare:51:11: note: 'std::__cmp_cat::type' declared here
51 | using type = signed char;
| ^~~~
p876.cpp:1042:40: error: expected primary-expression before '>' token
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^
p876.cpp:1042:40: error: trailing return type 'vector<...auto...>' of deduction guide is not a specialization of 'std::vector<_Tp, _Alloc>'
p876.cpp:1042:41: error: expected ';' before ',' token
1042 | -> vector<iter-value-type<InputIterator>, Allocator>;
| ^
| ;
p876.cpp:1044:29: error: expected ')' before ',' token
1044 | vector(from_range_t, R&&, Allocator = Allocator())
| ~ ^
| )
p876.cpp:1048:7: error: expected constructor, destructor, or type conversion before '(' token
1048 | resize(size_type sz);
| ^
p876.cpp:1049:7: error: expected constructor, destructor, or type conversion before '(' token
1049 | resize(size_type sz, const T& c);
| ^
p876.cpp:1050:8: error: expected constructor, destructor, or type conversion before '(' token
1050 | reserve(size_type n);
| ^
p876.cpp:1051:16: error: expected constructor, destructor, or type conversion before ';' token
1051 | shrink_to_fit();
| ^
p876.cpp:1052:11: error: expected constructor, destructor, or type conversion before '(' token
1052 | operator[](size_type n);
| ^
p876.cpp:1054:36: error: 'Allocator' does not name a type; did you mean 'alloca'?
1054 | constexpr explicit vector(const Allocator&) noexcept;
| ^~~~~~~~~
| alloca
p876.cpp:1054:4: error: 'decl-specifier' in declaration of deduction guide
1054 | constexpr explicit vector(const Allocator&) noexcept;
| ^~~~~~~~~
p876.cpp:1054:23: error: deduction guide for 'std::vector<_Tp, _Alloc>' must have trailing return type
1054 | constexpr explicit vector(const Allocator&) noexcept;
| ^~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:423:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
423 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
p876.cpp:1056:36: error: expected ')' before 'n'
1056 | constexpr explicit vector(size_type n, const Allocator& = Allocator());
| ~ ^~
| )
p876.cpp:1059:27: error: expected ')' before 'n'
1059 | constexpr vector(size_type n, const T& value,
| ~ ^~
| )
p876.cpp:1065:21: error: 'Allocator' does not name a type; did you mean 'alloca'?
1065 | const Allocator& = Allocator());
| ^~~~~~~~~
| alloca
p876.cpp:1065:34: error: there are no arguments to 'Allocator' that depend on a template parameter, so a declaration of 'Allocator' must be available [-fpermissive]
1065 | const Allocator& = Allocator());
| ^~~~~~~~~
p876.cpp:1064:3: error: 'decl-specifier' in declaration of deduction guide
1064 | constexpr vector(InputIterator first, InputIterator last,
| ^~~~~~~~~
p876.cpp:1064:13: error: deduction guide for 'std::vector<_Tp, _Alloc>' must have trailing return type
1064 | constexpr vector(InputIterator first, InputIterator last,
| ^~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:423:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
423 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
p876.cpp:1068:10: error: 'container' has not been declared
1068 | template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:1068:19: error: expected '>' before '-' token
1068 | template<container-compatible-range<T> R>
| ^
p876.cpp:1069:30: error: expected ')' before ',' token
1069 | constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator());
| ~ ^
| )
p876.cpp:1073:11: error: 'size_type' does not name a type; did you mean 'size_t'?
1073 | constexpr size_type capacity() const noexcept;
| ^~~~~~~~~
| size_t
p876.cpp:1075:16: error: variable or field 'reserve' declared void
1075 | constexpr void reserve(size_type n);
| ^~~~~~~
p876.cpp:1075:24: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
1075 | constexpr void reserve(size_type n);
| ^~~~~~~~~
| size_t
p876.cpp:1091:21: error: template placeholder type 'vector<...auto...>' must be followed by a simple declarator-id
1091 | constexpr void swap(vector& x)
| ^~~~~~
/usr/local/include/c++/12.1.0/bits/stl_vector.h:423:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
423 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
p876.cpp:1092:29: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
1092 | noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
| ^~~~~~~~~
| alloca
p876.cpp:1092:38: error: template argument 1 is invalid
1092 | noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
| ^
p876.cpp:1092:41: error: '<expression error>::propagate_on_container_swap' has not been declared
1092 | noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
p876.cpp:1093:24: error: 'Allocator' was not declared in this scope; did you mean 'alloca'?
1093 | allocator_traits<Allocator>::is_always_equal::value);
| ^~~~~~~~~
| alloca
p876.cpp:1093:33: error: template argument 1 is invalid
1093 | allocator_traits<Allocator>::is_always_equal::value);
| ^
p876.cpp:1093:36: error: '<expression error>::is_always_equal' has not been declared
1093 | allocator_traits<Allocator>::is_always_equal::value);
| ^~~~~~~~~~~~~~~
p876.cpp:1096:16: error: variable or field 'resize' declared void
1096 | constexpr void resize(size_type sz);
| ^~~~~~
p876.cpp:1096:23: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
1096 | constexpr void resize(size_type sz);
| ^~~~~~~~~
| size_t
p876.cpp:1100:1: error: 'T' does not name a type
1100 | T there are no effects.
| ^
p876.cpp:1104:1: error: 'sz' does not name a type
1104 | sz - size() copies of c to the sequence.
| ^~
p876.cpp:1110:22: error: expected constructor, destructor, or type conversion before ';' token
1110 | data() const noexcept;
| ^
p876.cpp:1114:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1114 | constexpr iterator insert(const_iterator position, const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1114:27: error: 'const_iterator' was not declared in this scope
1114 | constexpr iterator insert(const_iterator position, const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:1114:52: error: expected primary-expression before 'const'
1114 | constexpr iterator insert(const_iterator position, const T& x);
| ^~~~~
p876.cpp:1115:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1115 | constexpr iterator insert(const_iterator position, T&& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1115:27: error: 'const_iterator' was not declared in this scope
1115 | constexpr iterator insert(const_iterator position, T&& x);
| ^~~~~~~~~~~~~~
p876.cpp:1115:52: error: 'T' was not declared in this scope
1115 | constexpr iterator insert(const_iterator position, T&& x);
| ^
p876.cpp:1115:56: error: 'x' was not declared in this scope
1115 | constexpr iterator insert(const_iterator position, T&& x);
| ^
p876.cpp:1116:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1116 | constexpr iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1116:27: error: 'const_iterator' was not declared in this scope
1116 | constexpr iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~~~~~~
p876.cpp:1116:52: error: 'size_type' was not declared in this scope; did you mean 'size_t'?
1116 | constexpr iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~~~~~
| size_t
p876.cpp:1116:65: error: expected primary-expression before 'const'
1116 | constexpr iterator insert(const_iterator position, size_type n, const T& x);
| ^~~~~
p876.cpp:1118:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1118 | constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1118:27: error: 'const_iterator' was not declared in this scope
1118 | constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^~~~~~~~~~~~~~
p876.cpp:1118:66: error: expected primary-expression before 'first'
1118 | constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^~~~~
p876.cpp:1118:87: error: expected primary-expression before 'last'
1118 | constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^~~~
p876.cpp:1118:103: error: 'container' has not been declared
1118 | ator insert(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^~~~~~~~~
p876.cpp:1118:112: error: expected '>' before '-' token
1118 | rt(const_iterator position, InputIterator first, InputIterator last); template<container-compatible-range<T> R>
| ^
p876.cpp:1119:13: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1119 | constexpr iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1119:35: error: redeclaration of 'template<<typeprefixerror><anonymous> > constexpr const iterator<...auto...> insert_range'
1119 | constexpr iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~~~~~~
p876.cpp:425:10: note: previous declaration 'template<<typeprefixerror><anonymous> > iterator<...auto...> insert_range<<expression error> >'
425 | iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~~~~
p876.cpp:1119:35: error: 'const_iterator' was not declared in this scope
1119 | constexpr iterator insert_range(const_iterator position, R&& rg);
| ^~~~~~~~~~~~~~
p876.cpp:1119:60: error: 'R' was not declared in this scope
1119 | constexpr iterator insert_range(const_iterator position, R&& rg);
| ^
p876.cpp:1119:64: error: 'rg' was not declared in this scope; did you mean 'r'?
1119 | constexpr iterator insert_range(const_iterator position, R&& rg);
| ^~
| r
p876.cpp:1120:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1120 | constexpr iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1120:27: error: 'const_iterator' was not declared in this scope
1120 | constexpr iterator insert(const_iterator position, initializer_list<T>);
| ^~~~~~~~~~~~~~
p876.cpp:1120:69: error: 'T' was not declared in this scope
1120 | constexpr iterator insert(const_iterator position, initializer_list<T>);
| ^
p876.cpp:1120:70: error: template argument 1 is invalid
1120 | constexpr iterator insert(const_iterator position, initializer_list<T>);
| ^
p876.cpp:1121:35: error: 'reference' does not name a type
1121 | template<class... Args> constexpr reference emplace_back(Args&&... args);
| ^~~~~~~~~
p876.cpp:1122:35: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1122 | template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1122:52: error: redeclaration of 'template<class ... Args> constexpr const iterator<...auto...> emplace'
1122 | template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
| ^~~~~~~~~~~~~~
p876.cpp:429:34: note: previous declaration 'template<class ... Args> iterator<...auto...> emplace<Args ...'
429 | template<class... Args> iterator emplace(const_iterator position, Args&&... args); void push_front(const T& x);
| ^~~~~~~
p876.cpp:1122:52: error: 'const_iterator' was not declared in this scope
1122 | template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
| ^~~~~~~~~~~~~~
p876.cpp:1122:81: error: expected primary-expression before '&&' token
1122 | template<class... Args> constexpr iterator emplace(const_iterator position, Args&&... args);
| ^~
p876.cpp:1123:32: error: 'T' does not name a type
1123 | constexpr void push_back(const T& x);
| ^
p876.cpp:1123:16: error: redeclaration 'constexpr void push_back(const int&)' differs in 'constexpr' from previous declaration
1123 | constexpr void push_back(const T& x);
| ^~~~~~~~~
p876.cpp:867:6: note: previous declaration 'void push_back(const int&)'
867 | void push_back(const T& x);
| ^~~~~~~~~
p876.cpp:1124:16: error: variable or field 'push_back' declared void
1124 | constexpr void push_back(T&& x);
| ^~~~~~~~~
p876.cpp:1124:26: error: 'T' was not declared in this scope
1124 | constexpr void push_back(T&& x);
| ^
p876.cpp:1124:30: error: 'x' was not declared in this scope
1124 | constexpr void push_back(T&& x);
| ^
p876.cpp:1128:10: error: 'container' has not been declared
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^~~~~~~~~
p876.cpp:1128:19: error: expected '>' before '-' token
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^
p876.cpp:1128:58: error: variable or field 'append_range' declared void
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^~~~~~~~~~~~
p876.cpp:1128:71: error: 'R' was not declared in this scope
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^
p876.cpp:1128:75: error: 'rg' was not declared in this scope; did you mean 'r'?
1128 | template<container-compatible-range<T> R> constexpr void append_range(R&& rg);
| ^~
| r
p876.cpp:1131:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1131 | constexpr iterator erase(const_iterator position);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1131:26: error: 'const_iterator' was not declared in this scope
1131 | constexpr iterator erase(const_iterator position);
| ^~~~~~~~~~~~~~
p876.cpp:1132:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
1132 | constexpr iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p876.cpp:1132:26: error: 'const_iterator' was not declared in this scope
1132 | constexpr iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:1132:48: error: 'const_iterator' was not declared in this scope
1132 | constexpr iterator erase(const_iterator first, const_iterator last);
| ^~~~~~~~~~~~~~
p876.cpp:1133:16: error: redeclaration 'constexpr void pop_back()' differs in 'constexpr' from previous declaration
1133 | constexpr void pop_back();
| ^~~~~~~~
p876.cpp:878:6: note: previous declaration 'void pop_back()'
878 | void pop_back();
| ^~~~~~~~
p876.cpp:1139:21: error: 'c' was not declared in this scope
1139 | auto it = remove(c.begin(), c.end(), value);
| ^
p876.cpp:1139:32: error: 'c' was not declared in this scope
1139 | auto it = remove(c.begin(), c.end(), value);
| ^
p876.cpp:1139:41: error: 'value' was not declared in this scope
1139 | auto it = remove(c.begin(), c.end(), value);
| ^~~~~
p876.cpp:1140:26: error: 'c' was not declared in this scope
1140 | auto r = distance(it, c.end());
| ^
p876.cpp:1141:4: error: 'c' does not name a type
1141 | c.erase(it, c.end());
| ^
p876.cpp:1142:4: error: expected unqualified-id before 'return'
1142 | return r;
| ^~~~~~
p876.cpp:1147:24: error: 'c' was not declared in this scope
1147 | auto it = remove_if(c.begin(), c.end(), pred);
| ^
p876.cpp:1147:35: error: 'c' was not declared in this scope
1147 | auto it = remove_if(c.begin(), c.end(), pred);
| ^
p876.cpp:1147:44: error: 'pred' was not declared in this scope; did you mean 'pread'?
1147 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~~~
| pread
p876.cpp:1147:14: error: 'remove_if' was not declared in this scope; did you mean 'remove'?
1147 | auto it = remove_if(c.begin(), c.end(), pred);
| ^~~~~~~~~
| remove
p876.cpp:1148:26: error: 'c' was not declared in this scope
1148 | auto r = distance(it, c.end());
| ^
p876.cpp:1149:4: error: 'c' does not name a type
1149 | c.erase(it, c.end());
| ^
p876.cpp:1150:4: error: expected unqualified-id before 'return'
1150 | return r;
| ^~~~~~
p876.cpp:1155:9: error: redefinition of 'class std::vector<bool, _Alloc>'
1155 | class vector<bool, Allocator> {
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/12.1.0/vector:65:
/usr/local/include/c++/12.1.0/bits/stl_bvector.h:690:11: note: previous definition of 'class std::vector<bool, _Alloc>'
690 | class vector<bool, _Alloc> : protected _Bvector_base<_Alloc>
| ^~~~~~~~~~~~~~~~~~~~
p876.cpp:1261:7: error: expected constructor, destructor, or type conversion before '(' token
1261 | resize(size_type sz, bool c = false);
| ^
p876.cpp:1262:8: error: expected constructor, destructor, or type conversion before '(' token
1262 | reserve(size_type n);
| ^
p876.cpp:1263:16: error: expected constructor, destructor, or type conversion before ';' token
1263 | shrink_to_fit();
| ^
p876.cpp:1264:23: error: variable or field 'swap' declared void
1264 | constexpr static void swap(reference x, reference y) noexcept;
| ^~~~
p876.cpp:1264:28: error: 'reference' was not declared in this scope
1264 | constexpr static void swap(reference x, reference y) noexcept;
| ^~~~~~~~~
p876.cpp:1264:41: error: 'reference' was not declared in this scope
1264 | constexpr static void swap(reference x, reference y) noexcept;
| ^~~~~~~~~
p876.cpp:1266:12: error: 'x' was not declared in this scope
1266 | bool b = x;
| ^
p876.cpp:1267:3: error: 'x' does not name a type
1267 | x = y;
| ^
p876.cpp:1268:3: error: 'y' does not name a type
1268 | y = b;
| ^
検討事項(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 初稿 20220805