はじめに(Introduction)
N4910 Working Draft, Standard for Programming Language C++
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.
26.6 Range factories [range.factories] C++N4910:2022 (654) p1050.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 = "26.6 Range factories [range.factories] C++N4910:2022 (654) p1050.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;
// 26.6.1 General [range.factories.general]
// Subclause 26.6 defines range factories, which are utilities to create a view.
// Range factories are declared in namespace std::ranges::views.
// 26.6.2 Empty view [range.empty]
// 26.6.2.1 Overview [range.empty.overview]
// empty_view produces a view of no elements of a particular type.
// [Example 1 :
auto e = views::empty<int>;
static_assert(ranges::empty(e));
static_assert(0 == e.size());
// 26.6.2.2 Class template empty_view [range.empty.view]
namespace std::ranges {
template<class T>
requires is_object_v<T>
class empty_view : public view_interface<empty_view<T>> {
public:
static constexpr T* begin() noexcept {
return nullptr;
}
static constexpr T* end() noexcept {
return nullptr;
}
static constexpr T* data() noexcept {
return nullptr;
}
static constexpr size_t size() noexcept {
return 0;
}
static constexpr bool empty() noexcept {
return true;
}
};
}
// 26.5.6.3 ranges::to adaptors [range.utility.conv.adaptors]
template<class C, class... Args> requires (!view<C>)
constexpr auto to(Args&&... args);
template<template<class...> class C, class... Args>
constexpr auto to(Args&&... args);
// Returns: A range adaptor closure object (26.7.2) f that is a perfect forwarding call wrapper (22.10.4) with the following properties:
// — It has no target object.
// — Its bound argument entities bound_args consist of objects of types decay_t<Args>... direct- non-list-initialized with std::forward<Args>(args)..., respectively.
// — Its call pattern is to<C>(r, bound_args...), where r is the argument used in a function call expression of f.
// Range factories
// 26.6.3 Single view [range.single]
// 26.6.3.1 Overview [range.single.overview]
// single_view produces a view that contains exactly one element of a specified value.
// Effects: Initializes value_ with std::move(t).
// The name views::single denotes a customization point object (16.3.3.3.6). Given a subexpression E, the expression views::single(E) is expression-equivalent to single_view<decay_t<decltype((E))>>(E).
// [Example 1 :
for (int i : views::single(4))
cout << i; // prints 4 —end example]
// 26.6.3.2 Class template single_view [range.single.view]
namespace std::ranges {
template<copy_constructible T>
requires is_object_v<T>
class single_view : public view_interface<single_view<T>> {
private:
copyable-box<T> value_; // exposition only (see 26.7.3)
public:
single_view() requires default_initializable<T> = default;
constexpr explicit single_view(const T& t);
constexpr explicit single_view(T&& t);
template<class... Args>
requires constructible_from<T, Args...>
constexpr explicit single_view(in_place_t, Args&&... args);
constexpr T* begin() noexcept;
constexpr const T* begin() const noexcept;
constexpr T* end() noexcept;
constexpr const T* end() const noexcept;
static constexpr size_t size() noexcept;
constexpr T* data() noexcept;
constexpr const T* data() const noexcept;
};
template<class T>
single_view(T) -> single_view<T>;
}
constexpr explicit single_view(const T& t);
// Effects: Initializes value_ with t. constexpr explicit single_view(T&& t);
template<class... Args>
requires constructible_from<T, Args...>
constexpr explicit single_view(in_place_t, Args&&... args);
// Effects: Initializes value_ as if by value_{in_place, std::forward<Args>(args)...}. constexpr T* begin() noexcept;
constexpr const T* begin() const noexcept;
// Effects: Equivalent to: return data(); constexpr T* end() noexcept;
constexpr const T* end() const noexcept;
// Effects: Equivalent to: return data() + 1; static constexpr size_t size() noexcept;
// Effects: Equivalent to: return 1; constexpr T* data() noexcept;
constexpr const T* data() const noexcept;
// Effects: Equivalent to: return value_.operator->();
// — If W is not an integral type, or if it is an integral type and sizeof(iter_difference_t<W>) is greater than sizeof(W), then IOTA-DIFF-T(W) denotes iter_difference_t<W>.
// — Otherwise, IOTA-DIFF-T(W) is a signed integer type of width greater than the width of W if such a type exists.
// — Otherwise, IOTA-DIFF-T(W) is an unspecified signed-integer-like type (25.3.4.4) of width not less than the width of W.
// 26.6.4 Iota view [range.iota]
// 26.6.4.1 Overview [range.iota.overview]
// iota_view generates a sequence of elements by repeatedly incrementing an initial value.
// The name views::iota denotes a customization point object (16.3.3.3.6). Given subexpressions E and F, the expressions views::iota(E) and views::iota(E, F) are expression-equivalent to iota_view(E) and iota_view(E, F), respectively.
// [Example 1 :
for (int i : views::iota(1, 10))
cout << i << ' '; //prints: 123456789
// 26.6.4.2 Class template iota_view [range.iota.view]
namespace std::ranges {
template<class I>
concept decrementable = see_below;
template<class I>
concept advanceable = see_below;
public:
iota_view() requires default_initializable<W> = default;
constexpr explicit iota_view(W value);
constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
constexpr iota_view(iterator first, see_below last);
constexpr iterator begin() const;
constexpr auto end() const;
constexpr iterator end() const requires same_as<W, Bound>;
constexpr auto size() const requires see_below;
};
template<class W, class Bound>
requires (!is-integer-like<W> || !is-integer-like<Bound> ||
(is-signed-integer-like<W> == is-signed-integer-like<Bound>)) iota_view(W, Bound) -> iota_view<W, Bound>;
}
// Let IOTA-DIFF-T(W) be defined as follows:
// exposition only // exposition only
template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
class iota_view : public view_interface<iota_view<W, Bound>> {
private:
}
// 26.6.4.3, class iota_view::iterator struct iterator;
// 26.6.4.4, class iota_view::sentinel struct sentinel;
W value_ = W();
Bound bound_ = Bound();
// exposition only
// exposition only
// exposition only // exposition only
// [Note 1: It is unspecified whether this type satisfies weakly_incrementable.
// When an object is in the domain of both pre- and post-decrement, the object is said to be decrementable. Let a and b be equal objects of type I. I models decrementable only if
// — If a and b are decrementable, then the following are all true: — addressof(--a) == addressof(a)
// — bool(a-- == b)
// — bool(((void)a--, a) == --b)
// — bool(++(--a) == b).
// — If a and b are incrementable, then bool(--(++a) == b).
// — (a += n)isequaltob.
// — addressof(a += n) is equal to addressof(a).
// — I(a + n)isequalto(a += n).
// — For any two positive values x and y of type D, if I(a + D(x + y)) is well-defined, then I(a + D(x + y)) is equal to I(I(a + x) + y).
// — I(a + D(0)) is equal to a.
// — If I(a + D(n - 1)) is well-defined, then I(a + n) is equal to [](I c) { return ++c; }(I(a + D(n
// - 1))).
// — (b += -n)isequaltoa.
// — (b -= n)isequaltoa.
// — addressof(b -= n) is equal to addressof(b). — I(b - n)isequalto(b -= n).
// — D(b - a)isequalton.
// — D(a - b) is equal to D(-n).
// — bool(a <= b) is true.
// The exposition-only decrementable concept is equivalent to:
template<class I>
concept decrementable =
incrementable<I> && requires(I i) {
{
--i
}
-> same_as<I&>;
{
i--
}
-> same_as<I>;
};
// exposition only
// The exposition-only advanceable concept is equivalent to:
template<class I>
concept advanceable = // exposition only
decrementable<I> && totally_ordered<I> && requires(I i, const I j, const IOTA-DIFF-T(I) n) {
{
i += n
}
-> same_as<I&>;
{
i -= n
}
-> same_as<I&>;
I(j + n);
I(n + j);
I(j - n);
{
j - j
}
-> convertible_to<IOTA-DIFF-T(I)>;
};
// Let D be IOTA-DIFF-T(I). Let a and b be objects of type I such that b is reachable from a after n applications of ++a, for some value n of type D. I models advanceable only if
constexpr explicit iota_view(W value);
// Preconditions: Bound denotes unreachable_sentinel_t or Bound() is reachable from value. Effects: Initializes value_ with value.
constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
// Preconditions: Bound denotes unreachable_sentinel_t or bound is reachable from value. When W and Bound model totally_ordered_with, then bool(value <= bound) is true.
// Effects: Initializes value_ with value and bound_ with bound.
constexpr iota_view(iterator first, see below last);
Effects: // Equivalent to:
// — If same_as<W, Bound> is true, iota_view(first.value_, last.value_).
// — Otherwise, if Bound denotes unreachable_sentinel_t, iota_view(first.value_, last). — Otherwise, iota_view(first.value_, last.bound_).
// Remarks: The type of last is:
// — If same_as<W, Bound> is true, iterator .
// — Otherwise, if Bound denotes unreachable_sentinel_t, Bound. // — Otherwise, sentinel .
constexpr iterator begin() const;
// Effects: Equivalent to:
return iterator{value_};
constexpr auto end() const;
// Effects: Equivalent to:
if constexpr (same_as<Bound, unreachable_sentinel_t>)
return unreachable_sentinel;
else
return sentinel{bound_};
constexpr iterator end() const requires same_as<W, Bound>;
// Effects: Equivalent to: return iterator{bound_};
constexpr auto size() const requires see_below;
// Effects: Equivalent to:
if constexpr (is-integer-like<W> && is-integer-like<Bound>) return (value_ < 0)
? ((bound_ < 0)
? to-unsigned-like(-value_) - to-unsigned-like(-bound_) : to-unsigned-like(bound_) + to-unsigned-like(-value_))
: to-unsigned-like(bound_) - to-unsigned-like(value_);
else
return to-unsigned-like(bound_ - value_);
// Remarks: The expression in the requires-clause is equivalent to:
(same_as<W, Bound> && advanceable<W>) || (is-integer-like<W> && is-integer-like<Bound>) || sized_sentinel_for<Bound, W>
// 26.6.4.3 Class iota_view::iterator [range.iota.iterator]
namespace std::ranges {
template<weakly_incrementable W, semiregular Bound>
requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::iterator {
private:
W value_ = W(); // exposition only public:
using iterator_concept = see below;
using iterator_category = input_iterator_tag;
using value_type = W;
using difference_type = IOTA-DIFF-T(W);
// present only if W models incrementable
// — If W models advanceable , then iterator_concept is random_access_iterator_tag.
// — Otherwise, if W models decrementable , then iterator_concept is bidirectional_iterator_tag. — Otherwise, if W models incrementable, then iterator_concept is forward_iterator_tag.
// — Otherwise, iterator_concept is input_iterator_tag.
iterator() requires default_initializable<W> = default;
constexpr explicit iterator(W value);
constexpr W operator*() const noexcept(is_nothrow_copy_constructible_v<W>);
constexpr iterator& operator++();
constexpr void operator++(int);
constexpr
constexpr
constexpr
iterator operator++(int) requires incrementable<W>;
iterator& operator--() requires decrementable<W>;
iterator operator--(int) requires decrementable <W>;
iterator& operator+=(difference_type n)
constexpr
requires advanceable<W>;
constexpr iterator& operator-=(difference_type n) requires advanceable<W>;
constexpr W operator[](difference_type n) const requires advanceable<W>;
friend constexpr bool operator==(const iterator& x, const iterator& y) requires equality_comparable<W>;
friend constexpr bool operator<(const iterator& x, const iterator& y) requires totally_ordered<W>;
friend constexpr bool operator>(const iterator& x, const iterator& y) requires totally_ordered<W>;
friend constexpr bool operator<=(const iterator& x, const iterator& y) requires totally_ordered<W>;
friend constexpr bool operator>=(const iterator& x, const iterator& y) requires totally_ordered<W>;
friend constexpr auto operator<=>(const iterator& x, const iterator& y) requires totally_ordered<W> && three_way_comparable<W>;
friend constexpr iterator operator+(iterator i, difference_type n) requires advanceable<W>;
friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
friend constexpr iterator operator-(iterator i, difference_type n) requires advanceable<W>;
friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires advanceable<W>;
};
}
// iterator ::iterator_concept is defined as follows:
// [Note 1 : Overloads for iter_move and iter_swap are omitted intentionally.
constexpr explicit iterator(W value);
// Effects: Initializes value_ with value.
constexpr W operator*() const noexcept(is_nothrow_copy_constructible_v<W>);
// Effects: Equivalent to: return value_;
// [Note 2: The noexcept clause is needed by the default iter_move implementation.
constexpr iterator& operator++();
// Effects: Equivalent to:
requires advanceable<W>;
Effects:
Equivalent to:
if constexpr (is-integer-like<W> && !is-signed-integer-like<W>) {
if (n >= difference_type(0))
value_ -= static_cast<W>(n);
else
value_ += static_cast<W>(-n);
}
else {
value_ -= n;
}
requires advanceable<W>;
// Effects: Equivalent to:
return W(value_ + n);
++value_;
return *this;
constexpr void operator++(int);
// Effects: Equivalent to ++*this.
constexpr iterator operator++(int) requires incrementable<W>;
// Effects: Equivalent to:
auto tmp = *this;
++*this;
return tmp;
constexpr iterator& operator--() requires decrementable<W>;
// Effects: Equivalent to:
--value_;
return *this;
constexpr iterator operator--(int) requires decrementable <W>;
// Effects: Equivalent to:
auto tmp = *this;
--*this;
return tmp;
constexpr iterator& operator+=(difference_type n) requires advanceable<W>;
// Effects: Equivalent to:
if constexpr (is-integer-like<W> && !is-signed-integer-like<W>) {
if (n >= difference_type(0))
value_ += static_cast<W>(n);
else
value_ -= static_cast<W>(-n);
}
else {
value_ += n;
}
return *this;
constexpr iterator& operator-=(difference_type n)
return *this;
constexpr W operator[](difference_type n) const
friend constexpr bool operator==(const iterator& x, const iterator& y) requires equality_comparable<W>;
// Effects: Equivalent to: return x.value_ == y.value_;
friend constexpr bool operator<(const iterator& x, const iterator& y)
// Effects: Equivalent to: return x.value_ < y.value_;
friend constexpr bool operator>(const iterator& x, const iterator& y)
requires totally_ordered<W>;
requires totally_ordered<W>;
// Effects: Equivalent to: return y < x;
friend constexpr bool operator<=(const iterator& x, const iterator& y)
requires totally_ordered<W>;
// Effects: Equivalent to: return !(y < x);
friend constexpr bool operator>=(const iterator& x, const iterator& y)
requires totally_ordered<W>;
// Effects: Equivalent to: return !(x < y);
friend constexpr auto operator<=>(const iterator& x, const iterator& y)
requires totally_ordered<W> && three_way_comparable<W>;
// Effects: Equivalent to: return x.value_ <=> y.value_;
friend constexpr iterator operator+(iterator i, difference_type n)
requires advanceable<W>;
// Effects: Equivalent to:
i += n;
return i;
friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
// Effects: Equivalent to: return i + n;
friend constexpr iterator operator-(iterator i, difference_type n)
requires advanceable<W>;
// Effects: Equivalent to:
i -= n;
return i;
friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires advanceable<W>;
// Effects: Equivalent to:
using D = difference_type;
if constexpr (is-integer-like<W>) {
if constexpr (is-signed-integer-like<W>) return D(D(x.value_) - D(y.value_));
else
return (y.value_ > x.value_)
? D(-D(y.value_ - x.value_))
: D(x.value_ - y.value_);
}
else {
return x.value_ - y.value_;
}
// 26.6.4.4 Class iota_view::sentinel [range.iota.sentinel]
namespace std::ranges {
template<weakly_incrementable W, semiregular Bound>
requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
private:
Bound bound_ = Bound(); // exposition only public:
sentinel() = default;
constexpr explicit sentinel(Bound bound);
friend constexpr bool operator==(const iterator& x, const sentinel& y);
friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y) requires sized_sentinel_for<Bound, W>;
};
}
constexpr explicit sentinel(Bound bound);
// Effects: Initializes bound_ with bound.
friend constexpr bool operator==(const iterator& x, const sentinel& y);
// Effects: Equivalent to: return x.value_ == y.bound_;
friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
// Effects: Equivalent to: return x.value_ - y.bound_;
friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
// basic_istream_view models input_range and reads (using operator>>) successive elements from its corresponding input stream.
// The name views::istream<T> denotes a customization point object (16.3.3.3.6). Given a type T and a subexpression E of type U, if U models derived_from<basic_istream<typename U::char_type, typename U::traits_type>>, then the expression views::istream<T>(E) is expression-equivalent to basic_istream_- view<T, typename U::char_type, typename U::traits_type>(E); otherwise, views::istream<T>(E) is ill-formed.
// [Example 1 :
auto ints = istringstream {"0 1 2 3 4"};
ranges::copy(ranges::istream_view<int>(ints), ostream_iterator<int> {cout, "-"}); // prints 0-1-2-3-4-
// 26.6.5.2 Class
template basic_istream_view [range.istream.view]
namespace std::ranges {
template<class Val, class CharT, class Traits>
concept stream-extractable = // exposition only
requires(basic_istream<CharT, Traits>& is, Val& t) {
is >> t;
};
template<movable Val, class CharT, class Traits = char_traits<CharT>>
requires default_initializable<Val> &&
stream-extractable<Val, CharT, Traits>
class basic_istream_view : public view_interface<basic_istream_view<Val, CharT, Traits>> {
public:
constexpr explicit basic_istream_view(basic_istream<CharT, Traits>& stream);
constexpr auto begin() {
*stream_ >> value_;
return iterator{*this};
}
constexpr default_sentinel_t end() const noexcept;
requires sized_sentinel_for<Bound, W>;
// Effects: Equivalent to: return -(y - x);
// 26.6.5 Istream view [range.istream]
// 26.6.5.1 Overview [range.istream.overview]
constexpr explicit basic_istream_view(basic_istream<CharT, Traits>& stream);
// Effects: Initializes stream_ with addressof(stream). constexpr default_sentinel_t end() const noexcept;
// Effects: Equivalent to: return default_sentinel;
// 26.6.5.3 Class
template basic_istream_view::iterator [range.istream.iterator]
namespace std::ranges {
template<movable Val, class CharT, class Traits>
requires default_initializable<Val> && stream-extractable<Val, CharT, Traits>
class basic_istream_view<Val, CharT, Traits>::iterator {
public:
using iterator_concept = input_iterator_tag;
using difference_type = ptrdiff_t;
using value_type = Val;
constexpr explicit iterator(basic_istream_view& parent) noexcept;
iterator(const iterator&) = delete;
iterator(iterator&&) = default;
iterator& operator=(const iterator&) = delete;
iterator& operator=(iterator&&) = default;
iterator& operator++();
void operator++(int);
Val& operator*() const;
friend bool operator==(const iterator& x, default_sentinel_t);
// Effects: Equivalent to: return !*x.parent_->stream_;
private:
struct iterator;
basic_istream<CharT, Traits>* stream_;
Val value_ = Val();
};
}
// exposition only // exposition only // exposition only
private:
basic_istream_view* parent_;
};
}
constexpr explicit iterator(basic_istream_view& parent) noexcept;
// Effects: Initializes parent_ with addressof(parent).
iterator& operator++();
Effects:
Equivalent to:
*parent_->stream_ >> parent_->value_;
return *this;
void operator++(int);
// Effects: Equivalent to ++*this.
Val& operator*() const;
// Effects: Equivalent to:
return parent_->value_;
friend bool operator==(const iterator& x, default_sentinel_t);
// exposition only
int main() {
cout << n4910 << endl;
return EXIT_SUCCESS;
}
編纂・実行結果(compile and go)
$ clang++ p1050.cpp -std=03 -o p1050l -I. -Wall
In file included from p1050.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 \
^
p1050.cpp:21:8: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
auto e = views::empty<int>;
^
p1050.cpp:21:17: error: use of undeclared identifier 'views'
auto e = views::empty<int>;
^
p1050.cpp:21:33: error: expected '(' for function-style cast or type construction
auto e = views::empty<int>;
~~~^
p1050.cpp:21:34: error: expected expression
auto e = views::empty<int>;
^
p1050.cpp:22:22: error: use of undeclared identifier 'ranges'
static_assert(ranges::empty(e));
^
p1050.cpp:22:8: error: unknown type name 'static_assert'
static_assert(ranges::empty(e));
^
p1050.cpp:22:36: error: unknown type name 'e'
static_assert(ranges::empty(e));
^
p1050.cpp:23:8: error: C++ requires a type specifier for all declarations
static_assert(0 == e.size());
^
p1050.cpp:25:21: warning: nested namespace definition is a C++17 extension; define each namespace separately [-Wc++17-extensions]
namespace std::ranges {
^~~~~~~~
{ namespace ranges
p1050.cpp:27:12: error: unknown type name 'requires'
requires is_object_v<T>
^
p1050.cpp:27:21: error: no variable template matches partial specialization
requires is_object_v<T>
^
p1050.cpp:27:35: error: expected ';' at end of declaration
requires is_object_v<T>
^
;
p1050.cpp:28:61: error: expected '>'
class empty_view : public view_interface<empty_view<T>> {
^
p1050.cpp:28:50: note: to match this '<'
class empty_view : public view_interface<empty_view<T>> {
^
p1050.cpp:30:19: error: unknown type name 'constexpr'
static constexpr T* begin() noexcept { return nullptr; }
^
p1050.cpp:30:30: error: expected ';' at end of declaration list
static constexpr T* begin() noexcept { return nullptr; }
^
;
p1050.cpp:37:24: warning: variadic templates are a C++11 extension [-Wc++11-extensions]
template<class C, class... Args> requires (!view<C>)
^
p1050.cpp:37:34: error: C++ requires a type specifier for all declarations
template<class C, class... Args> requires (!view<C>)
^
p1050.cpp:37:34: warning: variable templates are a C++14 extension [-Wc++14-extensions]
p1050.cpp:37:45: error: use of undeclared identifier 'view'; did you mean 'new'?
template<class C, class... Args> requires (!view<C>)
^~~~
new
p1050.cpp:37:45: error: expected unqualified-id
p1050.cpp:37:53: error: expected ';' at end of declaration
template<class C, class... Args> requires (!view<C>)
^
;
p1050.cpp:38:3: error: unknown type name 'constexpr'
constexpr auto to(Args&&... args);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4 warnings and 20 errors generated.
$ clang++ p1050.cpp -std=2b -o p1050l -I. -Wall
In file included from p1050.cpp:10:
In file included from ./N4910.h:2:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iostream:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ostream:38:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ios:40:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/char_traits.h:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_algobase.h:65:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:71:
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:927:13: error: no matching function for call to '__ranges_begin'
= decltype(__detail::__ranges_begin(std::declval<_Tp&>()));
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:884:5: note: in instantiation of template type alias '__range_iter_t' requested here
using iterator_t = std::__detail::__range_iter_t<_Tp>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:134:43: note: in instantiation of template type alias 'iterator_t' requested here
data() requires contiguous_iterator<iterator_t<_Derived>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:465:14: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::empty_view<int>>' requested here
: public view_interface<empty_view<_Tp>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:919:38: note: in instantiation of template class 'std::ranges::empty_view<int>' requested here
inline constexpr empty_view<_Tp> empty{};
^
p1050.cpp:21:24: note: in instantiation of variable template specialization 'std::ranges::views::empty' requested here
auto e = views::empty<int>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:910:7: note: candidate template ignored: constraints not satisfied [with _Tp = std::ranges::empty_view<int>]
__ranges_begin(_Tp& __t)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:908:16: note: because 'is_array_v<std::ranges::empty_view<int> >' evaluated to false
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:908:35: note: and 'std::ranges::empty_view<int> &' does not satisfy '__member_begin'
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:892:33: note: because '__detail::__decay_copy(__t.begin())' would be invalid: no member named 'begin' in 'std::ranges::empty_view<int>'
{ __detail::__decay_copy(__t.begin()) } -> input_or_output_iterator;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:908:59: note: and 'std::ranges::empty_view<int> &' does not satisfy '__adl_begin'
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:902:29: note: because '__detail::__decay_copy(begin(__t))' would be invalid: call to deleted function 'begin'
{ __detail::__decay_copy(begin(__t)) } -> input_or_output_iterator;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:927:13: error: no matching function for call to '__ranges_begin'
= decltype(__detail::__ranges_begin(std::declval<_Tp&>()));
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:884:5: note: in instantiation of template type alias '__range_iter_t' requested here
using iterator_t = std::__detail::__range_iter_t<_Tp>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:140:25: note: in instantiation of template type alias 'iterator_t' requested here
&& contiguous_iterator<iterator_t<const _Derived>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:465:14: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::empty_view<int>>' requested here
: public view_interface<empty_view<_Tp>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:919:38: note: in instantiation of template class 'std::ranges::empty_view<int>' requested here
inline constexpr empty_view<_Tp> empty{};
^
p1050.cpp:21:24: note: in instantiation of variable template specialization 'std::ranges::views::empty' requested here
auto e = views::empty<int>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:910:7: note: candidate template ignored: constraints not satisfied [with _Tp = const std::ranges::empty_view<int>]
__ranges_begin(_Tp& __t)
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:908:16: note: because 'is_array_v<const std::ranges::empty_view<int> >' evaluated to false
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:908:35: note: and 'const std::ranges::empty_view<int> &' does not satisfy '__member_begin'
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:892:33: note: because '__detail::__decay_copy(__t.begin())' would be invalid: no member named 'begin' in 'std::ranges::empty_view<int>'
{ __detail::__decay_copy(__t.begin()) } -> input_or_output_iterator;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:908:59: note: and 'const std::ranges::empty_view<int> &' does not satisfy '__adl_begin'
requires is_array_v<_Tp> || __member_begin<_Tp&> || __adl_begin<_Tp&>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:902:29: note: because '__detail::__decay_copy(begin(__t))' would be invalid: call to deleted function 'begin'
{ __detail::__decay_copy(begin(__t)) } -> input_or_output_iterator;
^
In file included from p1050.cpp:10:
In file included from ./N4910.h:14:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/memory:69:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/ranges_uninitialized.h:36:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/ranges_algobase.h:38:
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:146:24: error: constraints not satisfied for alias template 'sentinel_t' [with _Range = std::ranges::empty_view<int>]
&& sized_sentinel_for<sentinel_t<_Derived>, iterator_t<_Derived>>
^~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:465:14: note: in instantiation of template class 'std::ranges::view_interface<std::ranges::empty_view<int>>' requested here
: public view_interface<empty_view<_Tp>>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:919:38: note: in instantiation of template class 'std::ranges::empty_view<int>' requested here
inline constexpr empty_view<_Tp> empty{};
^
p1050.cpp:21:24: note: in instantiation of variable template specialization 'std::ranges::views::empty' requested here
auto e = views::empty<int>;
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:886:12: note: because 'std::ranges::empty_view<int>' does not satisfy 'range'
template<range _Range>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:874:2: note: because 'ranges::begin(__t)' would be invalid: no matching function for call to object of type 'const __cust_access::_Begin'
ranges::begin(__t);
^
In file included from p1050.cpp:10:
In file included from ./N4910.h:14:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/memory:69:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/ranges_uninitialized.h:36:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/ranges_algobase.h:38:
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:152:24: error: constraints not satisfied for alias template 'sentinel_t' [with _Range = const std::ranges::empty_view<int>]
&& sized_sentinel_for<sentinel_t<const _Derived>,
^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:886:12: note: because 'const std::ranges::empty_view<int>' does not satisfy 'range'
template<range _Range>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:874:2: note: because 'ranges::begin(__t)' would be invalid: no matching function for call to object of type 'const __cust_access::_Begin'
ranges::begin(__t);
^
p1050.cpp:22:22: error: no matching function for call to object of type 'const __cust_access::_Empty'
static_assert(ranges::empty(e));
^~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:789:2: note: candidate template ignored: constraints not satisfied [with _Tp = std::ranges::empty_view<int> &]
operator()(_Tp&& __e) const noexcept(_S_noexcept<_Tp>())
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:786:11: note: because 'std::ranges::empty_view<int> &' does not satisfy '__member_empty'
requires __member_empty<_Tp> || __size0_empty<_Tp>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:754:32: note: because 'bool(std::forward<_Tp>(__t).empty())' would be invalid: no member named 'empty' in 'std::ranges::empty_view<int>'
{ bool(std::forward<_Tp>(__t).empty()); };
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:786:34: note: and 'std::ranges::empty_view<int> &' does not satisfy '__size0_empty'
requires __member_empty<_Tp> || __size0_empty<_Tp>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:758:4: note: because 'std::ranges::__cust_access::_Size{}(std::forward<_Tp>(__t)) == 0' would be invalid: no matching function for call to object of type 'std::ranges::__cust_access::_Size'
{ _Size{}(std::forward<_Tp>(__t)) == 0; };
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:787:5: note: and 'std::ranges::empty_view<int> &' does not satisfy '__eq_iter_empty'
|| __eq_iter_empty<_Tp>
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/range_access.h:763:6: note: because 'std::ranges::__cust_access::_Begin{}(std::forward<_Tp>(__t))' would be invalid: no matching function for call to object of type 'std::ranges::__cust_access::_Begin'
{ _Begin{}(std::forward<_Tp>(__t)) } -> forward_iterator;
^
p1050.cpp:28:16: error: redefinition of 'empty_view'
class empty_view : public view_interface<empty_view<T>> {
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:464:11: note: previous definition is here
class empty_view
^
p1050.cpp:37:45: error: use of undeclared identifier 'view'
template<class C, class... Args> requires (!view<C>)
^
p1050.cpp:52:1: error: expected unqualified-id
for (int i : views::single(4))
^
p1050.cpp:58:14: error: redefinition of 'single_view'
class single_view : public view_interface<single_view<T>> {
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:526:11: note: previous definition is here
class single_view : public view_interface<single_view<_Tp>>
^
p1050.cpp:79:23: error: no template named 'single_view'; did you mean 'std::ranges::single_view'?
constexpr explicit single_view(const T& t);
^~~~~~~~~~~
std::ranges::single_view
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:526:11: note: 'std::ranges::single_view' declared here
class single_view : public view_interface<single_view<_Tp>>
^
p1050.cpp:79:41: error: unknown type name 'T'
constexpr explicit single_view(const T& t);
^
p1050.cpp:79:23: error: deduction guide must be declared in the same scope as template 'std::ranges::single_view'
constexpr explicit single_view(const T& t);
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/ranges:526:11: note: template is declared here
class single_view : public view_interface<single_view<_Tp>>
^
p1050.cpp:79:23: error: deduction guide cannot be declared 'constexpr'
constexpr explicit single_view(const T& t);
~~~~~~~~~ ^
p1050.cpp:79:23: error: deduction guide declaration without trailing return type
p1050.cpp:82:31: error: use of undeclared identifier 'T'
requires constructible_from<T, Args...>
^
p1050.cpp:85:17: error: unknown type name 'T'
constexpr const T* begin() const noexcept;
^
p1050.cpp:85:28: error: non-member function cannot have 'const' qualifier
constexpr const T* begin() const noexcept;
^~~~~~
p1050.cpp:87:17: error: unknown type name 'T'
constexpr const T* end() const noexcept;
^
p1050.cpp:87:26: error: non-member function cannot have 'const' qualifier
constexpr const T* end() const noexcept;
^~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
$ g++ p1050.cpp -std=03 -o p1050g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
from N4910.h:11,
from p1050.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 \
| ^~~~~
p1050.cpp:22:8: warning: identifier 'static_assert' is a keyword in C++11 [-Wc++11-compat]
22 | static_assert(ranges::empty(e));
| ^~~~~~~~~~~~~
p1050.cpp:30:19: warning: identifier 'constexpr' is a keyword in C++11 [-Wc++11-compat]
30 | static constexpr T* begin() noexcept { return nullptr; }
| ^~~~~~~~~
p1050.cpp:30:40: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
30 | static constexpr T* begin() noexcept { return nullptr; }
| ^~~~~~~~
p1050.cpp:30:58: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++11-compat]
30 | static constexpr T* begin() noexcept { return nullptr; }
| ^~~~~~~
p1050.cpp:21:8: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
21 | auto e = views::empty<int>;
| ^~~~
| ----
p1050.cpp:21:13: error: 'e' does not name a type
21 | auto e = views::empty<int>;
| ^
p1050.cpp:22:21: error: expected constructor, destructor, or type conversion before '(' token
22 | static_assert(ranges::empty(e));
| ^
p1050.cpp:23:21: error: expected constructor, destructor, or type conversion before '(' token
23 | static_assert(0 == e.size());
| ^
p1050.cpp:27:12: error: 'requires' does not name a type
27 | requires is_object_v<T>
| ^~~~~~~~
p1050.cpp:27:12: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:37:24: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
37 | template<class C, class... Args> requires (!view<C>)
| ^~~
p1050.cpp:37:43: error: expected constructor, destructor, or type conversion before '(' token
37 | template<class C, class... Args> requires (!view<C>)
| ^
p1050.cpp:39:24: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
39 | template<template<class...> class C, class... Args>
| ^~~
p1050.cpp:39:43: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
39 | template<template<class...> class C, class... Args>
| ^~~
p1050.cpp:40:3: error: 'constexpr' does not name a type
40 | constexpr auto to(Args&&... args);
| ^~~~~~~~~
p1050.cpp:40:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:52:1: error: expected unqualified-id before 'for'
52 | for (int i : views::single(4))
| ^~~
p1050.cpp:56:17: error: 'copy_constructible' has not been declared
56 | template<copy_constructible T>
| ^~~~~~~~~~~~~~~~~~
p1050.cpp:57:10: error: 'requires' does not name a type
57 | requires is_object_v<T>
| ^~~~~~~~
p1050.cpp:57:10: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:77:28: error: 'single_view' does not name a type
77 | single_view(T) -> single_view<T>;
| ^~~~~~~~~~~
p1050.cpp:77:39: error: expected constructor, destructor, or type conversion before '<' token
77 | single_view(T) -> single_view<T>;
| ^
p1050.cpp:79:4: error: 'constexpr' does not name a type
79 | constexpr explicit single_view(const T& t);
| ^~~~~~~~~
p1050.cpp:79:4: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:81:15: warning: variadic templates only available with '-std=c++11' or '-std=gnu++11' [-Wc++11-extensions]
81 | template<class... Args>
| ^~~
p1050.cpp:82:3: error: 'requires' does not name a type
82 | requires constructible_from<T, Args...>
| ^~~~~~~~
p1050.cpp:82:3: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:85:1: error: 'constexpr' does not name a type
85 | constexpr const T* begin() const noexcept;
| ^~~~~~~~~
p1050.cpp:85:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:87:1: error: 'constexpr' does not name a type
87 | constexpr const T* end() const noexcept;
| ^~~~~~~~~
p1050.cpp:87:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:90:1: error: 'constexpr' does not name a type
90 | constexpr const T* data() const noexcept;
| ^~~~~~~~~
p1050.cpp:90:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:100:1: error: expected unqualified-id before 'for'
100 | for (int i : views::iota(1, 10))
| ^~~
p1050.cpp:105:1: error: 'concept' does not name a type
105 | concept decrementable = see_below; template<class I>
| ^~~~~~~
p1050.cpp:105:1: note: 'concept' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:106:1: error: 'concept' does not name a type
106 | concept advanceable = see_below;
| ^~~~~~~
p1050.cpp:106:1: note: 'concept' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:107:1: error: expected unqualified-id before 'public'
107 | public:
| ^~~~~~
p1050.cpp:109:1: error: 'constexpr' does not name a type
109 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:109:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:110:1: error: 'constexpr' does not name a type
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^~~~~~~~~
p1050.cpp:110:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:110:78: error: 'constexpr' does not name a type
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^~~~~~~~~
p1050.cpp:110:78: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:111:1: error: 'constexpr' does not name a type
111 | constexpr iterator begin() const;
| ^~~~~~~~~
p1050.cpp:111:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:112:1: error: 'constexpr' does not name a type
112 | constexpr auto end() const;
| ^~~~~~~~~
p1050.cpp:112:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:113:1: error: 'constexpr' does not name a type
113 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~~
p1050.cpp:113:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:114:1: error: 'constexpr' does not name a type
114 | constexpr auto size() const requires see_below; };
| ^~~~~~~~~
p1050.cpp:114:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:116:10: error: expected constructor, destructor, or type conversion before '(' token
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^
p1050.cpp:118:1: error: expected declaration before '}' token
118 | }
| ^
p1050.cpp:121:10: error: 'weakly_incrementable' has not been declared
121 | template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~~~~~~~~~~~~~~~
p1050.cpp:121:34: error: 'semiregular' has not been declared
121 | template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~~~~~~
p1050.cpp:121:54: error: 'unreachable_sentinel_t' was not declared in this scope
121 | template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~~~~~~~~~~~~~~~~~
p1050.cpp:121:78: error: 'requires' does not name a type
121 | template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~~~
p1050.cpp:121:78: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:127:1: error: 'W' does not name a type
127 | W value_ = W();
| ^
p1050.cpp:128:1: error: 'Bound' does not name a type
128 | Bound bound_ = Bound();
| ^~~~~
p1050.cpp:154:1: error: 'concept' does not name a type; did you mean 'const'?
154 | concept decrementable =
| ^~~~~~~
| const
p1050.cpp:154:1: note: 'concept' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:162:1: error: 'concept' does not name a type; did you mean 'const'?
162 | concept advanceable = // exposition only
| ^~~~~~~
| const
p1050.cpp:162:1: note: 'concept' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:171:1: error: 'constexpr' does not name a type
171 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:171:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:173:7: error: 'constexpr' does not name a type
173 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
| ^~~~~~~~~
p1050.cpp:173:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:176:1: error: 'constexpr' does not name a type
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^~~~~~~~~
p1050.cpp:176:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:176:61: error: found ':' in nested-name-specifier, expected '::'
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^
| ::
p1050.cpp:176:54: error: 'Effects' does not name a type
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^~~~~~~
p1050.cpp:184:1: error: expected unqualified-id before 'return'
184 | return iterator{value_};
| ^~~~~~
p1050.cpp:185:1: error: 'constexpr' does not name a type
185 | constexpr auto end() const;
| ^~~~~~~~~
p1050.cpp:185:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:187:3: error: expected unqualified-id before 'if'
187 | if constexpr (same_as<Bound, unreachable_sentinel_t>)
| ^~
p1050.cpp:189:1: error: expected unqualified-id before 'else'
189 | else
| ^~~~
p1050.cpp:191:1: error: 'constexpr' does not name a type
191 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~~
p1050.cpp:191:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:193:1: error: 'constexpr' does not name a type
193 | constexpr auto size() const requires see_below;
| ^~~~~~~~~
p1050.cpp:193:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:195:1: error: expected unqualified-id before 'if'
195 | if constexpr (is-integer-like<W> && is-integer-like<Bound>) return (value_ < 0)
| ^~
p1050.cpp:198:56: error: expected unqualified-id before 'else'
198 | : to-unsigned-like(bound_) - to-unsigned-like(value_); else
| ^~~~
p1050.cpp:201:9: error: expected ')' before '<' token
201 | (same_as<W, Bound> && advanceable<W>) || (is-integer-like<W> && is-integer-like<Bound>) || sized_sentinel_for<Bound, W>
| ~ ^
| )
p1050.cpp:241:1: error: 'constexpr' does not name a type
241 | constexpr explicit iterator(W value);
| ^~~~~~~~~
p1050.cpp:241:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:243:1: error: 'constexpr' does not name a type
243 | constexpr W operator*() const noexcept(is_nothrow_copy_constructible_v<W>);
| ^~~~~~~~~
p1050.cpp:243:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:246:1: error: 'constexpr' does not name a type
246 | constexpr iterator& operator++();
| ^~~~~~~~~
p1050.cpp:246:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:248:1: error: 'requires' does not name a type
248 | requires advanceable<W>; Effects: Equivalent to:
| ^~~~~~~~
p1050.cpp:248:1: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:248:33: error: found ':' in nested-name-specifier, expected '::'
248 | requires advanceable<W>; Effects: Equivalent to:
| ^
| ::
p1050.cpp:248:26: error: 'Effects' does not name a type
248 | requires advanceable<W>; Effects: Equivalent to:
| ^~~~~~~
p1050.cpp:251:33: error: expected unqualified-id before 'else'
251 | value_ += static_cast<W>(-n); } else {
| ^~~~
p1050.cpp:253:1: error: 'requires' does not name a type
253 | requires advanceable<W>;
| ^~~~~~~~
p1050.cpp:253:1: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:255:1: error: expected unqualified-id before 'return'
255 | return W(value_ + n);
| ^~~~~~
p1050.cpp:256:1: error: expected unqualified-id before '++' token
256 | ++value_; return *this;
| ^~
p1050.cpp:256:11: error: expected unqualified-id before 'return'
256 | ++value_; return *this;
| ^~~~~~
p1050.cpp:257:4: error: 'constexpr' does not name a type
257 | constexpr void operator++(int);
| ^~~~~~~~~
p1050.cpp:257:4: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:259:1: error: 'constexpr' does not name a type
259 | constexpr iterator operator++(int) requires incrementable<W>;
| ^~~~~~~~~
p1050.cpp:259:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:261:8: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
261 | auto tmp = *this;
| ^~~~
| ----
p1050.cpp:261:13: error: 'tmp' does not name a type; did you mean 'tm'?
261 | auto tmp = *this;
| ^~~
| tm
p1050.cpp:262:8: error: expected unqualified-id before '++' token
262 | ++*this;
| ^~
p1050.cpp:263:8: error: expected unqualified-id before 'return'
263 | return tmp;
| ^~~~~~
p1050.cpp:264:1: error: 'constexpr' does not name a type
264 | constexpr iterator& operator--() requires decrementable<W>;
| ^~~~~~~~~
p1050.cpp:264:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:266:1: error: expected unqualified-id before '--' token
266 | --value_; return *this;
| ^~
p1050.cpp:266:11: error: expected unqualified-id before 'return'
266 | --value_; return *this;
| ^~~~~~
p1050.cpp:267:1: error: 'constexpr' does not name a type
267 | constexpr iterator operator--(int) requires decrementable <W>;
| ^~~~~~~~~
p1050.cpp:267:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:269:8: warning: 'auto' changes meaning in C++11; please remove it [-Wc++11-compat]
269 | auto tmp = *this;
| ^~~~
| ----
p1050.cpp:269:13: error: 'tmp' does not name a type; did you mean 'tm'?
269 | auto tmp = *this;
| ^~~
| tm
p1050.cpp:270:8: error: expected unqualified-id before '--' token
270 | --*this;
| ^~
p1050.cpp:271:8: error: expected unqualified-id before 'return'
271 | return tmp;
| ^~~~~~
p1050.cpp:272:1: error: 'constexpr' does not name a type
272 | constexpr iterator& operator+=(difference_type n) requires advanceable<W>;
| ^~~~~~~~~
p1050.cpp:272:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:274:1: error: expected unqualified-id before 'if'
274 | if constexpr (is-integer-like<W> && !is-signed-integer-like<W>) { if (n >= difference_type(0))
| ^~
p1050.cpp:276:33: error: expected unqualified-id before 'else'
276 | value_ -= static_cast<W>(-n); } else {
| ^~~~
p1050.cpp:278:1: error: expected unqualified-id before 'return'
278 | return *this;
| ^~~~~~
p1050.cpp:279:1: error: 'constexpr' does not name a type
279 | constexpr iterator& operator-=(difference_type n)
| ^~~~~~~~~
p1050.cpp:279:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:281:1: error: 'constexpr' does not name a type
281 | constexpr W operator[](difference_type n) const
| ^~~~~~~~~
p1050.cpp:281:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:284:1: error: 'friend' used outside of class
284 | friend constexpr bool operator<(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:284:8: error: 'constexpr' does not name a type
284 | friend constexpr bool operator<(const iterator& x, const iterator& y)
| ^~~~~~~~~
p1050.cpp:284:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:288:1: error: 'requires' does not name a type
288 | requires totally_ordered<W>;
| ^~~~~~~~
p1050.cpp:288:1: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:290:1: error: 'friend' used outside of class
290 | friend constexpr bool operator<=(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:290:8: error: 'constexpr' does not name a type
290 | friend constexpr bool operator<=(const iterator& x, const iterator& y)
| ^~~~~~~~~
p1050.cpp:290:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:293:1: error: 'friend' used outside of class
293 | friend constexpr bool operator>=(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:293:8: error: 'constexpr' does not name a type
293 | friend constexpr bool operator>=(const iterator& x, const iterator& y)
| ^~~~~~~~~
p1050.cpp:293:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:296:1: error: 'friend' used outside of class
296 | friend constexpr auto operator<=>(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:296:8: error: 'constexpr' does not name a type
296 | friend constexpr auto operator<=>(const iterator& x, const iterator& y)
| ^~~~~~~~~
p1050.cpp:296:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:299:1: error: 'friend' used outside of class
299 | friend constexpr iterator operator+(iterator i, difference_type n)
| ^~~~~~
| ------
p1050.cpp:299:8: error: 'constexpr' does not name a type
299 | friend constexpr iterator operator+(iterator i, difference_type n)
| ^~~~~~~~~
p1050.cpp:299:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:302:6: error: 'i' does not name a type
302 | i += n;
| ^
p1050.cpp:303:6: error: expected unqualified-id before 'return'
303 | return i;
| ^~~~~~
p1050.cpp:304:1: error: 'friend' used outside of class
304 | friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
| ^~~~~~
| ------
p1050.cpp:304:8: error: 'constexpr' does not name a type
304 | friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
| ^~~~~~~~~
p1050.cpp:304:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:306:1: error: 'friend' used outside of class
306 | friend constexpr iterator operator-(iterator i, difference_type n)
| ^~~~~~
| ------
p1050.cpp:306:8: error: 'constexpr' does not name a type
306 | friend constexpr iterator operator-(iterator i, difference_type n)
| ^~~~~~~~~
p1050.cpp:306:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:309:6: error: 'i' does not name a type
309 | i -= n;
| ^
p1050.cpp:310:6: error: expected unqualified-id before 'return'
310 | return i;
| ^~~~~~
p1050.cpp:311:1: error: 'friend' used outside of class
311 | friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires advanceable<W>;
| ^~~~~~
| ------
p1050.cpp:311:8: error: 'constexpr' does not name a type
311 | friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires advanceable<W>;
| ^~~~~~~~~
p1050.cpp:311:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:313:7: error: expected nested-name-specifier before 'D'
313 | using D = difference_type;
| ^
p1050.cpp:314:1: error: expected unqualified-id before 'if'
314 | if constexpr (is-integer-like<W>) {
| ^~
p1050.cpp:319:29: error: expected unqualified-id before 'else'
319 | : D(x.value_ - y.value_); } else {
| ^~~~
p1050.cpp:323:14: error: 'weakly_incrementable' has not been declared
323 | template<weakly_incrementable W, semiregular Bound>
| ^~~~~~~~~~~~~~~~~~~~
p1050.cpp:323:38: error: 'semiregular' has not been declared
323 | template<weakly_incrementable W, semiregular Bound>
| ^~~~~~~~~~~
p1050.cpp:324:1: error: 'requires' does not name a type
324 | requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
| ^~~~~~~~
p1050.cpp:324:1: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1050.cpp:333:1: error: 'constexpr' does not name a type
333 | constexpr explicit sentinel(Bound bound);
| ^~~~~~~~~
p1050.cpp:333:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:335:1: error: 'friend' used outside of class
335 | friend constexpr bool operator==(const iterator& x, const sentinel& y);
| ^~~~~~
| ------
p1050.cpp:335:8: error: 'constexpr' does not name a type
335 | friend constexpr bool operator==(const iterator& x, const sentinel& y);
| ^~~~~~~~~
p1050.cpp:335:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:337:1: error: 'friend' used outside of class
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^~~~~~
| ------
p1050.cpp:337:8: error: 'constexpr' does not name a type
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^~~~~~~~~
p1050.cpp:337:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:339:1: error: 'friend' used outside of class
339 | friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:339:8: error: 'constexpr' does not name a type
339 | friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
| ^~~~~~~~~
p1050.cpp:339:8: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:343:53: error: expected constructor, destructor, or type conversion before '(' token
343 | auto ints = istringstream{"0 1 2 3 4"}; ranges::copy(ranges::istream_view<int>(ints), ostream_iterator<int>{cout, "-"}); // prints 0-1-2-3-4-
| ^
p1050.cpp:343:119: error: expected unqualified-id before ')' token
343 | 2 3 4"}; ranges::copy(ranges::istream_view<int>(ints), ostream_iterator<int>{cout, "-"}); // prints 0-1-2-3-4-
| ^
p1050.cpp:345:30: error: 'range' was not declared in this scope
345 | template basic_istream_view [range.istream.view]
| ^~~~~
p1050.cpp:345:10: error: ISO C++ forbids declaration of 'basic_istream_view' with no type [-fpermissive]
345 | template basic_istream_view [range.istream.view]
| ^~~~~~~~~~~~~~~~~~
p1050.cpp:345:49: error: expected ';' before 'namespace'
345 | template basic_istream_view [range.istream.view]
| ^
| ;
346 | namespace std::ranges {
| ~~~~~~~~~
p1050.cpp:391:1: error: 'constexpr' does not name a type
391 | constexpr explicit iterator(basic_istream_view& parent) noexcept;
| ^~~~~~~~~
p1050.cpp:391:1: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1050.cpp:393:1: error: invalid use of template-name 'std::iterator' without an argument list
393 | iterator& operator++(); Effects: Equivalent to:
| ^~~~~~~~
p1050.cpp:393:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
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
| ^~~~~~~~
p1050.cpp:393:32: error: found ':' in nested-name-specifier, expected '::'
393 | iterator& operator++(); Effects: Equivalent to:
| ^
| ::
p1050.cpp:393:25: error: 'Effects' does not name a type
393 | iterator& operator++(); Effects: Equivalent to:
| ^~~~~~~
p1050.cpp:394:39: error: expected unqualified-id before 'return'
394 | *parent_->stream_ >> parent_->value_; return *this;
| ^~~~~~
p1050.cpp:395:6: error: 'void operator++(int)' must have an argument of class or enumerated type
395 | void operator++(int);
| ^~~~~~~~
p1050.cpp:397:1: error: 'Val' does not name a type
397 | Val& operator*() const;
| ^~~
p1050.cpp:399:1: error: expected unqualified-id before 'return'
399 | return parent_->value_;
| ^~~~~~
p1050.cpp:400:1: error: 'friend' used outside of class
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ^~~~~~
| ------
p1050.cpp:400:30: error: invalid use of template-name 'std::iterator' without an argument list
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ^~~~~~~~
p1050.cpp:400:30: 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
| ^~~~~~~~
p1050.cpp:400:43: error: 'default_sentinel_t' has not been declared
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ^~~~~~~~~~~~~~~~~~
p1050.cpp:400:13: error: 'bool operator==(const int&, int)' must have an argument of class or enumerated type
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ^~~~~~~~
$ g++ p1050.cpp -std=2b -o p1050g -I. -Wall
p1050.cpp:21:17: error: 'views' has not been declared
21 | auto e = views::empty<int>;
| ^~~~~
p1050.cpp:21:30: error: expected primary-expression before 'int'
21 | auto e = views::empty<int>;
| ^~~
p1050.cpp:37:45: error: 'view' was not declared in this scope; did you mean 'std::ranges::view'?
37 | template<class C, class... Args> requires (!view<C>)
| ^~~~
| std::ranges::view
In file included from /usr/local/include/c++/12.1.0/string_view:50,
from /usr/local/include/c++/12.1.0/bits/basic_string.h:48,
from /usr/local/include/c++/12.1.0/string:53,
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,
from p1050.cpp:10:
/usr/local/include/c++/12.1.0/bits/ranges_base.h:649:13: note: 'std::ranges::view' declared here
649 | concept view
| ^~~~
p1050.cpp:37:51: error: expected primary-expression before '>' token
37 | template<class C, class... Args> requires (!view<C>)
| ^
p1050.cpp:37:49: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
37 | template<class C, class... Args> requires (!view<C>)
| ^
p1050.cpp:37:52: error: expected primary-expression before ')' token
37 | template<class C, class... Args> requires (!view<C>)
| ^
p1050.cpp:52:1: error: expected unqualified-id before 'for'
52 | for (int i : views::single(4))
| ^~~
p1050.cpp:60:1: error: expected 'auto' or 'decltype(auto)' after 'copyable'
60 | copyable-box<T> value_; // exposition only (see 26.7.3)
| ^~~~~~~~
p1050.cpp:60:9: error: expected unqualified-id before '-' token
60 | copyable-box<T> value_; // exposition only (see 26.7.3)
| ^
p1050.cpp:79:41: error: 'T' does not name a type
79 | constexpr explicit single_view(const T& t);
| ^
p1050.cpp:79:23: error: ISO C++ forbids declaration of 'single_view' with no type [-fpermissive]
79 | constexpr explicit single_view(const T& t);
| ^~~~~~~~~~~
p1050.cpp:79:14: error: 'explicit' outside class declaration
79 | constexpr explicit single_view(const T& t);
| ^~~~~~~~
p1050.cpp:82:31: error: 'T' was not declared in this scope
82 | requires constructible_from<T, Args...>
| ^
p1050.cpp:82:12: error: template argument 1 is invalid
82 | requires constructible_from<T, Args...>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p1050.cpp:83:20: error: ISO C++ forbids declaration of 'single_view' with no type [-fpermissive]
83 | constexpr explicit single_view(in_place_t, Args&&... args);
| ^~~~~~~~~~~
p1050.cpp:83:11: error: 'explicit' outside class declaration
83 | constexpr explicit single_view(in_place_t, Args&&... args);
| ^~~~~~~~
p1050.cpp:85:17: error: 'T' does not name a type
85 | constexpr const T* begin() const noexcept;
| ^
p1050.cpp:87:17: error: 'T' does not name a type
87 | constexpr const T* end() const noexcept;
| ^
p1050.cpp:90:17: error: 'T' does not name a type
90 | constexpr const T* data() const noexcept;
| ^
p1050.cpp:100:1: error: expected unqualified-id before 'for'
100 | for (int i : views::iota(1, 10))
| ^~~
p1050.cpp:105:25: error: 'see_below' was not declared in this scope
105 | concept decrementable = see_below; template<class I>
| ^~~~~~~~~
p1050.cpp:106:23: error: 'see_below' was not declared in this scope
106 | concept advanceable = see_below;
| ^~~~~~~~~
p1050.cpp:107:1: error: expected unqualified-id before 'public'
107 | public:
| ^~~~~~
p1050.cpp:109:20: error: ISO C++ forbids declaration of 'iota_view' with no type [-fpermissive]
109 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:109:11: error: 'explicit' outside class declaration
109 | constexpr explicit iota_view(W value);
| ^~~~~~~~
p1050.cpp:109:30: error: 'W' was not declared in this scope
109 | constexpr explicit iota_view(W value);
| ^
p1050.cpp:110:37: error: 'W' was not declared in this scope
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^
p1050.cpp:110:38: error: template argument 1 is invalid
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^
p1050.cpp:110:63: error: 'Bound' was not declared in this scope; did you mean 'round'?
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^~~~~
| round
p1050.cpp:110:68: error: template argument 1 is invalid
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^
p1050.cpp:110:11: error: ISO C++ forbids declaration of 'iota_view' with no type [-fpermissive]
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^~~~~~~~~
p1050.cpp:110:75: error: 'constexpr int std::ranges::iota_view(int, int)' redeclared as different kind of entity
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^
p1050.cpp:109:20: note: previous declaration 'constexpr const int std::ranges::iota_view'
109 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:110:98: error: class template placeholder 'std::iterator' not permitted in this context
110 | iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^~~~~~~~
p1050.cpp:110:98: note: use 'auto' for an abbreviated function template
p1050.cpp:110:114: error: 'see_below' has not been declared
110 | identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^~~~~~~~~
p1050.cpp:110:88: error: ISO C++ forbids declaration of 'iota_view' with no type [-fpermissive]
110 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^~~~~~~~~
p1050.cpp:110:128: error: 'constexpr int std::ranges::iota_view(...)' redeclared as different kind of entity
110 | ity_t<W> value, type_identity_t<Bound> bound); constexpr iota_view(iterator first, see_below last);
| ^
p1050.cpp:109:20: note: previous declaration 'constexpr const int std::ranges::iota_view'
109 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:111:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
111 | constexpr iterator begin() const;
| ^~~~~~~~
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:
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:111:11: error: deduced class type 'iterator' in function return type
111 | constexpr iterator begin() const;
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:112:22: error: non-member function 'constexpr auto std::ranges::end()' cannot have cv-qualifier
112 | constexpr auto end() const;
| ^~~~~
p1050.cpp:113:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
113 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:113:49: error: 'W' was not declared in this scope
113 | constexpr iterator end() const requires same_as<W, Bound>;
| ^
p1050.cpp:113:52: error: 'Bound' was not declared in this scope; did you mean 'round'?
113 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~
| round
p1050.cpp:113:41: error: template argument 1 is invalid
113 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~~~~~~~~~~
p1050.cpp:113:41: error: template argument 2 is invalid
p1050.cpp:113:11: error: deduced class type 'iterator' in function return type
113 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:114:16: error: constraints on a non-templated function
114 | constexpr auto size() const requires see_below; };
| ^~~~
p1050.cpp:114:38: error: non-member function 'constexpr auto std::ranges::size()' cannot have cv-qualifier
114 | constexpr auto size() const requires see_below; };
| ^~~~~~~~~
p1050.cpp:116:12: error: 'is' was not declared in this scope
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~
p1050.cpp:116:15: error: 'integer' was not declared in this scope
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~~~~~~
p1050.cpp:116:23: error: 'like' was not declared in this scope
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~~~
p1050.cpp:116:29: error: expected primary-expression before '>' token
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^
p1050.cpp:116:31: error: expected primary-expression before '||' token
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~
p1050.cpp:116:35: error: 'is' was not declared in this scope
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~
p1050.cpp:116:38: error: 'integer' was not declared in this scope
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~~~~~~
p1050.cpp:116:46: error: 'like' was not declared in this scope
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~~~
p1050.cpp:116:56: error: expected primary-expression before '>' token
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^
p1050.cpp:116:58: error: expected primary-expression before '||' token
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^~
p1050.cpp:117:2: error: 'is' was not declared in this scope
117 | (is-signed-integer-like<W> == is-signed-integer-like<Bound>)) iota_view(W, Bound) -> iota_view<W, Bound>;
| ^~
p1050.cpp:117:5: error: expected primary-expression before 'signed'
117 | (is-signed-integer-like<W> == is-signed-integer-like<Bound>)) iota_view(W, Bound) -> iota_view<W, Bound>;
| ^~~~~~
p1050.cpp:117:5: error: expected ')' before 'signed'
117 | (is-signed-integer-like<W> == is-signed-integer-like<Bound>)) iota_view(W, Bound) -> iota_view<W, Bound>;
| ~ ^~~~~~
| )
p1050.cpp:117:105: error: expected ')' before ';' token
117 | gned-integer-like<W> == is-signed-integer-like<Bound>)) iota_view(W, Bound) -> iota_view<W, Bound>;
| ^
| )
p1050.cpp:116:10: note: to match this '('
116 | requires (!is-integer-like<W> || !is-integer-like<Bound> ||
| ^
p1050.cpp:117:105: error: expected unqualified-id before ';' token
117 | gned-integer-like<W> == is-signed-integer-like<Bound>)) iota_view(W, Bound) -> iota_view<W, Bound>;
| ^
p1050.cpp:118:1: error: expected declaration before '}' token
118 | }
| ^
p1050.cpp:121:87: error: 'weakly' was not declared in this scope
121 | template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~
p1050.cpp:121:94: error: 'equality' was not declared in this scope
121 | ate<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~~~
p1050.cpp:121:103: error: 'comparable' was not declared in this scope
121 | y_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~~~~~
p1050.cpp:121:114: error: 'with' was not declared in this scope
121 | able W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~
p1050.cpp:121:78: error: expression must be enclosed in parentheses
121 | template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~~~
p1050.cpp:121:87: error: 'weakly' does not name a type
121 | template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> requires weakly-equality-comparable-with<W, Bound> && copyable<W>
| ^~~~~~
p1050.cpp:127:1: error: 'W' does not name a type
127 | W value_ = W();
| ^
p1050.cpp:128:1: error: 'Bound' does not name a type
128 | Bound bound_ = Bound();
| ^~~~~
p1050.cpp:163:74: error: 'IOTA' does not name a type
163 | decrementable<I> && totally_ordered<I> && requires(I i, const I j, const IOTA-DIFF-T(I) n) {
| ^~~~
p1050.cpp:169:47: error: expected ')' before ';' token
169 | { j - j } -> convertible_to<IOTA-DIFF-T(I)>; };
| ^
| )
p1050.cpp:163:51: note: to match this '('
163 | decrementable<I> && totally_ordered<I> && requires(I i, const I j, const IOTA-DIFF-T(I) n) {
| ^
p1050.cpp:171:20: error: ISO C++ forbids declaration of 'iota_view' with no type [-fpermissive]
171 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:171:11: error: 'explicit' outside class declaration
171 | constexpr explicit iota_view(W value);
| ^~~~~~~~
p1050.cpp:171:30: error: 'W' was not declared in this scope
171 | constexpr explicit iota_view(W value);
| ^
p1050.cpp:173:43: error: 'W' was not declared in this scope
173 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
| ^
p1050.cpp:173:44: error: template argument 1 is invalid
173 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
| ^
p1050.cpp:173:69: error: 'Bound' was not declared in this scope; did you mean 'round'?
173 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
| ^~~~~
| round
p1050.cpp:173:74: error: template argument 1 is invalid
173 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
| ^
p1050.cpp:173:17: error: ISO C++ forbids declaration of 'iota_view' with no type [-fpermissive]
173 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
| ^~~~~~~~~
p1050.cpp:173:81: error: 'constexpr int iota_view(int, int)' redeclared as different kind of entity
173 | constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
| ^
p1050.cpp:171:20: note: previous declaration 'constexpr const int iota_view'
171 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:176:21: error: class template placeholder 'std::iterator' not permitted in this context
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^~~~~~~~
p1050.cpp:176:21: note: use 'auto' for an abbreviated function template
p1050.cpp:176:37: error: 'see' has not been declared
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^~~
p1050.cpp:176:47: error: expected ',' or '...' before 'last'
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^~~~
p1050.cpp:176:11: error: ISO C++ forbids declaration of 'iota_view' with no type [-fpermissive]
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^~~~~~~~~
p1050.cpp:176:51: error: 'constexpr int iota_view(...)' redeclared as different kind of entity
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^
p1050.cpp:171:20: note: previous declaration 'constexpr const int iota_view'
171 | constexpr explicit iota_view(W value);
| ^~~~~~~~~
p1050.cpp:176:54: error: 'Effects' does not name a type
176 | constexpr iota_view(iterator first, see below last); Effects: // Equivalent to:
| ^~~~~~~
p1050.cpp:184:1: error: expected unqualified-id before 'return'
184 | return iterator{value_};
| ^~~~~~
p1050.cpp:185:22: error: non-member function 'constexpr auto end()' cannot have cv-qualifier
185 | constexpr auto end() const;
| ^~~~~
p1050.cpp:187:3: error: expected unqualified-id before 'if'
187 | if constexpr (same_as<Bound, unreachable_sentinel_t>)
| ^~
p1050.cpp:189:1: error: expected unqualified-id before 'else'
189 | else
| ^~~~
p1050.cpp:191:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
191 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:191:49: error: 'W' was not declared in this scope
191 | constexpr iterator end() const requires same_as<W, Bound>;
| ^
p1050.cpp:191:52: error: 'Bound' was not declared in this scope; did you mean 'round'?
191 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~
| round
p1050.cpp:191:41: error: template argument 1 is invalid
191 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~~~~~~~~~~
p1050.cpp:191:41: error: template argument 2 is invalid
p1050.cpp:191:11: error: deduced class type 'iterator' in function return type
191 | constexpr iterator end() const requires same_as<W, Bound>;
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:193:16: error: constraints on a non-templated function
193 | constexpr auto size() const requires see_below;
| ^~~~
p1050.cpp:193:38: error: non-member function 'constexpr auto size()' cannot have cv-qualifier
193 | constexpr auto size() const requires see_below;
| ^~~~~~~~~
p1050.cpp:195:1: error: expected unqualified-id before 'if'
195 | if constexpr (is-integer-like<W> && is-integer-like<Bound>) return (value_ < 0)
| ^~
p1050.cpp:198:56: error: expected unqualified-id before 'else'
198 | : to-unsigned-like(bound_) - to-unsigned-like(value_); else
| ^~~~
p1050.cpp:201:10: error: 'W' was not declared in this scope
201 | (same_as<W, Bound> && advanceable<W>) || (is-integer-like<W> && is-integer-like<Bound>) || sized_sentinel_for<Bound, W>
| ^
p1050.cpp:201:13: error: 'Bound' was not declared in this scope; did you mean 'round'?
201 | (same_as<W, Bound> && advanceable<W>) || (is-integer-like<W> && is-integer-like<Bound>) || sized_sentinel_for<Bound, W>
| ^~~~~
| round
p1050.cpp:201:2: error: template argument 1 is invalid
201 | (same_as<W, Bound> && advanceable<W>) || (is-integer-like<W> && is-integer-like<Bound>) || sized_sentinel_for<Bound, W>
| ^~~~~~~~~~~~~~~~~
p1050.cpp:201:2: error: template argument 2 is invalid
p1050.cpp:201:19: error: expected ')' before '&&' token
201 | (same_as<W, Bound> && advanceable<W>) || (is-integer-like<W> && is-integer-like<Bound>) || sized_sentinel_for<Bound, W>
| ~ ^~~
| )
p1050.cpp:241:20: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
241 | constexpr explicit iterator(W value);
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:241:30: error: expected ')' before 'value'
241 | constexpr explicit iterator(W value);
| ~ ^~~~~~
| )
p1050.cpp:243:11: error: 'W' does not name a type
243 | constexpr W operator*() const noexcept(is_nothrow_copy_constructible_v<W>);
| ^
p1050.cpp:246:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
246 | constexpr iterator& operator++();
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:246:11: error: deduced class type 'iterator' in function return type
246 | constexpr iterator& operator++();
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:248:1: error: expected unqualified-id before 'requires'
248 | requires advanceable<W>; Effects: Equivalent to:
| ^~~~~~~~
p1050.cpp:248:33: error: found ':' in nested-name-specifier, expected '::'
248 | requires advanceable<W>; Effects: Equivalent to:
| ^
| ::
p1050.cpp:248:26: error: 'Effects' does not name a type
248 | requires advanceable<W>; Effects: Equivalent to:
| ^~~~~~~
p1050.cpp:251:33: error: expected unqualified-id before 'else'
251 | value_ += static_cast<W>(-n); } else {
| ^~~~
p1050.cpp:253:1: error: expected unqualified-id before 'requires'
253 | requires advanceable<W>;
| ^~~~~~~~
p1050.cpp:255:1: error: expected unqualified-id before 'return'
255 | return W(value_ + n);
| ^~~~~~
p1050.cpp:256:1: error: expected unqualified-id before '++' token
256 | ++value_; return *this;
| ^~
p1050.cpp:256:11: error: expected unqualified-id before 'return'
256 | ++value_; return *this;
| ^~~~~~
p1050.cpp:257:19: error: 'constexpr void operator++(int)' must have an argument of class or enumerated type
257 | constexpr void operator++(int);
| ^~~~~~~~
p1050.cpp:259:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
259 | constexpr iterator operator++(int) requires incrementable<W>;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:259:59: error: 'W' was not declared in this scope
259 | constexpr iterator operator++(int) requires incrementable<W>;
| ^
p1050.cpp:259:45: error: template argument 1 is invalid
259 | constexpr iterator operator++(int) requires incrementable<W>;
| ^~~~~~~~~~~~~~~~
p1050.cpp:259:11: error: deduced class type 'iterator' in function return type
259 | constexpr iterator operator++(int) requires incrementable<W>;
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:261:20: error: invalid use of 'this' at top level
261 | auto tmp = *this;
| ^~~~
p1050.cpp:262:8: error: expected unqualified-id before '++' token
262 | ++*this;
| ^~
p1050.cpp:263:8: error: expected unqualified-id before 'return'
263 | return tmp;
| ^~~~~~
p1050.cpp:264:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
264 | constexpr iterator& operator--() requires decrementable<W>;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:264:57: error: 'W' was not declared in this scope
264 | constexpr iterator& operator--() requires decrementable<W>;
| ^
p1050.cpp:264:43: error: template argument 1 is invalid
264 | constexpr iterator& operator--() requires decrementable<W>;
| ^~~~~~~~~~~~~~~~
p1050.cpp:264:11: error: deduced class type 'iterator' in function return type
264 | constexpr iterator& operator--() requires decrementable<W>;
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:266:1: error: expected unqualified-id before '--' token
266 | --value_; return *this;
| ^~
p1050.cpp:266:11: error: expected unqualified-id before 'return'
266 | --value_; return *this;
| ^~~~~~
p1050.cpp:267:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
267 | constexpr iterator operator--(int) requires decrementable <W>;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:267:60: error: 'W' was not declared in this scope
267 | constexpr iterator operator--(int) requires decrementable <W>;
| ^
p1050.cpp:267:45: error: template argument 1 is invalid
267 | constexpr iterator operator--(int) requires decrementable <W>;
| ^~~~~~~~~~~~~~~~~
p1050.cpp:267:11: error: deduced class type 'iterator' in function return type
267 | constexpr iterator operator--(int) requires decrementable <W>;
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:269:20: error: invalid use of 'this' at top level
269 | auto tmp = *this;
| ^~~~
p1050.cpp:270:8: error: expected unqualified-id before '--' token
270 | --*this;
| ^~
p1050.cpp:271:8: error: expected unqualified-id before 'return'
271 | return tmp;
| ^~~~~~
p1050.cpp:272:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
272 | constexpr iterator& operator+=(difference_type n) requires advanceable<W>;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:272:11: error: template placeholder type 'iterator<...auto...>' must be followed by a simple declarator-id
272 | constexpr iterator& operator+=(difference_type n) requires advanceable<W>;
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:272:32: error: 'difference_type' was not declared in this scope
272 | constexpr iterator& operator+=(difference_type n) requires advanceable<W>;
| ^~~~~~~~~~~~~~~
p1050.cpp:274:1: error: expected unqualified-id before 'if'
274 | if constexpr (is-integer-like<W> && !is-signed-integer-like<W>) { if (n >= difference_type(0))
| ^~
p1050.cpp:276:33: error: expected unqualified-id before 'else'
276 | value_ -= static_cast<W>(-n); } else {
| ^~~~
p1050.cpp:278:1: error: expected unqualified-id before 'return'
278 | return *this;
| ^~~~~~
p1050.cpp:279:11: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
279 | constexpr iterator& operator-=(difference_type n)
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:279:11: error: template placeholder type 'iterator<...auto...>' must be followed by a simple declarator-id
279 | constexpr iterator& operator-=(difference_type n)
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:279:32: error: 'difference_type' was not declared in this scope
279 | constexpr iterator& operator-=(difference_type n)
| ^~~~~~~~~~~~~~~
p1050.cpp:281:11: error: 'W' does not name a type
281 | constexpr W operator[](difference_type n) const
| ^
p1050.cpp:284:1: error: 'friend' used outside of class
284 | friend constexpr bool operator<(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:284:33: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
284 | friend constexpr bool operator<(const iterator& x, const iterator& y)
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:284:50: error: expected ')' before ',' token
284 | friend constexpr bool operator<(const iterator& x, const iterator& y)
| ~ ^
| )
p1050.cpp:284:23: error: 'constexpr bool operator<(...)' must have an argument of class or enumerated type
284 | friend constexpr bool operator<(const iterator& x, const iterator& y)
| ^~~~~~~~
p1050.cpp:284:52: error: expected unqualified-id before 'const'
284 | friend constexpr bool operator<(const iterator& x, const iterator& y)
| ^~~~~
p1050.cpp:288:1: error: expected unqualified-id before 'requires'
288 | requires totally_ordered<W>;
| ^~~~~~~~
p1050.cpp:290:1: error: 'friend' used outside of class
290 | friend constexpr bool operator<=(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:290:34: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
290 | friend constexpr bool operator<=(const iterator& x, const iterator& y)
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:290:51: error: expected ')' before ',' token
290 | friend constexpr bool operator<=(const iterator& x, const iterator& y)
| ~ ^
| )
p1050.cpp:290:23: error: 'constexpr bool operator<=(...)' must have an argument of class or enumerated type
290 | friend constexpr bool operator<=(const iterator& x, const iterator& y)
| ^~~~~~~~
p1050.cpp:290:53: error: expected unqualified-id before 'const'
290 | friend constexpr bool operator<=(const iterator& x, const iterator& y)
| ^~~~~
p1050.cpp:293:1: error: 'friend' used outside of class
293 | friend constexpr bool operator>=(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:293:34: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
293 | friend constexpr bool operator>=(const iterator& x, const iterator& y)
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:293:51: error: expected ')' before ',' token
293 | friend constexpr bool operator>=(const iterator& x, const iterator& y)
| ~ ^
| )
p1050.cpp:293:23: error: 'constexpr bool operator>=(...)' must have an argument of class or enumerated type
293 | friend constexpr bool operator>=(const iterator& x, const iterator& y)
| ^~~~~~~~
p1050.cpp:293:53: error: expected unqualified-id before 'const'
293 | friend constexpr bool operator>=(const iterator& x, const iterator& y)
| ^~~~~
p1050.cpp:296:1: error: 'friend' used outside of class
296 | friend constexpr auto operator<=>(const iterator& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:296:35: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
296 | friend constexpr auto operator<=>(const iterator& x, const iterator& y)
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:296:52: error: expected ')' before ',' token
296 | friend constexpr auto operator<=>(const iterator& x, const iterator& y)
| ~ ^
| )
p1050.cpp:296:23: error: 'constexpr auto operator<=>(...)' must have an argument of class or enumerated type
296 | friend constexpr auto operator<=>(const iterator& x, const iterator& y)
| ^~~~~~~~
p1050.cpp:296:54: error: expected unqualified-id before 'const'
296 | friend constexpr auto operator<=>(const iterator& x, const iterator& y)
| ^~~~~
p1050.cpp:299:1: error: 'friend' used outside of class
299 | friend constexpr iterator operator+(iterator i, difference_type n)
| ^~~~~~
| ------
p1050.cpp:299:18: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
299 | friend constexpr iterator operator+(iterator i, difference_type n)
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:299:37: error: class template placeholder 'std::iterator' not permitted in this context
299 | friend constexpr iterator operator+(iterator i, difference_type n)
| ^~~~~~~~
p1050.cpp:299:37: note: use 'auto' for an abbreviated function template
p1050.cpp:299:49: error: 'difference_type' has not been declared
299 | friend constexpr iterator operator+(iterator i, difference_type n)
| ^~~~~~~~~~~~~~~
p1050.cpp:300:22: error: 'W' was not declared in this scope
300 | requires advanceable<W>;
| ^
p1050.cpp:300:10: error: template argument 1 is invalid
300 | requires advanceable<W>;
| ^~~~~~~~~~~~~~
p1050.cpp:299:18: error: deduced class type 'iterator' in function return type
299 | friend constexpr iterator operator+(iterator i, difference_type n)
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:302:6: error: 'i' does not name a type
302 | i += n;
| ^
p1050.cpp:303:6: error: expected unqualified-id before 'return'
303 | return i;
| ^~~~~~
p1050.cpp:304:1: error: 'friend' used outside of class
304 | friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
| ^~~~~~
| ------
p1050.cpp:304:18: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
304 | friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:304:27: error: declaration of 'operator+' as non-function
304 | friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
| ^~~~~~~~
p1050.cpp:304:37: error: 'difference_type' was not declared in this scope
304 | friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
| ^~~~~~~~~~~~~~~
p1050.cpp:304:65: error: missing template arguments before 'i'
304 | friend constexpr iterator operator+(difference_type n, iterator i) requires advanceable<W>;
| ^
p1050.cpp:306:1: error: 'friend' used outside of class
306 | friend constexpr iterator operator-(iterator i, difference_type n)
| ^~~~~~
| ------
p1050.cpp:306:18: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
306 | friend constexpr iterator operator-(iterator i, difference_type n)
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:306:37: error: class template placeholder 'std::iterator' not permitted in this context
306 | friend constexpr iterator operator-(iterator i, difference_type n)
| ^~~~~~~~
p1050.cpp:306:37: note: use 'auto' for an abbreviated function template
p1050.cpp:306:49: error: 'difference_type' has not been declared
306 | friend constexpr iterator operator-(iterator i, difference_type n)
| ^~~~~~~~~~~~~~~
p1050.cpp:307:22: error: 'W' was not declared in this scope
307 | requires advanceable<W>;
| ^
p1050.cpp:307:10: error: template argument 1 is invalid
307 | requires advanceable<W>;
| ^~~~~~~~~~~~~~
p1050.cpp:306:18: error: deduced class type 'iterator' in function return type
306 | friend constexpr iterator operator-(iterator i, difference_type n)
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:309:6: error: 'i' does not name a type
309 | i -= n;
| ^
p1050.cpp:310:6: error: expected unqualified-id before 'return'
310 | return i;
| ^~~~~~
p1050.cpp:311:1: error: 'friend' used outside of class
311 | friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires advanceable<W>;
| ^~~~~~
| ------
p1050.cpp:311:18: error: 'difference_type' does not name a type
311 | friend constexpr difference_type operator-(const iterator& x, const iterator& y) requires advanceable<W>;
| ^~~~~~~~~~~~~~~
p1050.cpp:313:11: error: 'difference_type' does not name a type
313 | using D = difference_type;
| ^~~~~~~~~~~~~~~
p1050.cpp:314:1: error: expected unqualified-id before 'if'
314 | if constexpr (is-integer-like<W>) {
| ^~
p1050.cpp:319:29: error: expected unqualified-id before 'else'
319 | : D(x.value_ - y.value_); } else {
| ^~~~
p1050.cpp:324:10: error: 'weakly' was not declared in this scope
324 | requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
| ^~~~~~
p1050.cpp:324:17: error: 'equality' was not declared in this scope; did you mean 'equal_to'?
324 | requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
| ^~~~~~~~
| equal_to
p1050.cpp:324:26: error: 'comparable' was not declared in this scope; did you mean 'copyable'?
324 | requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
| ^~~~~~~~~~
| copyable
p1050.cpp:324:37: error: 'with' was not declared in this scope
324 | requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
| ^~~~
p1050.cpp:324:1: error: expression must be enclosed in parentheses
324 | requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
| ^~~~~~~~
p1050.cpp:324:10: error: 'weakly' does not name a type
324 | requires weakly-equality-comparable-with<W, Bound> && copyable<W> struct iota_view<W, Bound>::sentinel {
| ^~~~~~
p1050.cpp:333:20: error: ISO C++ forbids declaration of 'sentinel' with no type [-fpermissive]
333 | constexpr explicit sentinel(Bound bound);
| ^~~~~~~~
p1050.cpp:333:11: error: 'explicit' outside class declaration
333 | constexpr explicit sentinel(Bound bound);
| ^~~~~~~~
p1050.cpp:333:29: error: 'Bound' was not declared in this scope; did you mean 'round'?
333 | constexpr explicit sentinel(Bound bound);
| ^~~~~
| round
p1050.cpp:335:1: error: 'friend' used outside of class
335 | friend constexpr bool operator==(const iterator& x, const sentinel& y);
| ^~~~~~
| ------
p1050.cpp:335:34: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
335 | friend constexpr bool operator==(const iterator& x, const sentinel& y);
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:335:51: error: expected ')' before ',' token
335 | friend constexpr bool operator==(const iterator& x, const sentinel& y);
| ~ ^
| )
p1050.cpp:335:23: error: 'constexpr bool operator==(...)' must have an argument of class or enumerated type
335 | friend constexpr bool operator==(const iterator& x, const sentinel& y);
| ^~~~~~~~
p1050.cpp:335:53: error: expected unqualified-id before 'const'
335 | friend constexpr bool operator==(const iterator& x, const sentinel& y);
| ^~~~~
p1050.cpp:337:1: error: 'friend' used outside of class
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^~~~~~
| ------
p1050.cpp:337:36: error: 'W' was not declared in this scope
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^
p1050.cpp:337:37: error: template argument 1 is invalid
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^
p1050.cpp:337:49: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:337:66: error: expected ')' before ',' token
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ~ ^
| )
p1050.cpp:337:39: error: 'constexpr int operator-(...)' must have an argument of class or enumerated type
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^~~~~~~~
p1050.cpp:337:68: error: expected unqualified-id before 'const'
337 | friend constexpr iter_difference_t<W> operator-(const iterator& x, const sentinel& y) requires sized_sentinel_for<Bound, W>;
| ^~~~~
p1050.cpp:339:1: error: 'friend' used outside of class
339 | friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
| ^~~~~~
| ------
p1050.cpp:339:36: error: 'W' was not declared in this scope
339 | friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
| ^
p1050.cpp:339:37: error: template argument 1 is invalid
339 | friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
| ^
p1050.cpp:339:55: error: 'sentinel' does not name a type
339 | friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
| ^~~~~~~~
p1050.cpp:339:68: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
339 | friend constexpr iter_difference_t<W> operator-(const sentinel& x, const iterator& y)
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:343:1: error: expected initializer before 'auto'
343 | auto ints = istringstream{"0 1 2 3 4"}; ranges::copy(ranges::istream_view<int>(ints), ostream_iterator<int>{cout, "-"}); // prints 0-1-2-3-4-
| ^~~~
p1050.cpp:343:53: error: expected constructor, destructor, or type conversion before '(' token
343 | auto ints = istringstream{"0 1 2 3 4"}; ranges::copy(ranges::istream_view<int>(ints), ostream_iterator<int>{cout, "-"}); // prints 0-1-2-3-4-
| ^
p1050.cpp:343:119: error: expected unqualified-id before ')' token
343 | 2 3 4"}; ranges::copy(ranges::istream_view<int>(ints), ostream_iterator<int>{cout, "-"}); // prints 0-1-2-3-4-
| ^
p1050.cpp:345:30: error: 'range' was not declared in this scope; did you mean 'std::ranges::range'?
345 | template basic_istream_view [range.istream.view]
| ^~~~~
| std::ranges::range
/usr/local/include/c++/12.1.0/bits/ranges_base.h:583:13: note: 'std::ranges::range' declared here
583 | concept range = requires(_Tp& __t)
| ^~~~~
p1050.cpp:345:10: error: ISO C++ forbids declaration of 'basic_istream_view' with no type [-fpermissive]
345 | template basic_istream_view [range.istream.view]
| ^~~~~~~~~~~~~~~~~~
p1050.cpp:345:49: error: expected ';' before 'namespace'
345 | template basic_istream_view [range.istream.view]
| ^
| ;
346 | namespace std::ranges {
| ~~~~~~~~~
p1050.cpp:391:20: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
391 | constexpr explicit iterator(basic_istream_view& parent) noexcept;
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:391:47: error: expected ')' before '&' token
391 | constexpr explicit iterator(basic_istream_view& parent) noexcept;
| ~ ^
| )
p1050.cpp:393:1: warning: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> struct std::iterator' is deprecated [-Wdeprecated-declarations]
393 | iterator& operator++(); Effects: Equivalent to:
| ^~~~~~~~
/usr/local/include/c++/12.1.0/bits/stl_iterator_base_types.h:127:34: note: declared here
127 | struct _GLIBCXX17_DEPRECATED iterator
| ^~~~~~~~
p1050.cpp:393:1: error: deduced class type 'iterator' in function return type
393 | iterator& operator++(); Effects: Equivalent to:
| ^~~~~~~~
/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
| ^~~~~~~~
p1050.cpp:393:32: error: found ':' in nested-name-specifier, expected '::'
393 | iterator& operator++(); Effects: Equivalent to:
| ^
| ::
p1050.cpp:393:25: error: 'Effects' does not name a type
393 | iterator& operator++(); Effects: Equivalent to:
| ^~~~~~~
p1050.cpp:394:39: error: expected unqualified-id before 'return'
394 | *parent_->stream_ >> parent_->value_; return *this;
| ^~~~~~
p1050.cpp:395:6: error: 'void operator++(int)' must have an argument of class or enumerated type
395 | void operator++(int);
| ^~~~~~~~
p1050.cpp:397:1: error: 'Val' does not name a type
397 | Val& operator*() const;
| ^~~
p1050.cpp:399:1: error: expected unqualified-id before 'return'
399 | return parent_->value_;
| ^~~~~~
p1050.cpp:400:1: error: 'friend' used outside of class
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ^~~~~~
| ------
p1050.cpp:400:24: error: template placeholder type 'const iterator<...auto...>' must be followed by a simple declarator-id
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ^~~~~
/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
| ^~~~~~~~
p1050.cpp:400:41: error: expected ')' before ',' token
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ~ ^
| )
p1050.cpp:400:13: error: 'bool operator==(...)' must have an argument of class or enumerated type
400 | friend bool operator==(const iterator& x, default_sentinel_t);
| ^~~~~~~~
p1050.cpp:400:61: error: expected initializer before ')' token
400 | friend bool operator==(const iterator& x, default_sentinel_t);
|
検討事項(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 初稿 20220811