LoginSignup
0
0

More than 1 year has passed since last update.

32.7 Class template basic_regex [re.regex] C++N4910:2022 (702) p1637.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.7 Class template basic_regex [re.regex] C++N4910:2022 (702) p1637.cpp

算譜(source code)

p1637.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.7 Class template basic_regex [re.regex] C++N4910:2022 (702) p1637.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.7.1 General [re.regex.general]
//  For a char-like type charT, specializations of class template basic_regex represent regular expressions constructed from character sequences of charT characters. In the rest of 32.7, charT denotes a given char-like type. Storage for a regular expression is allocated and freed as necessary by the member functions of class basic_regex.
// Objects of type specialization of basic_regex are responsible for converting the sequence of charT objects to an internal representation. It is not specified what form this representation takes, nor how it is accessed by algorithms that operate on regular expressions.
// [Note 1: Implementations will typically declare some function templates as friends of basic_regex to achieve this.
// The functions described in 32.7 report errors by throwing exceptions of type regex_error.
namespace std {
template<class charT, class traits = regex_traits<charT>>
class basic_regex {
public:
// types
    using value_type  =          charT;
    using traits_type =          traits;
    using string_type = typename traits::string_type;
    using flag_type   =          regex_constants::syntax_option_type;
    using locale_type = typename traits::locale_type;
// 32.4.2, constants
    static constexpr flag_type icase = regex_constants::icase;
    static constexpr flag_type nosubs = regex_constants::nosubs;
    static constexpr flag_type optimize = regex_constants::optimize;
    static constexpr flag_type collate = regex_constants::collate;
    static constexpr flag_type ECMAScript = regex_constants::ECMAScript;
    static constexpr flag_type basic = regex_constants::basic;
    static constexpr flag_type extended = regex_constants::extended;
    static constexpr flag_type awk = regex_constants::awk;
    static constexpr flag_type grep = regex_constants::grep;
    static constexpr flag_type egrep = regex_constants::egrep;
    static constexpr flag_type multiline = regex_constants::multiline;
// 32.7.2, construct/copy/destroy
    basic_regex();
    explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
    basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
    basic_regex(const basic_regex&);
    basic_regex(basic_regex&&) noexcept;
    template<class ST, class SA>
    explicit basic_regex(const basic_string<charT, ST, SA>& s,
                         flag_type f = regex_constants::ECMAScript);
    template<class ForwardIterator>
    basic_regex(ForwardIterator first, ForwardIterator last,
                flag_type f = regex_constants::ECMAScript);
    basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
    ~basic_regex();
// 32.7.3, assign
    basic_regex& operator=(const basic_regex& e);
    basic_regex& operator=(basic_regex&& e) noexcept;
    basic_regex& operator=(const charT* p);
    basic_regex& operator=(initializer_list<charT> il);
    template<class ST, class SA>
    basic_regex& operator=(const basic_string<charT, ST, SA>& s);
    basic_regex& assign(const basic_regex& e);
    basic_regex& assign(basic_regex&& e) noexcept;
    basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript);
    basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
    template<class ST, class SA>
    basic_regex& assign(const basic_string<charT, ST, SA>& s,
                        flag_type f = regex_constants::ECMAScript);
// Postconditions: *this does not match any character sequence.
    template<class InputIterator>
    basic_regex& assign(InputIterator first, InputIterator last,
                        flag_type f = regex_constants::ECMAScript);
    basic_regex& assign(initializer_list<charT>,
                        flag_type f = regex_constants::ECMAScript);
// 32.7.4, const operations
    unsigned mark_count() const;
    flag_type flags() const;
// 32.7.5, locale
    locale_type imbue(locale_type loc);
    locale_type getloc() const;
// 32.7.6, swap
    void swap(basic_regex&);
};
template<class ForwardIterator>
basic_regex(ForwardIterator, ForwardIterator,
            regex_constants::syntax_option_type = regex_constants::ECMAScript)
-> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
}
// 32.7.2 Constructors [re.regex.construct]
basic_regex();
explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
// Preconditions: [p, p + char_traits<charT>::length(p)) is a valid range.
// Effects: The object’s internal finite state machine is constructed from the regular expression contained in the sequence of characters [p, p + char_traits<charT>::length(p)), and interpreted according to the flags f.
// Postconditions: flags() returns f. mark_count() returns the number of marked sub-expressions within the expression.
// Throws: regex_error if [p, p + char_traits<charT>::length(p)) is not a valid regular expression.
basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
// Preconditions: [p, p + len) is a valid range.
// Effects: The object’s internal finite state machine is constructed from the regular expression contained in the sequence of characters [p, p + len), and interpreted according the flags specified in f. Postconditions: flags() returns f. mark_count() returns the number of marked sub-expressions within the expression.
// Throws: regex_error if [p, p + len) is not a valid regular expression.
basic_regex(const basic_regex& e);
// Postconditions: flags() and mark_count() return e.flags() and e.mark_count(), respectively.
basic_regex(basic_regex&& e) noexcept;
// Postconditions: flags() and mark_count() return the values that e.flags() and e.mark_count(), respectively, had before construction.
template<class ST, class SA>
explicit basic_regex(const basic_string<charT, ST, SA>& s,
                     flag_type f = regex_constants::ECMAScript);
// Effects: The object’s internal finite state machine is constructed from the regular expression contained in the string s, and interpreted according to the flags specified in f.
// Postconditions: flags() returns f. mark_count() returns the number of marked sub-expressions within the expression.
// Throws: regex_error if s is not a valid regular expression.
template<class ForwardIterator>
basic_regex(ForwardIterator first, ForwardIterator last,
            flag_type f = regex_constants::ECMAScript);
// Effects: The object’s internal finite state machine is constructed from the regular expression contained in the sequence of characters [first, last), and interpreted according to the flags specified in f.
// Postconditions: flags() returns f. mark_count() returns the number of marked sub-expressions within the expression.
// Throws: regex_error if the sequence [first, last) is not a valid regular expression.
basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
// Effects: Same as basic_regex(il.begin(), il.end(), f).
// 32.7.3 Assignment [re.regex.assign]
basic_regex& operator=(const basic_regex& e);
// Postconditions: flags() and mark_count() return e.flags() and e.mark_count(), respectively.
basic_regex& operator=(basic_regex&& e) noexcept;
// Postconditions: flags() and mark_count() return the values that e.flags() and e.mark_count(), respectively, had before assignment. e is in a valid state with unspecified value.
basic_regex& operator=(const charT* p);
// Effects: Equivalent to:
return assign(p);
basic_regex& operator=(initializer_list<charT> il);
// Effects: Equivalent to:
return assign(il.begin(), il.end());
template<class ST, class SA>
basic_regex& operator=(const basic_string<charT, ST, SA>& s);
// Effects: Equivalent to:
return assign(s);
basic_regex& assign(const basic_regex& e);
// Effects: Equivalent to:
return *this = e;
basic_regex& assign(basic_regex&& e) noexcept;
// Effects: Equivalent to:
return *this = std::move(e);
basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript);
// Effects: Equivalent to:
return assign(string_type(p), f);
basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
// Effects: Equivalent to:
return assign(string_type(p, len), f);
template<class ST, class SA>
basic_regex& assign(const basic_string<charT, ST, SA>& s,
                    flag_type f = regex_constants::ECMAScript);
// Effects: Assigns the regular expression contained in the string s, interpreted according the flags specified in f. If an exception is thrown, *this is unchanged.
// Postconditions: If no exception is thrown, flags() returns f and mark_count() returns the number of marked sub-expressions within the expression.
// Returns: *this.
// Throws: regex_error if s is not a valid regular expression.
template<class InputIterator>
basic_regex& assign(InputIterator first, InputIterator last,
                    flag_type f = regex_constants::ECMAScript);
// Effects: Equivalent to:
return assign(string_type(first, last), f);
basic_regex& assign(initializer_list<charT> il,
                    flag_type f = regex_constants::ECMAScript);
// Effects: Equivalent to: return assign(il.begin(), il.end(), f); 32.7.4 Constant operations
unsigned mark_count() const;
[re.regex.operations]
// Effects: Returns the number of marked sub-expressions within the regular expression.
flag_type flags() const;
// Effects: Returns a copy of the regular expression syntax flags that were passed to the object’s constructor or to the last call to assign.
// 32.7.5 Locale [re.regex.locale]
locale_type imbue(locale_type loc);
// Effects: Returns the result of traits_inst.imbue(loc) where traits_inst is a (default-initialized) instance of the template type argument traits stored within the object. After a call to imbue the basic_regex object does not match any character sequence.
locale_type getloc() const;
// Effects: Returns the result of traits_inst.getloc() where traits_inst is a (default-initialized) instance of the template parameter traits stored within the object.
// 32.7.6 Swap [re.regex.swap]
void swap(basic_regex& e);
// Effects: Swaps the contents of the two regular expressions.
// Postconditions: *this contains the regular expression that was in e, e contains the regular expression that was in *this. Complexity: Constant time.
// 32.7.7 Non-member functions [re.regex.nonmemb]
template<class charT, class traits>
void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
// Effects: Calls lhs.swap(rhs).
int main() {
    cout  <<  n4910 << endl;
    return EXIT_SUCCESS;
}

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

bash
$ clang++ p1637.cpp -std=03 -o p1637l -I. -Wall
In file included from p1637.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 \
 ^
p1637.cpp:20:61: error: a space is required between consecutive right angle brackets (use '> >')
     template<class charT, class traits = regex_traits<charT>>
                                                            ^~
                                                            > >
p1637.cpp:20:43: error: no template named 'regex_traits'
     template<class charT, class traits = regex_traits<charT>>
                                          ^
p1637.cpp:24:39: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
         using value_type  =          charT;
                                      ^
p1637.cpp:25:39: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
         using traits_type =          traits;
                                      ^
p1637.cpp:26:30: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
         using string_type = typename traits::string_type;
                             ^
p1637.cpp:27:39: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
         using flag_type   =          regex_constants::syntax_option_type;
                                      ^
p1637.cpp:27:39: error: use of undeclared identifier 'regex_constants'
p1637.cpp:28:30: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
         using locale_type = typename traits::locale_type;
                             ^
p1637.cpp:30:8: error: unknown type name 'constexpr'
static constexpr flag_type icase = regex_constants::icase;
       ^
p1637.cpp:30:27: error: expected ';' at end of declaration list
static constexpr flag_type icase = regex_constants::icase;
                          ^
                          ;
p1637.cpp:31:8: error: unknown type name 'constexpr'
static constexpr flag_type nosubs = regex_constants::nosubs;
       ^
p1637.cpp:31:27: error: expected ';' at end of declaration list
static constexpr flag_type nosubs = regex_constants::nosubs;
                          ^
                          ;
p1637.cpp:32:8: error: unknown type name 'constexpr'
static constexpr flag_type optimize = regex_constants::optimize; 
       ^
p1637.cpp:32:27: error: expected ';' at end of declaration list
static constexpr flag_type optimize = regex_constants::optimize; 
                          ^
                          ;
p1637.cpp:33:8: error: unknown type name 'constexpr'
static constexpr flag_type collate = regex_constants::collate; 
       ^
p1637.cpp:33:27: error: expected ';' at end of declaration list
static constexpr flag_type collate = regex_constants::collate; 
                          ^
                          ;
p1637.cpp:34:8: error: unknown type name 'constexpr'
static constexpr flag_type ECMAScript = regex_constants::ECMAScript; 
       ^
p1637.cpp:34:27: error: expected ';' at end of declaration list
static constexpr flag_type ECMAScript = regex_constants::ECMAScript; 
                          ^
                          ;
p1637.cpp:35:8: error: unknown type name 'constexpr'
static constexpr flag_type basic = regex_constants::basic;
       ^
p1637.cpp:35:27: error: expected ';' at end of declaration list
static constexpr flag_type basic = regex_constants::basic;
                          ^
                          ;
p1637.cpp:36:8: error: unknown type name 'constexpr'
static constexpr flag_type extended = regex_constants::extended; 
       ^
p1637.cpp:36:27: error: expected ';' at end of declaration list
static constexpr flag_type extended = regex_constants::extended; 
                          ^
                          ;
p1637.cpp:37:8: error: unknown type name 'constexpr'
static constexpr flag_type awk = regex_constants::awk;
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
$ clang++ p1637.cpp -std=2b -o p1637l -I. -Wall
p1637.cpp:20:43: error: no template named 'regex_traits'
     template<class charT, class traits = regex_traits<charT>>
                                          ^
p1637.cpp:27:39: error: use of undeclared identifier 'regex_constants'
         using flag_type   =          regex_constants::syntax_option_type;
                                      ^
p1637.cpp:30:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type icase = regex_constants::icase;
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:30:36: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type icase = regex_constants::icase;
                                   ^
p1637.cpp:31:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type nosubs = regex_constants::nosubs;
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:31:37: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type nosubs = regex_constants::nosubs;
                                    ^
p1637.cpp:32:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type optimize = regex_constants::optimize; 
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:32:39: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type optimize = regex_constants::optimize; 
                                      ^
p1637.cpp:33:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type collate = regex_constants::collate; 
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:33:38: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type collate = regex_constants::collate; 
                                     ^
p1637.cpp:34:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type ECMAScript = regex_constants::ECMAScript; 
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:34:41: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type ECMAScript = regex_constants::ECMAScript; 
                                        ^
p1637.cpp:35:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type basic = regex_constants::basic;
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:35:36: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type basic = regex_constants::basic;
                                   ^
p1637.cpp:36:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type extended = regex_constants::extended; 
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:36:39: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type extended = regex_constants::extended; 
                                      ^
p1637.cpp:37:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type awk = regex_constants::awk;
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
p1637.cpp:37:34: error: use of undeclared identifier 'regex_constants'
static constexpr flag_type awk = regex_constants::awk;
                                 ^
p1637.cpp:38:18: error: unknown type name 'flag_type'; did you mean 'false_type'?
static constexpr flag_type grep = regex_constants::grep;
                 ^~~~~~~~~
                 false_type
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/type_traits:78:45: note: 'false_type' declared here
  typedef integral_constant<bool, false>    false_type;
                                            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

$ g++ p1637.cpp -std=03 -o p1637g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
                 from N4910.h:11,
                 from p1637.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 \
      |  ^~~~~
p1637.cpp:30:8: warning: identifier 'constexpr' is a keyword in C++11 [-Wc++11-compat]
   30 | static constexpr flag_type icase = regex_constants::icase;
      |        ^~~~~~~~~
p1637.cpp:46:28: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
   46 | basic_regex(basic_regex&&) noexcept;
      |                            ^~~~~~~~
p1637.cpp:20:43: error: 'regex_traits' does not name a type
   20 |      template<class charT, class traits = regex_traits<charT>>
      |                                           ^~~~~~~~~~~~
p1637.cpp:20:55: error: expected '>' before '<' token
   20 |      template<class charT, class traits = regex_traits<charT>>
      |                                                       ^
p1637.cpp:21:26: error: expected unqualified-id before '{' token
   21 |        class basic_regex {
      |                          ^
p1637.cpp:85:19: error: 'regex_constants' has not been declared
   85 |                   regex_constants::syntax_option_type = regex_constants::ECMAScript)
      |                   ^~~~~~~~~~~~~~~
p1637.cpp:85:57: error: 'regex_constants' has not been declared
   85 |                   regex_constants::syntax_option_type = regex_constants::ECMAScript)
      |                                                         ^~~~~~~~~~~~~~~
p1637.cpp:86:12: error: 'basic_regex' does not name a type
   86 |         -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
      |            ^~~~~~~~~~~
p1637.cpp:86:23: error: expected constructor, destructor, or type conversion before '<' token
   86 |         -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
      |                       ^
p1637.cpp:89:14: error: expected constructor, destructor, or type conversion before ';' token
   89 | basic_regex();
      |              ^
p1637.cpp:90:28: error: 'charT' does not name a type; did you mean 'char'?
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |                            ^~~~~
      |                            char
p1637.cpp:90:38: error: 'flag_type' has not been declared
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |                                      ^~~~~~~~~
p1637.cpp:90:52: error: 'regex_constants' has not been declared
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |                                                    ^~~~~~~~~~~~~~~
p1637.cpp:90:10: error: ISO C++ forbids declaration of 'basic_regex' with no type [-fpermissive]
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |          ^~~~~~~~~~~
p1637.cpp:90:1: error: 'explicit' outside class declaration
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      | ^~~~~~~~
p1637.cpp:95:19: error: 'charT' does not name a type; did you mean 'char'?
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                   ^~~~~
      |                   char
p1637.cpp:95:41: error: 'flag_type' has not been declared
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                                         ^~~~~~~~~
p1637.cpp:95:55: error: 'regex_constants' has not been declared
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                                                       ^~~~~~~~~~~~~~~
p1637.cpp:95:83: error: expected constructor, destructor, or type conversion before ';' token
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                                                                                   ^
p1637.cpp:99:19: error: 'basic_regex' does not name a type
   99 | basic_regex(const basic_regex& e);
      |                   ^~~~~~~~~~~
p1637.cpp:99:34: error: expected constructor, destructor, or type conversion before ';' token
   99 | basic_regex(const basic_regex& e);
      |                                  ^
p1637.cpp:101:12: error: expected constructor, destructor, or type conversion before '(' token
  101 | basic_regex(basic_regex&& e) noexcept;
      |            ^
p1637.cpp:104:43: error: 'charT' was not declared in this scope; did you mean 'char'?
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |                                           ^~~~~
      |                                           char
p1637.cpp:104:56: error: template argument 1 is invalid
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |                                                        ^
p1637.cpp:105:19: error: 'flag_type' has not been declared
  105 |                   flag_type f = regex_constants::ECMAScript);
      |                   ^~~~~~~~~
p1637.cpp:105:33: error: 'regex_constants' has not been declared
  105 |                   flag_type f = regex_constants::ECMAScript);
      |                                 ^~~~~~~~~~~~~~~
p1637.cpp:104:12: error: ISO C++ forbids declaration of 'basic_regex' with no type [-fpermissive]
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |            ^~~~~~~~~~~
p1637.cpp:104:3: error: 'explicit' outside class declaration
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |   ^~~~~~~~
p1637.cpp:111:10: error: 'flag_type' has not been declared
  111 |          flag_type f = regex_constants::ECMAScript);
      |          ^~~~~~~~~
p1637.cpp:111:24: error: 'regex_constants' has not been declared
  111 |          flag_type f = regex_constants::ECMAScript);
      |                        ^~~~~~~~~~~~~~~
p1637.cpp:111:52: error: expected constructor, destructor, or type conversion before ';' token
  111 |          flag_type f = regex_constants::ECMAScript);
      |                                                    ^
p1637.cpp:115:12: error: expected constructor, destructor, or type conversion before '(' token
  115 | basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
      |            ^
p1637.cpp:118:1: error: 'basic_regex' does not name a type
  118 | basic_regex& operator=(const basic_regex& e);
      | ^~~~~~~~~~~
p1637.cpp:120:1: error: 'basic_regex' does not name a type
  120 | basic_regex& operator=(basic_regex&& e) noexcept;
      | ^~~~~~~~~~~
p1637.cpp:122:1: error: 'basic_regex' does not name a type
  122 | basic_regex& operator=(const charT* p);
      | ^~~~~~~~~~~
p1637.cpp:124:1: error: expected unqualified-id before 'return'
  124 | return assign(p);
      | ^~~~~~
p1637.cpp:125:1: error: 'basic_regex' does not name a type
  125 | basic_regex& operator=(initializer_list<charT> il);
      | ^~~~~~~~~~~
p1637.cpp:127:1: error: expected unqualified-id before 'return'
  127 | return assign(il.begin(), il.end());
      | ^~~~~~
p1637.cpp:129:3: error: 'basic_regex' does not name a type
  129 |   basic_regex& operator=(const basic_string<charT, ST, SA>& s);
      |   ^~~~~~~~~~~
p1637.cpp:131:1: error: expected unqualified-id before 'return'
  131 | return assign(s);
      | ^~~~~~
p1637.cpp:132:1: error: 'basic_regex' does not name a type
  132 | basic_regex& assign(const basic_regex& e);
      | ^~~~~~~~~~~
p1637.cpp:134:1: error: expected unqualified-id before 'return'
  134 | return *this = e; basic_regex& assign(basic_regex&& e) noexcept;
      | ^~~~~~
p1637.cpp:134:19: error: 'basic_regex' does not name a type
  134 | return *this = e; basic_regex& assign(basic_regex&& e) noexcept;
      |                   ^~~~~~~~~~~
p1637.cpp:136:1: error: expected unqualified-id before 'return'
  136 | return *this = std::move(e);
      | ^~~~~~
p1637.cpp:137:1: error: 'basic_regex' does not name a type
  137 | basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript);
      | ^~~~~~~~~~~
p1637.cpp:139:1: error: expected unqualified-id before 'return'
  139 | return assign(string_type(p), f);
      | ^~~~~~
p1637.cpp:140:1: error: 'basic_regex' does not name a type
  140 | basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      | ^~~~~~~~~~~
p1637.cpp:142:1: error: expected unqualified-id before 'return'
  142 | return assign(string_type(p, len), f);
      | ^~~~~~
p1637.cpp:144:3: error: 'basic_regex' does not name a type
  144 |   basic_regex& assign(const basic_string<charT, ST, SA>& s,
      |   ^~~~~~~~~~~
p1637.cpp:151:3: error: 'basic_regex' does not name a type
  151 |   basic_regex& assign(InputIterator first, InputIterator last,
      |   ^~~~~~~~~~~
p1637.cpp:154:1: error: expected unqualified-id before 'return'
  154 | return assign(string_type(first, last), f);
      | ^~~~~~
p1637.cpp:155:1: error: 'basic_regex' does not name a type
  155 | basic_regex& assign(initializer_list<charT> il,
      | ^~~~~~~~~~~
p1637.cpp:158:23: error: non-member function 'unsigned int mark_count()' cannot have cv-qualifier
  158 | unsigned mark_count() const;
      |                       ^~~~~
p1637.cpp:159:1: error: expected unqualified-id before '[' token
  159 | [re.regex.operations]
      | ^
p1637.cpp:164:1: error: 'locale_type' does not name a type; did you mean 'locale_t'?
  164 | locale_type imbue(locale_type loc);
      | ^~~~~~~~~~~
      | locale_t
p1637.cpp:166:1: error: 'locale_type' does not name a type; did you mean 'locale_t'?
  166 | locale_type getloc() const;
      | ^~~~~~~~~~~
      | locale_t
p1637.cpp:169:6: error: variable or field 'swap' declared void
  169 | void swap(basic_regex& e);
      |      ^~~~
p1637.cpp:169:24: error: 'e' was not declared in this scope
  169 | void swap(basic_regex& e);
      |                        ^
p1637.cpp:174:8: error: variable or field 'swap' declared void
  174 |   void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
      |        ^~~~
p1637.cpp:174:41: error: 'lhs' was not declared in this scope
  174 |   void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
      |                                         ^~~
p1637.cpp:174:74: error: 'rhs' was not declared in this scope
  174 |   void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
      |                                                                          ^~~

$ g++ p1637.cpp -std=2b -o p1637g -I. -Wall
p1637.cpp:20:43: error: 'regex_traits' does not name a type
   20 |      template<class charT, class traits = regex_traits<charT>>
      |                                           ^~~~~~~~~~~~
p1637.cpp:20:55: error: expected '>' before '<' token
   20 |      template<class charT, class traits = regex_traits<charT>>
      |                                                       ^
p1637.cpp:21:26: error: expected unqualified-id before '{' token
   21 |        class basic_regex {
      |                          ^
p1637.cpp:85:19: error: 'regex_constants' has not been declared
   85 |                   regex_constants::syntax_option_type = regex_constants::ECMAScript)
      |                   ^~~~~~~~~~~~~~~
p1637.cpp:85:57: error: 'regex_constants' has not been declared
   85 |                   regex_constants::syntax_option_type = regex_constants::ECMAScript)
      |                                                         ^~~~~~~~~~~~~~~
p1637.cpp:86:12: error: 'basic_regex' does not name a type
   86 |         -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
      |            ^~~~~~~~~~~
p1637.cpp:86:23: error: expected constructor, destructor, or type conversion before '<' token
   86 |         -> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
      |                       ^
p1637.cpp:89:14: error: expected constructor, destructor, or type conversion before ';' token
   89 | basic_regex();
      |              ^
p1637.cpp:90:28: error: 'charT' does not name a type; did you mean 'char'?
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |                            ^~~~~
      |                            char
p1637.cpp:90:38: error: 'flag_type' has not been declared
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |                                      ^~~~~~~~~
p1637.cpp:90:52: error: 'regex_constants' has not been declared
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |                                                    ^~~~~~~~~~~~~~~
p1637.cpp:90:10: error: ISO C++ forbids declaration of 'basic_regex' with no type [-fpermissive]
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      |          ^~~~~~~~~~~
p1637.cpp:90:1: error: 'explicit' outside class declaration
   90 | explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
      | ^~~~~~~~
p1637.cpp:95:19: error: 'charT' does not name a type; did you mean 'char'?
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                   ^~~~~
      |                   char
p1637.cpp:95:41: error: 'flag_type' has not been declared
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                                         ^~~~~~~~~
p1637.cpp:95:55: error: 'regex_constants' has not been declared
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                                                       ^~~~~~~~~~~~~~~
p1637.cpp:95:83: error: expected constructor, destructor, or type conversion before ';' token
   95 | basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      |                                                                                   ^
p1637.cpp:99:19: error: 'basic_regex' does not name a type
   99 | basic_regex(const basic_regex& e);
      |                   ^~~~~~~~~~~
p1637.cpp:99:34: error: expected constructor, destructor, or type conversion before ';' token
   99 | basic_regex(const basic_regex& e);
      |                                  ^
p1637.cpp:101:12: error: expected constructor, destructor, or type conversion before '(' token
  101 | basic_regex(basic_regex&& e) noexcept;
      |            ^
p1637.cpp:104:43: error: 'charT' was not declared in this scope; did you mean 'char'?
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |                                           ^~~~~
      |                                           char
p1637.cpp:104:56: error: template argument 1 is invalid
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |                                                        ^
p1637.cpp:105:19: error: 'flag_type' has not been declared
  105 |                   flag_type f = regex_constants::ECMAScript);
      |                   ^~~~~~~~~
p1637.cpp:105:33: error: 'regex_constants' has not been declared
  105 |                   flag_type f = regex_constants::ECMAScript);
      |                                 ^~~~~~~~~~~~~~~
p1637.cpp:104:12: error: ISO C++ forbids declaration of 'basic_regex' with no type [-fpermissive]
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |            ^~~~~~~~~~~
p1637.cpp:104:3: error: 'explicit' outside class declaration
  104 |   explicit basic_regex(const basic_string<charT, ST, SA>& s,
      |   ^~~~~~~~
p1637.cpp:111:10: error: 'flag_type' has not been declared
  111 |          flag_type f = regex_constants::ECMAScript);
      |          ^~~~~~~~~
p1637.cpp:111:24: error: 'regex_constants' has not been declared
  111 |          flag_type f = regex_constants::ECMAScript);
      |                        ^~~~~~~~~~~~~~~
p1637.cpp:111:52: error: expected constructor, destructor, or type conversion before ';' token
  111 |          flag_type f = regex_constants::ECMAScript);
      |                                                    ^
p1637.cpp:115:30: error: 'charT' was not declared in this scope; did you mean 'char'?
  115 | basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
      |                              ^~~~~
      |                              char
p1637.cpp:115:35: error: template argument 1 is invalid
  115 | basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
      |                                   ^
p1637.cpp:115:41: error: 'flag_type' has not been declared
  115 | basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
      |                                         ^~~~~~~~~
p1637.cpp:115:55: error: 'regex_constants' has not been declared
  115 | basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
      |                                                       ^~~~~~~~~~~~~~~
p1637.cpp:115:83: error: expected constructor, destructor, or type conversion before ';' token
  115 | basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
      |                                                                                   ^
p1637.cpp:118:1: error: 'basic_regex' does not name a type
  118 | basic_regex& operator=(const basic_regex& e);
      | ^~~~~~~~~~~
p1637.cpp:120:1: error: 'basic_regex' does not name a type
  120 | basic_regex& operator=(basic_regex&& e) noexcept;
      | ^~~~~~~~~~~
p1637.cpp:122:1: error: 'basic_regex' does not name a type
  122 | basic_regex& operator=(const charT* p);
      | ^~~~~~~~~~~
p1637.cpp:124:1: error: expected unqualified-id before 'return'
  124 | return assign(p);
      | ^~~~~~
p1637.cpp:125:1: error: 'basic_regex' does not name a type
  125 | basic_regex& operator=(initializer_list<charT> il);
      | ^~~~~~~~~~~
p1637.cpp:127:1: error: expected unqualified-id before 'return'
  127 | return assign(il.begin(), il.end());
      | ^~~~~~
p1637.cpp:129:3: error: 'basic_regex' does not name a type
  129 |   basic_regex& operator=(const basic_string<charT, ST, SA>& s);
      |   ^~~~~~~~~~~
p1637.cpp:131:1: error: expected unqualified-id before 'return'
  131 | return assign(s);
      | ^~~~~~
p1637.cpp:132:1: error: 'basic_regex' does not name a type
  132 | basic_regex& assign(const basic_regex& e);
      | ^~~~~~~~~~~
p1637.cpp:134:1: error: expected unqualified-id before 'return'
  134 | return *this = e; basic_regex& assign(basic_regex&& e) noexcept;
      | ^~~~~~
p1637.cpp:134:19: error: 'basic_regex' does not name a type
  134 | return *this = e; basic_regex& assign(basic_regex&& e) noexcept;
      |                   ^~~~~~~~~~~
p1637.cpp:136:1: error: expected unqualified-id before 'return'
  136 | return *this = std::move(e);
      | ^~~~~~
p1637.cpp:137:1: error: 'basic_regex' does not name a type
  137 | basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript);
      | ^~~~~~~~~~~
p1637.cpp:139:1: error: expected unqualified-id before 'return'
  139 | return assign(string_type(p), f);
      | ^~~~~~
p1637.cpp:140:1: error: 'basic_regex' does not name a type
  140 | basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
      | ^~~~~~~~~~~
p1637.cpp:142:1: error: expected unqualified-id before 'return'
  142 | return assign(string_type(p, len), f);
      | ^~~~~~
p1637.cpp:144:3: error: 'basic_regex' does not name a type
  144 |   basic_regex& assign(const basic_string<charT, ST, SA>& s,
      |   ^~~~~~~~~~~
p1637.cpp:151:3: error: 'basic_regex' does not name a type
  151 |   basic_regex& assign(InputIterator first, InputIterator last,
      |   ^~~~~~~~~~~
p1637.cpp:154:1: error: expected unqualified-id before 'return'
  154 | return assign(string_type(first, last), f);
      | ^~~~~~
p1637.cpp:155:1: error: 'basic_regex' does not name a type
  155 | basic_regex& assign(initializer_list<charT> il,
      | ^~~~~~~~~~~
p1637.cpp:158:23: error: non-member function 'unsigned int mark_count()' cannot have cv-qualifier
  158 | unsigned mark_count() const;
      |                       ^~~~~
p1637.cpp:159:1: error: expected unqualified-id before '[' token
  159 | [re.regex.operations]
      | ^
p1637.cpp:164:1: error: 'locale_type' does not name a type; did you mean 'locale_t'?
  164 | locale_type imbue(locale_type loc);
      | ^~~~~~~~~~~
      | locale_t
p1637.cpp:166:1: error: 'locale_type' does not name a type; did you mean 'locale_t'?
  166 | locale_type getloc() const;
      | ^~~~~~~~~~~
      | locale_t
p1637.cpp:169:6: error: variable or field 'swap' declared void
  169 | void swap(basic_regex& e);
      |      ^~~~
p1637.cpp:169:24: error: 'e' was not declared in this scope; did you mean 'std::numbers::e'?
  169 | void swap(basic_regex& e);
      |                        ^
      |                        std::numbers::e
In file included from /usr/local/include/c++/12.1.0/bits/max_size_type.h:37,
                 from /usr/local/include/c++/12.1.0/bits/ranges_base.h:38,
                 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 p1637.cpp:10:
/usr/local/include/c++/12.1.0/numbers:122:27: note: 'std::numbers::e' declared here
  122 |   inline constexpr double e = e_v<double>;
      |                           ^
p1637.cpp:174:8: error: variable or field 'swap' declared void
  174 |   void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
      |        ^~~~
p1637.cpp:174:41: error: 'lhs' was not declared in this scope
  174 |   void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
      |                                         ^~~
p1637.cpp:174:74: error: 'rhs' was not declared in this scope
  174 |   void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs);
      |                                                                          ^~~

検討事項(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