LoginSignup
0
0

More than 1 year has passed since last update.

32.11 Regular expression iterators [re.iter] C++N4910:2022 (706) p1652.cpp

Posted at

はじめに(Introduction)

N4910 Working Draft, Standard for Programming Language C++

C++ n4910は、ISO/IEC JTC1 SC22 WG21の作業原案(Working Draft)です。
公式のISO/IEC 14882原本ではありません。
ISO/IEC JTC1 SC22 のWG21を含むいくつかのWGでは、可能な限り作業文書を公開し、幅広い意見を求めています。

ISO/IEC JTC1 SC7からISO/IEC JTC1 SC22リエゾンとして、2000年頃、C/C++の品質向上に貢献しようとした活動をしていたことがあります。その頃は、まだISO/IEC TS 17961の原案が出る前です。Cの精神が優勢で、セキュリティ対策は補助的な位置付けでした。ISO/IEC TS 17961の制定と、C/C++のライブラリ類の見直しと、C++の進化はどんどん進んでいきます。 

進化の具合が、どちらに行こうとしているかは、コンパイルて実行させてみないとわかりません。C/C++の規格案の電子ファイルは、そのままコンパイルできる形式であるとよいと主張してきました。MISRA-C/C++, CERTC/C++でも同様です。MISRA-C/C++は、Example Suiteという形で、コード断片をコンパイルできる形で提供するようになりました。

一連の記事はコード断片をコンパイルできる形にする方法を検討してコンパイル、リンク、実行して、規格案の原文と処理系(g++, Clang++)との違いを確認し、技術内容を検討し、ISO/IEC JTC1 SC22 WG21にフィードバックするために用います。
また、CERT C++, MISRA C++等のコーディング標準のコード断片をコンパイルする際の参考にさせていただこうと考えています。CERT C++, MISRA C++が標準化の動きとの時間的なずれがあれば確認できれば幸いです。また、boostライブラリとの関連、Linux OS, 箱庭プロジェクト、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

bash
$ docker run -v /Users/ogawakiyoshi/n4910:/Users/ogawakiyoshi/n4910 -it kaizenjapan/n4910 /bin/bash

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++

読書感想文

CコンパイラによるC言語規格の読書感想文として掲載しています。

コンパイル実験が、C++N4910に対する、G++とClang++による感想文だということご理解いただけると幸いです。

読書感想文は人間かAIだけが作るものとは限りません。
本(電子書籍を含む)を入力として、その内容に対する文字列を読書感想文として受け止めましょう。
元の文章をあり方、コンパイルできるように電子化しておくこと、コンパイラが解釈可能な断片の作り方など。

個人開発

Cコンパイラの試験を一人でもくもくとやっているのは個人開発の一つの姿です。

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

編纂器(Compiler)

clang++ --version

20220826 以前

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

20220827 以降

Debian clang version 14.0.6-++20220622053050+f28c006a5895-1~exp1~20220622173135.152
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.

32.11 Regular expression iterators [re.iter] C++N4910:2022 (706) p1652.cpp

算譜(source code)

p1652.cpp
// C++N4910 Committee Draft, Standard for Programming Language C++
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf
const char * n4910 = "32.11 Regular expression iterators [re.iter] C++N4910:2022 (706) p1652.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;

// 32.11.1 Class template regex_iterator   [re.regiter]
// 32.11.1.1 General[re.regiter.general]
// The class template regex_iterator is an iterator adaptor. It represents a new view of an existing iterator sequence, by enumerating all the occurrences of a regular expression within that sequence. A regex_- iterator uses regex_search to find successive regular expression matches within the sequence from which it was constructed. After the iterator is constructed, and every time operator++ is used, the iterator finds and stores a value of match_results<BidirectionalIterator>. If the end of the sequence is reached (regex_search returns false), the iterator becomes equal to the end-of-sequence iterator value. The default constructor constructs an end-of-sequence iterator object, which is the only legitimate iterator to be used for the end condition. The result of operator* on an end-of-sequence iterator is not defined. For any other iterator value a const match_results<BidirectionalIterator>& is returned. The result of operator-> on an end-of-sequence iterator is not defined. For any other iterator value a const match_- results<BidirectionalIterator>* is returned. It is impossible to store things into regex_iterators. Two end-of-sequence iterators are always equal. An end-of-sequence iterator is not equal to a non-end-of-sequence iterator. Two non-end-of-sequence iterators are equal when they are constructed from the same arguments.
namespace std {
template<class BidirectionalIterator,
         class charT = typename iterator_traits<BidirectionalIterator>::value_type,
         class traits = regex_traits<charT>>
class regex_iterator {
public:
    using regex_type        = basic_regex<charT, traits>;
    using iterator_category = forward_iterator_tag;
    using value_type = match_results<BidirectionalIterator>;
    using difference_type = ptrdiff_t;
    using pointer = const value_type*;
    using reference = const value_type&;
    regex_iterator();
    regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
                   const regex_type& re,
                   regex_constants::match_flag_type m = regex_constants::match_default);
    regex_iterator(BidirectionalIterator, BidirectionalIterator,
                   const regex_type&&,
                   regex_constants::match_flag_type = regex_constants::match_default) = delete;
    regex_iterator(const regex_iterator&);
    regex_iterator& operator=(const regex_iterator&);
    bool operator==(const regex_iterator&) const;
    const value_type& operator*() const;
    const value_type* operator->() const;
    regex_iterator& operator++();
    regex_iterator operator++(int);
private:
    BidirectionalIterator                begin;
    BidirectionalIterator                end;
// exposition only // exposition only
// Effects: Constructs an end-of-sequence iterator.
};
}
const regex_type*
regex_constants::match_flag_type
match_results<BidirectionalIterator> match;
// exposition only // exposition only // exposition only
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
               const regex_type& re,
               pregex;
               flags;
//  An object of type regex_iterator that is not an end-of-sequence iterator holds a zero-length match if match[0].matched == true and match[0].first == match[0].second.
// [Note 1: For example, this can occur when the part of the regular expression that matched consists only of an assertion (such as ’^’, ’$’, ’\b’, ’\B’).
// 32.11.1.2 Constructors [re.regiter.cnstr]
               regex_iterator();
               regex_constants::match_flag_type m = regex_constants::match_default);
// Effects: Initializes begin and end to a and b, respectively, sets pregex to addressof(re), sets flags to m, then calls regex_search(begin, end, match, *pregex, flags). If this call returns false the constructor sets *this to the end-of-sequence iterator.
// 32.11.1.3 Comparisons [re.regiter.comp]
bool operator==(const regex_iterator& right) const;
// Returns: true if *this and right are both end-of-sequence iterators or if the following conditions all hold:
// — begin == right.begin,
// — end == right.end,
// — pregex == right.pregex,
// — flags == right.flags, and
// — match[0] == right.match[0];
// otherwise false.
// 32.11.1.4 Indirection [re.regiter.deref]
const value_type& operator*() const;
// Returns: match.
const value_type* operator->() const;
// Returns: addressof(match).
// 32.11.1.5 Increment [re.regiter.incr]
regex_iterator& operator++();
// Effects: Constructs a local variable start of type BidirectionalIterator and initializes it with the value of match[0].second. If the iterator holds a zero-length match and start == end the operator sets *this to the end-of- sequence iterator and returns *this. Otherwise, if the iterator holds a zero-length match, the operator calls:
regex_search(start, end, match, *pregex,
             flags | regex_constants::match_not_null | regex_constants::match_continuous)
// If the call returns true the operator returns *this. Otherwise the operator increments start and continues as if the most recent match was not a zero-length match. If the most recent match was not a zero-length match, the operator sets flags to flags | regex_- constants::match_prev_avail and calls regex_search(start, end, match, *pregex, flags). If the call returns false the iterator sets *this to the end-of-sequence iterator. The iterator then returns *this. In all cases in which the call to regex_search returns true, match.prefix().first shall be equal to the previous value of match[0].second, and for each index i in the half-open range [0, match.size()) for which match[i].matched is true, match.position(i) shall return distance(begin, match[i]. first).
// [Note 1: This means that match.position(i) gives the offset from the beginning of the target sequence, which is often not the same as the offset from the sequence passed in the call to regex_search. —end note]
// It is unspecified how the implementation makes these adjustments.
// [Note 2: This means that an implementation can call an implementation-specific search function, in which case a program-defined specialization of regex_search will not be called. —end note]
regex_iterator operator++(int);
// Effects: As if by:
regex_iterator tmp = *this;
++(*this);
return tmp;
// 32.11.2 Class template regex_token_iterator [re.tokiter]
// 32.11.2.1 General [re.tokiter.general]
//  The class template regex_token_iterator is an iterator adaptor; that is to say it represents a new view of an existing iterator sequence, by enumerating all the occurrences of a regular expression within that sequence, and presenting one or more sub-expressions for each match found. Each position enumerated by the iterator is a sub_match class template instance that represents what matched a particular sub-expression within the regular expression.
//  When class regex_token_iterator is used to enumerate a single sub-expression with index −1 the iterator performs field splitting: that is to say it enumerates one sub-expression for each section of the character container sequence that does not match the regular expression specified.
//  After it is constructed, the iterator finds and stores a value regex_iterator<BidirectionalIterator> position and sets the internal count N to zero. It also maintains a sequence subs which contains a list of the sub-expressions which will be enumerated. Every time operator++ is used the count N is incremented; if N exceeds or equals subs.size(), then the iterator increments member position and sets count N to zero.
//  If the end of sequence is reached (position is equal to the end of sequence iterator), the iterator becomes equal to the end-of-sequence iterator value, unless the sub-expression being enumerated has index −1, in which case the iterator enumerates one last sub-expression that contains all the characters from the end of the last regular expression match to the end of the input sequence being enumerated, provided that this would not be an empty sub-expression.
//  The default constructor constructs an end-of-sequence iterator object, which is the only legitimate iterator to be used for the end condition. The result of operator* on an end-of-sequence iterator is not defined. For any other iterator value a const sub_match<BidirectionalIterator>& is returned. The result of operator-> on an end-of-sequence iterator is not defined. For any other iterator value a const sub_- match<BidirectionalIterator>* is returned.
// It is impossible to store things into regex_token_iterators. Two end-of-sequence iterators are always equal. An end-of-sequence iterator is not equal to a non-end-of-sequence iterator. Two non-end-of-sequence iterators are equal when they are constructed from the same arguments.
namespace std {
template<class BidirectionalIterator,
         class charT = typename iterator_traits<BidirectionalIterator>::value_type,
         class traits = regex_traits<charT>>
class regex_token_iterator {
public:
    using regex_type        = basic_regex<charT, traits>;
    using iterator_category = forward_iterator_tag;
    using value_type = sub_match<BidirectionalIterator>;
    using difference_type = ptrdiff_t;
    using pointer = const value_type*;
};
}
using reference         = const value_type&;
regex_token_iterator();
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type& re,
                     int submatch = 0,
                     regex_constants::match_flag_type m =
                         regex_constants::match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type& re,
                     const vector<int>& submatches,
                     regex_constants::match_flag_type m =
                         regex_constants::match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type& re,
                     initializer_list<int> submatches,
                     regex_constants::match_flag_type m =
                         regex_constants::match_default);
template<size_t N>
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type& re,
                     const int (&submatches)[N],
                     regex_constants::match_flag_type m =
                         regex_constants::match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type&& re,
                     int submatch = 0,
                     regex_constants::match_flag_type m =
                         regex_constants::match_default) = delete;
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type&& re,
                     const vector<int>& submatches,
                     regex_constants::match_flag_type m =
                         regex_constants::match_default) = delete;
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type&& re,
                     initializer_list<int> submatches,
                     regex_constants::match_flag_type m =
                         regex_constants::match_default) = delete;
template<size_t N>
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type&& re,
                     const int (&submatches)[N],
                     regex_constants::match_flag_type m =
                         regex_constants::match_default) = delete;
regex_token_iterator(const regex_token_iterator&);
regex_token_iterator& operator=(const regex_token_iterator&);
bool operator==(const regex_token_iterator&) const;
const value_type& operator*() const;
const value_type* operator->() const;
regex_token_iterator& operator++();
regex_token_iterator operator++(int);
private:
using position_iterator =
    regex_iterator<BidirectionalIterator, charT, traits>;
position_iterator position;
const value_type* result;
value_type suffix;
size_t N;
vector<int> subs;
// exposition only // exposition only // exposition only // exposition only // exposition only // exposition only
// Effects: Constructs the end-of-sequence iterator.
const regex_type& re,
      const int (&submatches)[N],
      regex_constants::match_flag_type m = regex_constants::match_default);
// Preconditions: Each of the initialization values of submatches is >= -1.
// Effects: The first constructor initializes the member subs to hold the single value submatch. The second, third, and fourth constructors initialize the member subs to hold a copy of the sequence of integer values pointed to by the iterator range [begin(submatches), end(submatches)).
// Each constructor then sets N to 0, and position to position_iterator(a, b, re, m). If position is not an end-of-sequence iterator the constructor sets result to the address of the current match. Otherwise if any of the values stored in subs is equal to −1 the constructor sets *this to a suffix iterator that points to the range [a,b), otherwise the constructor sets *this to an end-of-sequence iterator.
// A suffix iterator is a regex_token_iterator object that points to a final sequence of characters at the end of the target sequence. In a suffix iterator the member result holds a pointer to the data member suffix, the value of the member suffix.match is true, suffix.first points to the beginning of the final sequence, and suffix.second points to the end of the final sequence.
//  [Note 1: For a suffix iterator, data member suffix.first is the same as the end of the last match found, and suffix.second is the same as the end of the target sequence. —end note]
// The current match is (*position).prefix() if subs[N] == -1, or (*position)[subs[N]] for any other value of subs[N].
// 32.11.2.2 Constructors [re.tokiter.cnstr]
regex_token_iterator();
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type& re,
                     int submatch = 0,
                         regex_constants::match_flag_type m = regex_constants::match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type& re,
                     const vector<int>& submatches,
                     regex_constants::match_flag_type m = regex_constants::match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
                     const regex_type& re,
                     initializer_list<int> submatches,
                     regex_constants::match_flag_type m = regex_constants::match_default);
template<size_t N>
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
// 32.11.2.3 Comparisons [re.tokiter.comp]
                     bool operator==(const regex_token_iterator& right) const;
// Returns: true if *this and right are both end-of-sequence iterators, or if *this and right are both suffix iterators and suffix == right.suffix; otherwise returns false if *this or right is an end-of-sequence iterator or a suffix iterator. Otherwise returns true if position == right.position, N == right.N, and subs == right.subs. Otherwise returns false.
// 32.11.2.4 Indirection [re.tokiter.deref]
const value_type& operator*() const;
// Returns: *result.
const value_type* operator->() const;
// Returns: result.
// 32.11.2.5 Increment [re.tokiter.incr]
regex_token_iterator& operator++();
// Effects: Constructs a local variable prev of type position_iterator, initialized with the value of position. If *this is a suffix iterator, sets *this to an end-of-sequence iterator. Otherwise, if N + 1 < subs.size(), increments N and sets result to the address of the current match.
// Otherwise, sets N to 0 and increments position. If position is not an end-of-sequence iterator the operator sets result to the address of the current match.
// Otherwise, if any of the values stored in subs is equal to −1 and prev->suffix().length() is not 0 the operator sets *this to a suffix iterator that points to the range [prev->suffix().first, prev->suffix().second).
// Otherwise, sets *this to an end-of-sequence iterator. Returns:
*this regex_token_iterator& operator++(int);
// Effects: Constructs a copy tmp of *this, then calls ++(*this). Returns: tmp.
int main() {
    cout  <<  n4910 << endl;
    return EXIT_SUCCESS;
}

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

bash
$ clang++ p1652.cpp -std=03 -o p1652l -I. -Wall
In file included from p1652.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 \
 ^
p1652.cpp:20:51: error: a space is required between consecutive right angle brackets (use '> >')
                 class traits = regex_traits<charT>>
                                                  ^~
                                                  > >
p1652.cpp:20:33: error: no template named 'regex_traits'
                 class traits = regex_traits<charT>>
                                ^
p1652.cpp:20:24: error: template parameter missing a default argument
                 class traits = regex_traits<charT>>
                       ^
p1652.cpp:19:32: note: previous default template argument defined here
                 class charT = typename iterator_traits<BidirectionalIterator>::value_type,
                               ^
p1652.cpp:23:38: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
           using regex_type        = basic_regex<charT, traits>;
                                     ^
p1652.cpp:23:38: error: no template named 'basic_regex'
p1652.cpp:24:38: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
           using iterator_category = forward_iterator_tag;
                                     ^
p1652.cpp:25:20: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using value_type = match_results<BidirectionalIterator>;
                   ^
p1652.cpp:25:20: error: no template named 'match_results'
p1652.cpp:26:25: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using difference_type = ptrdiff_t;
                        ^
p1652.cpp:27:17: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using pointer = const value_type*;
                ^
p1652.cpp:27:23: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
using pointer = const value_type*;
                      ^~~~~~~~~~
                      _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:28:19: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
using reference = const value_type&;
                  ^
p1652.cpp:28:25: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
using reference = const value_type&;
                        ^~~~~~~~~~
                        _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:31:22: error: unknown type name 'regex_type'
               const regex_type& re,
                     ^
p1652.cpp:32:16: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type m = regex_constants::match_default);
               ^
p1652.cpp:34:22: error: unknown type name 'regex_type'
               const regex_type&&,
                     ^
p1652.cpp:34:32: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
               const regex_type&&,
                               ^
p1652.cpp:35:16: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type = regex_constants::match_default) = delete;
               ^
p1652.cpp:35:85: warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
               regex_constants::match_flag_type = regex_constants::match_default) = delete;
                                                                                    ^
p1652.cpp:39:9: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
  const value_type& operator*() const;
        ^~~~~~~~~~
        _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:40:9: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
  const value_type* operator->() const;
        ^~~~~~~~~~
        _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:32:53: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type m = regex_constants::match_default);
                                                    ^
p1652.cpp:35:51: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type = regex_constants::match_default) = delete;
                                                  ^
p1652.cpp:49:7: error: unknown type name 'regex_type'
const regex_type*
      ^
p1652.cpp:50:1: error: use of undeclared identifier 'regex_constants'
regex_constants::match_flag_type
^
p1652.cpp:53:16: error: unknown type name 'BidirectionalIterator'; did you mean 'bidirectional_iterator_tag'?
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
               ^~~~~~~~~~~~~~~~~~~~~
               bidirectional_iterator_tag
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:103:10: note: 'bidirectional_iterator_tag' declared here
  struct bidirectional_iterator_tag : public forward_iterator_tag { };
         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
8 warnings and 20 errors generated.
$ clang++ p1652.cpp -std=2b -o p1652l -I. -Wall
p1652.cpp:20:33: error: no template named 'regex_traits'
                 class traits = regex_traits<charT>>
                                ^
p1652.cpp:20:24: error: template parameter missing a default argument
                 class traits = regex_traits<charT>>
                       ^
p1652.cpp:19:32: note: previous default template argument defined here
                 class charT = typename iterator_traits<BidirectionalIterator>::value_type,
                               ^
p1652.cpp:23:38: error: no template named 'basic_regex'
           using regex_type        = basic_regex<charT, traits>;
                                     ^
p1652.cpp:25:20: error: no template named 'match_results'
using value_type = match_results<BidirectionalIterator>;
                   ^
p1652.cpp:27:23: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
using pointer = const value_type*;
                      ^~~~~~~~~~
                      _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:28:25: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
using reference = const value_type&;
                        ^~~~~~~~~~
                        _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:31:22: error: unknown type name 'regex_type'
               const regex_type& re,
                     ^
p1652.cpp:32:16: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type m = regex_constants::match_default);
               ^
p1652.cpp:34:22: error: unknown type name 'regex_type'
               const regex_type&&,
                     ^
p1652.cpp:35:16: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type = regex_constants::match_default) = delete;
               ^
p1652.cpp:39:9: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
  const value_type& operator*() const;
        ^~~~~~~~~~
        _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:40:9: error: unknown type name 'value_type'; did you mean '_Bit_const_iterator::value_type'?
  const value_type* operator->() const;
        ^~~~~~~~~~
        _Bit_const_iterator::value_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:132:26: note: '_Bit_const_iterator::value_type' declared here
      typedef _Tp        value_type;
                         ^
p1652.cpp:32:53: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type m = regex_constants::match_default);
                                                    ^
p1652.cpp:35:51: error: use of undeclared identifier 'regex_constants'
               regex_constants::match_flag_type = regex_constants::match_default) = delete;
                                                  ^
p1652.cpp:49:7: error: unknown type name 'regex_type'
const regex_type*
      ^
p1652.cpp:50:1: error: use of undeclared identifier 'regex_constants'
regex_constants::match_flag_type
^
p1652.cpp:53:16: error: unknown type name 'BidirectionalIterator'; did you mean 'bidirectional_iterator_tag'?
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
               ^~~~~~~~~~~~~~~~~~~~~
               bidirectional_iterator_tag
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:103:10: note: 'bidirectional_iterator_tag' declared here
  struct bidirectional_iterator_tag : public forward_iterator_tag { };
         ^
p1652.cpp:53:41: error: unknown type name 'BidirectionalIterator'; did you mean 'bidirectional_iterator_tag'?
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
                                        ^~~~~~~~~~~~~~~~~~~~~
                                        bidirectional_iterator_tag
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_iterator_base_types.h:103:10: note: 'bidirectional_iterator_tag' declared here
  struct bidirectional_iterator_tag : public forward_iterator_tag { };
         ^
p1652.cpp:54:22: error: unknown type name 'regex_type'
               const regex_type& re,
                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

$ g++ p1652.cpp -std=03 -o p1652g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
                 from N4910.h:11,
                 from p1652.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 \
      |  ^~~~~
p1652.cpp:20:33: error: 'regex_traits' does not name a type
   20 |                  class traits = regex_traits<charT>>
      |                                 ^~~~~~~~~~~~
p1652.cpp:20:45: error: expected '>' before '<' token
   20 |                  class traits = regex_traits<charT>>
      |                                             ^
p1652.cpp:21:31: error: expected unqualified-id before '{' token
   21 |          class regex_iterator {
      |                               ^
p1652.cpp:49:7: error: 'regex_type' does not name a type
   49 | const regex_type*
      |       ^~~~~~~~~~
p1652.cpp:53:15: error: expected constructor, destructor, or type conversion before '(' token
   53 | regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |               ^
p1652.cpp:56:1: error: 'flags' does not name a type
   56 | flags;
      | ^~~~~
p1652.cpp:60:17: error: expected constructor, destructor, or type conversion before ';' token
   60 | regex_iterator();
      |                 ^
p1652.cpp:61:11: error: 'regex_constants' does not name a type
   61 |           regex_constants::match_flag_type m = regex_constants::match_default);
      |           ^~~~~~~~~~~~~~~
p1652.cpp:64:23: error: 'regex_iterator' does not name a type
   64 | bool operator==(const regex_iterator& right) const;
      |                       ^~~~~~~~~~~~~~
p1652.cpp:64:46: error: non-member function 'bool operator==(const int&)' cannot have cv-qualifier
   64 | bool operator==(const regex_iterator& right) const;
      |                                              ^~~~~
p1652.cpp:64:6: error: 'bool operator==(const int&)' must have an argument of class or enumerated type
   64 | bool operator==(const regex_iterator& right) const;
      |      ^~~~~~~~
p1652.cpp:73:7: error: 'value_type' does not name a type
   73 | const value_type& operator*() const;
      |       ^~~~~~~~~~
p1652.cpp:75:7: error: 'value_type' does not name a type
   75 | const value_type* operator->() const;
      |       ^~~~~~~~~~
p1652.cpp:78:1: error: 'regex_iterator' does not name a type
   78 | regex_iterator& operator++();
      | ^~~~~~~~~~~~~~
p1652.cpp:80:15: error: expected constructor, destructor, or type conversion before '(' token
   80 |   regex_search(start, end, match, *pregex,
      |               ^
p1652.cpp:88:8: error: 'regex_iterator' does not name a type
   88 |        regex_iterator tmp = *this;
      |        ^~~~~~~~~~~~~~
p1652.cpp:89:8: error: expected unqualified-id before '++' token
   89 |        ++(*this);
      |        ^~
p1652.cpp:90:8: error: expected unqualified-id before 'return'
   90 |        return tmp;
      |        ^~~~~~
p1652.cpp:102:33: error: 'regex_traits' does not name a type
  102 |                  class traits = regex_traits<charT>>
      |                                 ^~~~~~~~~~~~
p1652.cpp:102:45: error: expected '>' before '<' token
  102 |                  class traits = regex_traits<charT>>
      |                                             ^
p1652.cpp:103:37: error: expected unqualified-id before '{' token
  103 |          class regex_token_iterator {
      |                                     ^
p1652.cpp:111:7: error: expected nested-name-specifier before 'reference'
  111 | using reference         = const value_type&;
      |       ^~~~~~~~~
p1652.cpp:112:23: error: expected constructor, destructor, or type conversion before ';' token
  112 | regex_token_iterator();
      |                       ^
p1652.cpp:113:21: error: expected constructor, destructor, or type conversion before '(' token
  113 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:118:21: error: expected constructor, destructor, or type conversion before '(' token
  118 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:123:21: error: expected constructor, destructor, or type conversion before '(' token
  123 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:129:23: error: expected constructor, destructor, or type conversion before '(' token
  129 |   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                       ^
p1652.cpp:134:21: error: expected constructor, destructor, or type conversion before '(' token
  134 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:139:21: error: expected constructor, destructor, or type conversion before '(' token
  139 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:144:21: error: expected constructor, destructor, or type conversion before '(' token
  144 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:150:21: error: expected constructor, destructor, or type conversion before '(' token
  150 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:155:28: error: 'regex_token_iterator' does not name a type
  155 | regex_token_iterator(const regex_token_iterator&);
      |                            ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:155:50: error: expected constructor, destructor, or type conversion before ';' token
  155 | regex_token_iterator(const regex_token_iterator&);
      |                                                  ^
p1652.cpp:156:1: error: 'regex_token_iterator' does not name a type
  156 | regex_token_iterator& operator=(const regex_token_iterator&);
      | ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:157:23: error: 'regex_token_iterator' does not name a type
  157 | bool operator==(const regex_token_iterator&) const;
      |                       ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:157:46: error: non-member function 'bool operator==(const int&)' cannot have cv-qualifier
  157 | bool operator==(const regex_token_iterator&) const;
      |                                              ^~~~~
p1652.cpp:157:6: error: 'bool operator==(const int&)' must have an argument of class or enumerated type
  157 | bool operator==(const regex_token_iterator&) const;
      |      ^~~~~~~~
p1652.cpp:158:7: error: 'value_type' does not name a type
  158 | const value_type& operator*() const;
      |       ^~~~~~~~~~
p1652.cpp:159:7: error: 'value_type' does not name a type
  159 | const value_type* operator->() const;
      |       ^~~~~~~~~~
p1652.cpp:160:3: error: 'regex_token_iterator' does not name a type
  160 |   regex_token_iterator& operator++();
      |   ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:161:3: error: 'regex_token_iterator' does not name a type
  161 |   regex_token_iterator operator++(int);
      |   ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:162:1: error: expected unqualified-id before 'private'
  162 | private:
      | ^~~~~~~
p1652.cpp:165:3: error: 'position_iterator' does not name a type
  165 |   position_iterator position;
      |   ^~~~~~~~~~~~~~~~~
p1652.cpp:166:9: error: 'value_type' does not name a type
  166 |   const value_type* result;
      |         ^~~~~~~~~~
p1652.cpp:167:3: error: 'value_type' does not name a type
  167 |   value_type suffix;
      |   ^~~~~~~~~~
p1652.cpp:172:25: error: 'regex_type' does not name a type
  172 |                   const regex_type& re,
      |                         ^~~~~~~~~~
p1652.cpp:182:23: error: expected constructor, destructor, or type conversion before ';' token
  182 | regex_token_iterator();
      |                       ^
p1652.cpp:183:21: error: expected constructor, destructor, or type conversion before '(' token
  183 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:187:21: error: expected constructor, destructor, or type conversion before '(' token
  187 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:191:21: error: expected constructor, destructor, or type conversion before '(' token
  191 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:196:23: error: expected constructor, destructor, or type conversion before '(' token
  196 |   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                       ^
p1652.cpp:201:7: error: 'value_type' does not name a type
  201 | const value_type& operator*() const;
      |       ^~~~~~~~~~
p1652.cpp:203:7: error: 'value_type' does not name a type
  203 | const value_type* operator->() const;
      |       ^~~~~~~~~~
p1652.cpp:206:1: error: 'regex_token_iterator' does not name a type
  206 | regex_token_iterator& operator++();
      | ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:211:2: error: expected unqualified-id before 'this'
  211 | *this regex_token_iterator& operator++(int);
      |  ^~~~

$ g++ p1652.cpp -std=2b -o p1652g -I. -Wall
p1652.cpp:20:33: error: 'regex_traits' does not name a type
   20 |                  class traits = regex_traits<charT>>
      |                                 ^~~~~~~~~~~~
p1652.cpp:20:45: error: expected '>' before '<' token
   20 |                  class traits = regex_traits<charT>>
      |                                             ^
p1652.cpp:21:31: error: expected unqualified-id before '{' token
   21 |          class regex_iterator {
      |                               ^
p1652.cpp:49:7: error: 'regex_type' does not name a type
   49 | const regex_type*
      |       ^~~~~~~~~~
p1652.cpp:53:15: error: expected constructor, destructor, or type conversion before '(' token
   53 | regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |               ^
p1652.cpp:56:1: error: 'flags' does not name a type
   56 | flags;
      | ^~~~~
p1652.cpp:60:17: error: expected constructor, destructor, or type conversion before ';' token
   60 | regex_iterator();
      |                 ^
p1652.cpp:61:11: error: 'regex_constants' does not name a type
   61 |           regex_constants::match_flag_type m = regex_constants::match_default);
      |           ^~~~~~~~~~~~~~~
p1652.cpp:64:23: error: 'regex_iterator' does not name a type
   64 | bool operator==(const regex_iterator& right) const;
      |                       ^~~~~~~~~~~~~~
p1652.cpp:64:46: error: non-member function 'bool operator==(const int&)' cannot have cv-qualifier
   64 | bool operator==(const regex_iterator& right) const;
      |                                              ^~~~~
p1652.cpp:64:6: error: 'bool operator==(const int&)' must have an argument of class or enumerated type
   64 | bool operator==(const regex_iterator& right) const;
      |      ^~~~~~~~
p1652.cpp:73:7: error: 'value_type' does not name a type
   73 | const value_type& operator*() const;
      |       ^~~~~~~~~~
p1652.cpp:75:7: error: 'value_type' does not name a type
   75 | const value_type* operator->() const;
      |       ^~~~~~~~~~
p1652.cpp:78:1: error: 'regex_iterator' does not name a type
   78 | regex_iterator& operator++();
      | ^~~~~~~~~~~~~~
p1652.cpp:80:15: error: expected constructor, destructor, or type conversion before '(' token
   80 |   regex_search(start, end, match, *pregex,
      |               ^
p1652.cpp:88:8: error: 'regex_iterator' does not name a type
   88 |        regex_iterator tmp = *this;
      |        ^~~~~~~~~~~~~~
p1652.cpp:89:8: error: expected unqualified-id before '++' token
   89 |        ++(*this);
      |        ^~
p1652.cpp:90:8: error: expected unqualified-id before 'return'
   90 |        return tmp;
      |        ^~~~~~
p1652.cpp:102:33: error: 'regex_traits' does not name a type
  102 |                  class traits = regex_traits<charT>>
      |                                 ^~~~~~~~~~~~
p1652.cpp:102:45: error: expected '>' before '<' token
  102 |                  class traits = regex_traits<charT>>
      |                                             ^
p1652.cpp:103:37: error: expected unqualified-id before '{' token
  103 |          class regex_token_iterator {
      |                                     ^
p1652.cpp:111:33: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
  111 | using reference         = const value_type&;
      |                                 ^~~~~~~~~~
p1652.cpp:111:32: error: expected ';' before 'value_type'
  111 | using reference         = const value_type&;
      |                                ^~~~~~~~~~~
      |                                ;
p1652.cpp:112:23: error: expected constructor, destructor, or type conversion before ';' token
  112 | regex_token_iterator();
      |                       ^
p1652.cpp:113:21: error: expected constructor, destructor, or type conversion before '(' token
  113 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:118:21: error: expected constructor, destructor, or type conversion before '(' token
  118 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:123:21: error: expected constructor, destructor, or type conversion before '(' token
  123 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:129:23: error: expected constructor, destructor, or type conversion before '(' token
  129 |   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                       ^
p1652.cpp:134:21: error: expected constructor, destructor, or type conversion before '(' token
  134 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:139:21: error: expected constructor, destructor, or type conversion before '(' token
  139 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:144:21: error: expected constructor, destructor, or type conversion before '(' token
  144 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:150:21: error: expected constructor, destructor, or type conversion before '(' token
  150 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:155:28: error: 'regex_token_iterator' does not name a type
  155 | regex_token_iterator(const regex_token_iterator&);
      |                            ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:155:50: error: expected constructor, destructor, or type conversion before ';' token
  155 | regex_token_iterator(const regex_token_iterator&);
      |                                                  ^
p1652.cpp:156:1: error: 'regex_token_iterator' does not name a type
  156 | regex_token_iterator& operator=(const regex_token_iterator&);
      | ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:157:23: error: 'regex_token_iterator' does not name a type
  157 | bool operator==(const regex_token_iterator&) const;
      |                       ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:157:46: error: non-member function 'bool operator==(const int&)' cannot have cv-qualifier
  157 | bool operator==(const regex_token_iterator&) const;
      |                                              ^~~~~
p1652.cpp:157:6: error: 'bool operator==(const int&)' must have an argument of class or enumerated type
  157 | bool operator==(const regex_token_iterator&) const;
      |      ^~~~~~~~
p1652.cpp:158:7: error: 'value_type' does not name a type
  158 | const value_type& operator*() const;
      |       ^~~~~~~~~~
p1652.cpp:159:7: error: 'value_type' does not name a type
  159 | const value_type* operator->() const;
      |       ^~~~~~~~~~
p1652.cpp:160:3: error: 'regex_token_iterator' does not name a type
  160 |   regex_token_iterator& operator++();
      |   ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:161:3: error: 'regex_token_iterator' does not name a type
  161 |   regex_token_iterator operator++(int);
      |   ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:162:1: error: expected unqualified-id before 'private'
  162 | private:
      | ^~~~~~~
p1652.cpp:165:3: error: 'position_iterator' does not name a type
  165 |   position_iterator position;
      |   ^~~~~~~~~~~~~~~~~
p1652.cpp:166:9: error: 'value_type' does not name a type
  166 |   const value_type* result;
      |         ^~~~~~~~~~
p1652.cpp:167:3: error: 'value_type' does not name a type
  167 |   value_type suffix;
      |   ^~~~~~~~~~
p1652.cpp:172:25: error: 'regex_type' does not name a type
  172 |                   const regex_type& re,
      |                         ^~~~~~~~~~
p1652.cpp:182:23: error: expected constructor, destructor, or type conversion before ';' token
  182 | regex_token_iterator();
      |                       ^
p1652.cpp:183:21: error: expected constructor, destructor, or type conversion before '(' token
  183 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:187:21: error: expected constructor, destructor, or type conversion before '(' token
  187 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:191:21: error: expected constructor, destructor, or type conversion before '(' token
  191 | regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                     ^
p1652.cpp:196:23: error: expected constructor, destructor, or type conversion before '(' token
  196 |   regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b,
      |                       ^
p1652.cpp:201:7: error: 'value_type' does not name a type
  201 | const value_type& operator*() const;
      |       ^~~~~~~~~~
p1652.cpp:203:7: error: 'value_type' does not name a type
  203 | const value_type* operator->() const;
      |       ^~~~~~~~~~
p1652.cpp:206:1: error: 'regex_token_iterator' does not name a type
  206 | regex_token_iterator& operator++();
      | ^~~~~~~~~~~~~~~~~~~~
p1652.cpp:211:2: error: expected unqualified-id before 'this'
  211 | *this regex_token_iterator& operator++(int);
      |  ^~~~

検討事項(agenda)

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

応用例1 AUTOSAR C++

AUTOSARでC++のコーディング標準を作っている。 
MISRA-C++コーディング標準の改訂をまたずに、C++14に対応したかったためかもしれない。 

Autosar Guidelines C++14 example code compile list

MISRA C++, AUTOSAR C++について

応用例2 MISRA C/C++

MISRA C まとめ #include

MISRA C++ 5-0-16

応用例3 CERT C/C++

SEI CERT C++ Coding Standard AA. Bibliography 確認中。

MISRA C/C++, AUTOSAR C++, CERT C/C++とC/C++工業標準をコンパイルする

応用例4 箱庭 

箱庭もくもく会

第11回 未定

箱庭ではUnityをはじめC++を使っているらしい。 

ここでコンパイルしたコードと同じようなコードを使っているか、
ここで出たコンパイルエラーと同じようなエラーがでたかを
いろいろな版のコンパイラでコンパイルして確認していく。

この項目は、箱庭プロジェクトを市場分析の対象として、原則的には、箱庭プロジェクトの外部から分析し、外部から箱庭の広告宣伝のための戦略会議を仮想した結果、仮想「箱庭もくもく会」を開催してみることを企画するものである。 
一切の内容は、箱庭プロジェクト、Athrill, TOPPERSとは無関係である。 
一(いち)参加データアナリストの、個人的なつぶやきです。

仮想戦略会議「箱庭」

お盆には「箱庭」記事を書きましょう「もくもく会」の題材になる(1)

お盆には「箱庭」記事を書きましょう「もくもく会」の題材になる(2)

自己参考資料(self 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 使ってみた

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

文書履歴(document history)

ver. 0.01 初稿  20220920

0
0
0

Register as a new user and use Qiita more conveniently

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