はじめに(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.
27.9 Header synopsis [numeric.ops.overview] C++N4910:2022 (663) p1248.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 = "27.9 Header <numeric> synopsis [numeric.ops.overview] C++N4910:2022 (663) p1248.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;
// 27.9 Header <numeric> synopsis [numeric.ops.overview]
// namespace std {
// 27.10.3, accumulate
template<class InputIterator, class T>
constexpr T accumulate(InputIterator first, InputIterator last, T init);
template<class InputIterator, class T, class BinaryOperation>
constexpr T accumulate(InputIterator first, InputIterator last, T init,
BinaryOperation binary_op);
// 27.10.4, reduce template<class InputIterator>
constexpr typename iterator_traits<InputIterator>::value_type
reduce(InputIterator first, InputIterator last);
template<class InputIterator, class T>
constexpr T reduce(InputIterator first, InputIterator last, T init);
template<class InputIterator, class T, class BinaryOperation>
constexpr T reduce(InputIterator first, InputIterator last, T init,
BinaryOperation binary_op);
template<class ExecutionPolicy, class ForwardIterator>
typename iterator_traits<ForwardIterator>::value_type reduce(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator first, ForwardIterator last);
template<class ExecutionPolicy, class ForwardIterator, class T>
T reduce(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator first, ForwardIterator last, T init);
template<class ExecutionPolicy, class ForwardIterator, class T, class BinaryOperation> T reduce(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator first, ForwardIterator last, T init, BinaryOperation binary_op);
// 27.10.5, inner product
template<class InputIterator1, class InputIterator2, class T>
constexpr T inner_product(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init);
template<class InputIterator1, class InputIterator2, class T,
class BinaryOperation1, class BinaryOperation2>
constexpr T inner_product(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init,
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
// 27.10.6, transform reduce
template<class InputIterator1, class InputIterator2, class T>
constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init);
template<class InputIterator1, class InputIterator2, class T,
class BinaryOperation1, class BinaryOperation2>
constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init,
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
template<class InputIterator, class T,
class BinaryOperation, class UnaryOperation>
constexpr T transform_reduce(InputIterator first, InputIterator last, T init,
BinaryOperation binary_op, UnaryOperation unary_op);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2, class T>
T transform_reduce(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, T init);
template<class ExecutionPolicy,
class ForwardIterator1, class ForwardIterator2, class T,
class BinaryOperation1, class BinaryOperation2>
T transform_reduce(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, T init,
BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
template<class ExecutionPolicy, class ForwardIterator, class T,
class BinaryOperation, class UnaryOperation>
T transform_reduce(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator first, ForwardIterator last, T init,
BinaryOperation binary_op, UnaryOperation unary_op);
// 27.10.7, partial sum
template<class InputIterator, class OutputIterator>
constexpr OutputIterator
partial_sum(InputIterator first, InputIterator last,
OutputIterator result);
template<class InputIterator, class OutputIterator, class BinaryOperation>
constexpr OutputIterator
partial_sum(InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation binary_op);
// 27.10.8, exclusive scan
template<class InputIterator, class OutputIterator, class T>
constexpr OutputIterator
exclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, T init);
template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
constexpr OutputIterator
exclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, T init, BinaryOperation binary_op);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
ForwardIterator2
exclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result, T init);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T,
class BinaryOperation>
ForwardIterator2
exclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result, T init, BinaryOperation binary_op);
// 27.10.9, inclusive scan
template<class InputIterator, class OutputIterator>
constexpr OutputIterator
inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result);
template<class InputIterator, class OutputIterator, class BinaryOperation>
constexpr OutputIterator
inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation binary_op);
template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
constexpr OutputIterator
inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation binary_op, T init);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
ForwardIterator2
inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
class BinaryOperation>
ForwardIterator2
inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result, BinaryOperation binary_op);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
class BinaryOperation, class T>
ForwardIterator2
inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result, BinaryOperation binary_op, T init);
// 27.10.10, transform exclusive scan
template<class InputIterator, class OutputIterator, class T,
class BinaryOperation, class UnaryOperation>
constexpr OutputIterator
transform_exclusive_scan(InputIterator first, InputIterator last,
OutputIterator result, T init,
BinaryOperation binary_op, UnaryOperation unary_op);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T,
class BinaryOperation, class UnaryOperation>
ForwardIterator2
transform_exclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result, T init,
BinaryOperation binary_op, UnaryOperation unary_op);
// 27.10.11, transform inclusive scan
template<class InputIterator, class OutputIterator,
class BinaryOperation, class UnaryOperation>
constexpr OutputIterator
transform_inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op, UnaryOperation unary_op);
template<class InputIterator, class OutputIterator,
class BinaryOperation, class UnaryOperation, class T>
constexpr OutputIterator
transform_inclusive_scan(InputIterator first, InputIterator last,
OutputIterator result,
BinaryOperation binary_op, UnaryOperation unary_op, T init);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
class BinaryOperation, class UnaryOperation>
ForwardIterator2
transform_inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result, BinaryOperation binary_op,
UnaryOperation unary_op);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
class BinaryOperation, class UnaryOperation, class T>
ForwardIterator2
transform_inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result,
BinaryOperation binary_op, UnaryOperation unary_op, T init);
// 27.10.12, adjacent difference
template<class InputIterator, class OutputIterator>
constexpr OutputIterator
adjacent_difference(InputIterator first, InputIterator last,
OutputIterator result);
template<class InputIterator, class OutputIterator, class BinaryOperation>
constexpr OutputIterator
adjacent_difference(InputIterator first, InputIterator last,
OutputIterator result, BinaryOperation binary_op);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
ForwardIterator2
adjacent_difference(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result);
template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
class BinaryOperation>
ForwardIterator2
adjacent_difference(ExecutionPolicy&& exec, // see 27.3.5
ForwardIterator1 first, ForwardIterator1 last,
ForwardIterator2 result, BinaryOperation binary_op);
}
// 27.10.13, iota
template<class ForwardIterator, class T>
constexpr void iota(ForwardIterator first, ForwardIterator last, T value);
namespace ranges {
template<class O, class T>
using iota_result = out_value_result<O, T>;
template<input_or_output_iterator O, sentinel_for<O> S, weakly_incrementable T>
requires indirectly_writable<O, const T&>
constexpr iota_result<O, T> iota(O first, S last, T value);
template<weakly_incrementable T, output_range<const T&> R>
constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
}
// 27.10.14, greatest common divisor template<class M, class N>
constexpr common_type_t<M, N> gcd(M m, N n);
// 27.10.15, least common multiple template<class M, class N>
constexpr common_type_t<M, N> lcm(M m, N n);
// 27.10.16, midpoint template<class T>
constexpr T midpoint(T a, T b) noexcept;
template<class T>
constexpr T* midpoint(T* a, T* b);
int main() {
cout << n4910 << endl;
return EXIT_SUCCESS;
}
編纂・実行結果(compile and go)
$ clang++ p1248.cpp -std=03 -o p1248l -I. -Wall
In file included from p1248.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 \
^
p1248.cpp:18:3: error: unknown type name 'constexpr'
constexpr T accumulate(InputIterator first, InputIterator last, T init);
^
p1248.cpp:18:13: warning: variable templates are a C++14 extension [-Wc++14-extensions]
constexpr T accumulate(InputIterator first, InputIterator last, T init);
^
p1248.cpp:18:14: error: expected ';' at end of declaration
constexpr T accumulate(InputIterator first, InputIterator last, T init);
^
;
p1248.cpp:18:26: error: unknown type name 'InputIterator'
constexpr T accumulate(InputIterator first, InputIterator last, T init);
^
p1248.cpp:18:47: error: unknown type name 'InputIterator'
constexpr T accumulate(InputIterator first, InputIterator last, T init);
^
p1248.cpp:18:67: error: unknown type name 'T'
constexpr T accumulate(InputIterator first, InputIterator last, T init);
^
p1248.cpp:18:15: error: C++ requires a type specifier for all declarations
constexpr T accumulate(InputIterator first, InputIterator last, T init);
^
p1248.cpp:20:3: error: unknown type name 'constexpr'
constexpr T accumulate(InputIterator first, InputIterator last, T init,
^
p1248.cpp:20:13: warning: variable templates are a C++14 extension [-Wc++14-extensions]
constexpr T accumulate(InputIterator first, InputIterator last, T init,
^
p1248.cpp:20:14: error: expected ';' at end of declaration
constexpr T accumulate(InputIterator first, InputIterator last, T init,
^
;
p1248.cpp:20:26: error: unknown type name 'InputIterator'
constexpr T accumulate(InputIterator first, InputIterator last, T init,
^
p1248.cpp:20:47: error: unknown type name 'InputIterator'
constexpr T accumulate(InputIterator first, InputIterator last, T init,
^
p1248.cpp:20:67: error: unknown type name 'T'
constexpr T accumulate(InputIterator first, InputIterator last, T init,
^
p1248.cpp:21:26: error: unknown type name 'BinaryOperation'
BinaryOperation binary_op);
^
p1248.cpp:20:15: error: C++ requires a type specifier for all declarations
constexpr T accumulate(InputIterator first, InputIterator last, T init,
^
p1248.cpp:23:3: error: unknown type name 'constexpr'
constexpr typename iterator_traits<InputIterator>::value_type
^
p1248.cpp:23:38: error: use of undeclared identifier 'InputIterator'
constexpr typename iterator_traits<InputIterator>::value_type
^
p1248.cpp:24:12: error: unknown type name 'InputIterator'
reduce(InputIterator first, InputIterator last);
^
p1248.cpp:24:33: error: unknown type name 'InputIterator'
reduce(InputIterator first, InputIterator last);
^
p1248.cpp:26:3: error: unknown type name 'constexpr'
constexpr T reduce(InputIterator first, InputIterator last, T init);
^
p1248.cpp:26:13: warning: variable templates are a C++14 extension [-Wc++14-extensions]
constexpr T reduce(InputIterator first, InputIterator last, T init);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
3 warnings and 20 errors generated.
$ clang++ p1248.cpp -std=2b -o p1248l -I. -Wall
p1248.cpp:23:38: error: use of undeclared identifier 'InputIterator'; did you mean 'input_iterator'?
constexpr typename iterator_traits<InputIterator>::value_type
^~~~~~~~~~~~~
input_iterator
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:587:13: note: 'input_iterator' declared here
concept input_iterator = input_or_output_iterator<_Iter>
^
p1248.cpp:23:38: error: too few template arguments for concept 'input_iterator'
constexpr typename iterator_traits<InputIterator>::value_type
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/iterator_concepts.h:587:13: note: template is declared here
concept input_iterator = input_or_output_iterator<_Iter>
^
p1248.cpp:24:12: error: unknown type name 'InputIterator'
reduce(InputIterator first, InputIterator last);
^
p1248.cpp:24:33: error: unknown type name 'InputIterator'
reduce(InputIterator first, InputIterator last);
^
p1248.cpp:197:1: error: extraneous closing brace ('}')
}
^
p1248.cpp:203:29: error: no template named 'out_value_result'
using iota_result = out_value_result<O, T>;
^
p1248.cpp:206:19: error: no template named 'iota_result'
constexpr iota_result<O, T> iota(O first, S last, T value);
^
p1248.cpp:207:40: error: no template named 'output_range'
template<weakly_incrementable T, output_range<const T&> R>
^
p1248.cpp:208:31: error: use of undeclared identifier 'borrowed_iterator_t'
constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
^
p1248.cpp:208:70: error: 'T' does not refer to a value
constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
^
p1248.cpp:207:37: note: declared here
template<weakly_incrementable T, output_range<const T&> R>
^
p1248.cpp:208:67: error: use of undeclared identifier 'r'
constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
^
p1248.cpp:211:31: error: use of undeclared identifier 'M'
constexpr common_type_t<M, N> gcd(M m, N n);
^
p1248.cpp:211:41: error: unknown type name 'M'
constexpr common_type_t<M, N> gcd(M m, N n);
^
p1248.cpp:211:46: error: unknown type name 'N'
constexpr common_type_t<M, N> gcd(M m, N n);
^
p1248.cpp:213:31: error: use of undeclared identifier 'M'
constexpr common_type_t<M, N> lcm(M m, N n);
^
p1248.cpp:213:41: error: unknown type name 'M'
constexpr common_type_t<M, N> lcm(M m, N n);
^
p1248.cpp:213:46: error: unknown type name 'N'
constexpr common_type_t<M, N> lcm(M m, N n);
^
p1248.cpp:215:17: error: unknown type name 'T'
constexpr T midpoint(T a, T b) noexcept;
^
p1248.cpp:215:28: error: unknown type name 'T'
constexpr T midpoint(T a, T b) noexcept;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
$ g++ p1248.cpp -std=03 -o p1248g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
from N4910.h:11,
from p1248.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 \
| ^~~~~
p1248.cpp:18:3: warning: identifier 'constexpr' is a keyword in C++11 [-Wc++11-compat]
18 | constexpr T accumulate(InputIterator first, InputIterator last, T init);
| ^~~~~~~~~
p1248.cpp:215:38: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
215 | constexpr T midpoint(T a, T b) noexcept;
| ^~~~~~~~
p1248.cpp:18:3: error: 'constexpr' does not name a type
18 | constexpr T accumulate(InputIterator first, InputIterator last, T init);
| ^~~~~~~~~
p1248.cpp:18:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:20:3: error: 'constexpr' does not name a type
20 | constexpr T accumulate(InputIterator first, InputIterator last, T init,
| ^~~~~~~~~
p1248.cpp:20:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:23:3: error: 'constexpr' does not name a type
23 | constexpr typename iterator_traits<InputIterator>::value_type
| ^~~~~~~~~
p1248.cpp:23:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:26:3: error: 'constexpr' does not name a type
26 | constexpr T reduce(InputIterator first, InputIterator last, T init);
| ^~~~~~~~~
p1248.cpp:26:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:28:3: error: 'constexpr' does not name a type
28 | constexpr T reduce(InputIterator first, InputIterator last, T init,
| ^~~~~~~~~
p1248.cpp:28:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:31:77: error: expected ',' or '...' before '&&' token
31 | typename iterator_traits<ForwardIterator>::value_type reduce(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:34:25: error: expected ',' or '...' before '&&' token
34 | T reduce(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:36:112: error: expected ',' or '...' before '&&' token
36 | nPolicy, class ForwardIterator, class T, class BinaryOperation> T reduce(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:40:3: error: 'constexpr' does not name a type
40 | constexpr T inner_product(InputIterator1 first1, InputIterator1 last1,
| ^~~~~~~~~
p1248.cpp:40:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:44:3: error: 'constexpr' does not name a type
44 | constexpr T inner_product(InputIterator1 first1, InputIterator1 last1,
| ^~~~~~~~~
p1248.cpp:44:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:49:3: error: 'constexpr' does not name a type
49 | constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1,
| ^~~~~~~~~
p1248.cpp:49:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:53:3: error: 'constexpr' does not name a type
53 | constexpr T transform_reduce(InputIterator1 first1, InputIterator1 last1,
| ^~~~~~~~~
p1248.cpp:53:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:58:3: error: 'constexpr' does not name a type
58 | constexpr T transform_reduce(InputIterator first, InputIterator last, T init,
| ^~~~~~~~~
p1248.cpp:58:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:62:35: error: expected ',' or '...' before '&&' token
62 | T transform_reduce(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:68:35: error: expected ',' or '...' before '&&' token
68 | T transform_reduce(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:74:35: error: expected ',' or '...' before '&&' token
74 | T transform_reduce(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:79:3: error: 'constexpr' does not name a type
79 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:79:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:83:3: error: 'constexpr' does not name a type
83 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:83:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:88:3: error: 'constexpr' does not name a type
88 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:88:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:92:3: error: 'constexpr' does not name a type
92 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:92:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:97:31: error: expected ',' or '...' before '&&' token
97 | exclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:103:31: error: expected ',' or '...' before '&&' token
103 | exclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:108:3: error: 'constexpr' does not name a type
108 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:108:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:112:3: error: 'constexpr' does not name a type
112 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:112:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:116:3: error: 'constexpr' does not name a type
116 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:116:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:121:31: error: expected ',' or '...' before '&&' token
121 | inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:127:31: error: expected ',' or '...' before '&&' token
127 | inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:133:31: error: expected ',' or '...' before '&&' token
133 | inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:139:3: error: 'constexpr' does not name a type
139 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:139:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:146:41: error: expected ',' or '...' before '&&' token
146 | transform_exclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:153:3: error: 'constexpr' does not name a type
153 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:153:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:159:3: error: 'constexpr' does not name a type
159 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:159:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:166:41: error: expected ',' or '...' before '&&' token
166 | transform_inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:173:41: error: expected ',' or '...' before '&&' token
173 | transform_inclusive_scan(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:179:3: error: 'constexpr' does not name a type
179 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:179:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:183:3: error: 'constexpr' does not name a type
183 | constexpr OutputIterator
| ^~~~~~~~~
p1248.cpp:183:3: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:188:36: error: expected ',' or '...' before '&&' token
188 | adjacent_difference(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:194:36: error: expected ',' or '...' before '&&' token
194 | adjacent_difference(ExecutionPolicy&& exec, // see 27.3.5
| ^~
p1248.cpp:197:1: error: expected declaration before '}' token
197 | }
| ^
p1248.cpp:200:7: error: 'constexpr' does not name a type
200 | constexpr void iota(ForwardIterator first, ForwardIterator last, T value);
| ^~~~~~~~~
p1248.cpp:200:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:203:9: error: expected unqualified-id before 'using'
203 | using iota_result = out_value_result<O, T>;
| ^~~~~
p1248.cpp:204:16: error: 'input_or_output_iterator' has not been declared
204 | template<input_or_output_iterator O, sentinel_for<O> S, weakly_incrementable T>
| ^~~~~~~~~~~~~~~~~~~~~~~~
p1248.cpp:204:44: error: 'sentinel_for' has not been declared
204 | template<input_or_output_iterator O, sentinel_for<O> S, weakly_incrementable T>
| ^~~~~~~~~~~~
p1248.cpp:204:56: error: expected '>' before '<' token
204 | template<input_or_output_iterator O, sentinel_for<O> S, weakly_incrementable T>
| ^
p1248.cpp:205:9: error: 'requires' does not name a type
205 | requires indirectly_writable<O, const T&>
| ^~~~~~~~
p1248.cpp:205:9: note: 'requires' only available with '-std=c++20' or '-fconcepts'
p1248.cpp:207:16: error: 'weakly_incrementable' has not been declared
207 | template<weakly_incrementable T, output_range<const T&> R>
| ^~~~~~~~~~~~~~~~~~~~
p1248.cpp:207:40: error: 'output_range' has not been declared
207 | template<weakly_incrementable T, output_range<const T&> R>
| ^~~~~~~~~~~~
p1248.cpp:207:52: error: expected '>' before '<' token
207 | template<weakly_incrementable T, output_range<const T&> R>
| ^
p1248.cpp:208:9: error: 'constexpr' does not name a type
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~
p1248.cpp:208:9: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:211:7: error: 'constexpr' does not name a type
211 | constexpr common_type_t<M, N> gcd(M m, N n);
| ^~~~~~~~~
p1248.cpp:211:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:213:7: error: 'constexpr' does not name a type
213 | constexpr common_type_t<M, N> lcm(M m, N n);
| ^~~~~~~~~
p1248.cpp:213:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:215:7: error: 'constexpr' does not name a type
215 | constexpr T midpoint(T a, T b) noexcept;
| ^~~~~~~~~
p1248.cpp:215:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
p1248.cpp:217:7: error: 'constexpr' does not name a type
217 | constexpr T* midpoint(T* a, T* b);
| ^~~~~~~~~
p1248.cpp:217:7: note: C++11 'constexpr' only available with '-std=c++11' or '-std=gnu++11'
$ g++ p1248.cpp -std=2b -o p1248g -I. -Wall
p1248.cpp:23:38: error: 'InputIterator' was not declared in this scope
23 | constexpr typename iterator_traits<InputIterator>::value_type
| ^~~~~~~~~~~~~
p1248.cpp:23:51: error: template argument 1 is invalid
23 | constexpr typename iterator_traits<InputIterator>::value_type
| ^
p1248.cpp:24:12: error: 'InputIterator' was not declared in this scope
24 | reduce(InputIterator first, InputIterator last);
| ^~~~~~~~~~~~~
p1248.cpp:24:33: error: 'InputIterator' was not declared in this scope
24 | reduce(InputIterator first, InputIterator last);
| ^~~~~~~~~~~~~
p1248.cpp:24:51: error: expression list treated as compound expression in initializer [-fpermissive]
24 | reduce(InputIterator first, InputIterator last);
| ^
p1248.cpp:26:69: error: 'template<class InputIterator, class T> constexpr T reduce(InputIterator, InputIterator, T)' redeclared as different kind of entity
26 | constexpr T reduce(InputIterator first, InputIterator last, T init);
| ^
p1248.cpp:24:5: note: previous declaration 'constexpr const int reduce'
24 | reduce(InputIterator first, InputIterator last);
| ^~~~~~
p1248.cpp:29:47: error: 'template<class InputIterator, class T, class BinaryOperation> constexpr T reduce(InputIterator, InputIterator, T, BinaryOperation)' redeclared as different kind of entity
29 | BinaryOperation binary_op);
| ^
p1248.cpp:24:5: note: previous declaration 'constexpr const int reduce'
24 | reduce(InputIterator first, InputIterator last);
| ^~~~~~
p1248.cpp:32:55: error: 'template<class ExecutionPolicy, class ForwardIterator> typename std::iterator_traits<_II>::value_type reduce(ExecutionPolicy&&, ForwardIterator, ForwardIterator)' redeclared as different kind of entity
32 | ForwardIterator first, ForwardIterator last);
| ^
p1248.cpp:24:5: note: previous declaration 'constexpr const int reduce'
24 | reduce(InputIterator first, InputIterator last);
| ^~~~~~
p1248.cpp:35:68: error: 'template<class ExecutionPolicy, class ForwardIterator, class T> T reduce(ExecutionPolicy&&, ForwardIterator, ForwardIterator, T)' redeclared as different kind of entity
35 | ForwardIterator first, ForwardIterator last, T init);
| ^
p1248.cpp:24:5: note: previous declaration 'constexpr const int reduce'
24 | reduce(InputIterator first, InputIterator last);
| ^~~~~~
p1248.cpp:37:90: error: 'template<class ExecutionPolicy, class ForwardIterator, class T, class BinaryOperation> T reduce(ExecutionPolicy&&, ForwardIterator, ForwardIterator, T, BinaryOperation)' redeclared as different kind of entity
37 | ForwardIterator first, ForwardIterator last, T init, BinaryOperation binary_op);
| ^
p1248.cpp:24:5: note: previous declaration 'constexpr const int reduce'
24 | reduce(InputIterator first, InputIterator last);
| ^~~~~~
p1248.cpp:197:1: error: expected declaration before '}' token
197 | }
| ^
p1248.cpp:203:29: error: 'out_value_result' does not name a type
203 | using iota_result = out_value_result<O, T>;
| ^~~~~~~~~~~~~~~~
p1248.cpp:206:19: error: 'iota_result' does not name a type
206 | constexpr iota_result<O, T> iota(O first, S last, T value);
| ^~~~~~~~~~~
p1248.cpp:207:40: error: 'output_range' has not been declared
207 | template<weakly_incrementable T, output_range<const T&> R>
| ^~~~~~~~~~~~
p1248.cpp:207:52: error: expected '>' before '<' token
207 | template<weakly_incrementable T, output_range<const T&> R>
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
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 p1248.cpp:10:
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:51: error: 'R' was not declared in this scope
p1248.cpp:208:31: error: 'borrowed_iterator_t' was not declared in this scope; did you mean 'std::ranges::borrowed_iterator_t'?
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~~~~~~~~~
| std::ranges::borrowed_iterator_t
/usr/local/include/c++/12.1.0/bits/ranges_base.h:952:11: note: 'std::ranges::borrowed_iterator_t' declared here
952 | using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
| ^~~~~~~~~~~~~~~~~~~
p1248.cpp:208:51: error: 'R' was not declared in this scope
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^
p1248.cpp:208:19: error: 'iota_result' does not name a type
208 | constexpr iota_result<borrowed_iterator_t<R>, T> iota(R&& r, T value);
| ^~~~~~~~~~~
p1248.cpp:211:31: error: 'M' was not declared in this scope
211 | constexpr common_type_t<M, N> gcd(M m, N n);
| ^
p1248.cpp:211:34: error: 'N' was not declared in this scope
211 | constexpr common_type_t<M, N> gcd(M m, N n);
| ^
p1248.cpp:211:35: error: template argument 1 is invalid
211 | constexpr common_type_t<M, N> gcd(M m, N n);
| ^
p1248.cpp:211:35: error: template argument 2 is invalid
p1248.cpp:211:41: error: 'M' was not declared in this scope
211 | constexpr common_type_t<M, N> gcd(M m, N n);
| ^
p1248.cpp:211:46: error: 'N' was not declared in this scope
211 | constexpr common_type_t<M, N> gcd(M m, N n);
| ^
p1248.cpp:211:49: error: expression list treated as compound expression in initializer [-fpermissive]
211 | constexpr common_type_t<M, N> gcd(M m, N n);
| ^
p1248.cpp:213:31: error: 'M' was not declared in this scope
213 | constexpr common_type_t<M, N> lcm(M m, N n);
| ^
p1248.cpp:213:34: error: 'N' was not declared in this scope
213 | constexpr common_type_t<M, N> lcm(M m, N n);
| ^
p1248.cpp:213:35: error: template argument 1 is invalid
213 | constexpr common_type_t<M, N> lcm(M m, N n);
| ^
p1248.cpp:213:35: error: template argument 2 is invalid
p1248.cpp:213:41: error: 'M' was not declared in this scope
213 | constexpr common_type_t<M, N> lcm(M m, N n);
| ^
p1248.cpp:213:46: error: 'N' was not declared in this scope
213 | constexpr common_type_t<M, N> lcm(M m, N n);
| ^
p1248.cpp:213:49: error: expression list treated as compound expression in initializer [-fpermissive]
213 | constexpr common_type_t<M, N> lcm(M m, N n);
| ^
p1248.cpp:215:17: error: 'T' does not name a type
215 | constexpr T midpoint(T a, T b) noexcept;
| ^
検討事項(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 初稿 20220815