LoginSignup
0
0

More than 1 year has passed since last update.

31.7 Formatting and manipulators [iostream.format] C++N4910:2022 (690) p1514.cpp

Last updated at Posted at 2022-08-25

はじめに(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

C++N4741, 2018 Standard Working Draft on ISO/IEC 14882 sample code compile list

C++N4606, 2016符号断片編纂一覧(example code compile list)

C++N4606, 2016 Working Draft 2016, ISO/IEC 14882, C++ standard(1) Example code compile list
https://qiita.com/kaizen_nagoya/items/df5d62c35bd6ed1c3d43/

C++N3242, 2011 sample code compile list on clang++ and g++

編纂器(Compiler)

clang++ --version

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

g++- --version

g++ (GCC) 12.1.0 Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

1.7 Formatting and manipulators [iostream.format] C++N4910:2022 (690) p1514.cpp

算譜(source code)

p1514.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 = "1.7 Formatting and manipulators [iostream.format] C++N4910:2022 (690) p1514.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;

// 31.7.1 Header <istream> synopsis
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_istream;
using istream  = basic_istream<char>;
using wistream = basic_istream<wchar_t>;
template<class charT, class traits = char_traits<charT>>
class basic_iostream;
using iostream  = basic_iostream<char>;
using wiostream = basic_iostream<wchar_t>;
template<class charT, class traits>
basic_istream<charT, traits>& ws(basic_istream<charT, traits>& is);
template<class Istream, class T>
Istream&& operator>>(Istream&& is, T&& x);
[iostream.format] [istream.syn]
}
// 31.7.2 Header <ostream> synopsis [ostream.syn]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_ostream;
using ostream  = basic_ostream<char>;
using wostream = basic_ostream<wchar_t>;
template<class charT, class traits>
basic_ostream<charT, traits>& endl(basic_ostream<charT, traits>& os);
template<class charT, class traits>
basic_ostream<charT, traits>& ends(basic_ostream<charT, traits>& os);
template<class charT, class traits>
basic_ostream<charT, traits>& flush(basic_ostream<charT, traits>& os);
template<class charT, class traits>
basic_ostream<charT, traits>& emit_on_flush(basic_ostream<charT, traits>& os);
template<class charT, class traits>
basic_ostream<charT, traits>& noemit_on_flush(basic_ostream<charT, traits>& os);
template<class charT, class traits>
basic_ostream<charT, traits>& flush_emit(basic_ostream<charT, traits>& os);
template<class Ostream, class T>
Ostream&& operator<<(Ostream&& os, const T& x);
}
// 31.7.3 Header <iomanip> synopsis [iomanip.syn]
namespace std {
unspecified resetiosflags(ios_base::fmtflags mask);
unspecified setiosflags (ios_base::fmtflags mask);
//  287) Typically, overflow returns c to indicate success, except when traits::eq_int_type(c, traits::eof()) returns true, in which case it returns traits::not_eof(c).
unspecified setbase(int base);
template<class charT> unspecified setfill(charT c);
unspecified setprecision(int n);
unspecified setw(int n);
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false);
template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false);
template<class charT> unspecified get_time(tm* tmb, const charT* fmt);
template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
template<class charT>
unspecified quoted(const charT* s, charT delim = charT('"'), charT escape = charT('\\'));
template<class charT, class traits, class Allocator>
unspecified quoted(const basic_string<charT, traits, Allocator>& s,
                   charT delim = charT('"'), charT escape = charT('\\'));
template<class charT, class traits, class Allocator> unspecified quoted(basic_string<charT, traits, Allocator>& s,
        charT delim = charT('"'), charT escape = charT('\\'));
template<class charT, class traits>
unspecified quoted(basic_string_view<charT, traits> s,
                   charT delim = charT('"'), charT escape = charT('\\'));
}
// 31.7.4 Input streams [input.streams]
// 31.7.4.1 General [input.streams.general]
// template that control input from a stream buffer, along with a function template that extracts from stream rvalues.
// 31.7.4.2 Class template basic_istream [istream]
// 31.7.4.2.1 General [istream.general]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_istream : virtual public basic_ios<charT, traits> {
public:
// types (inherited from basic_ios (31.5.4))
    using char_type = charT;
    using int_type = typename traits::int_type;
    using pos_type = typename traits::pos_type;
    using off_type = typename traits::off_type;
    using traits_type = traits;
// 31.7.4.2.2, constructor/destructor
    explicit basic_istream(basic_streambuf<charT, traits>* sb);
    virtual ~basic_istream();
// 31.7.4.2.4, prefix/suffix class sentry;
// 31.7.4.3, formatted input
    basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
    basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
    basic_istream& operator>>(ios_base& (*pf)(ios_base&));
    basic_istream& operator>>(bool& n);
    basic_istream& operator>>(short& n);
    basic_istream& operator>>(unsigned short& n);
    basic_istream& operator>>(int& n);
    basic_istream& operator>>(unsigned int& n);
    basic_istream& operator>>(long& n);
    basic_istream& operator>>(unsigned long& n);
    basic_istream& operator>>(long long& n);
    basic_istream& operator>>(unsigned long long& n);
    basic_istream& operator>>(float& f);
    basic_istream& operator>>(double& f);
    basic_istream& operator>>(long double& f);
    basic_istream& operator>>(void*& p);
    basic_istream& operator>>(basic_streambuf<char_type, traits>* sb);
// 31.7.4.4, unformatted input
    streamsize gcount() const;
    int_type get();
    basic_istream& get(char_type& c);
    basic_istream& get(char_type* s, streamsize n);
    basic_istream& get(char_type* s, streamsize n, char_type delim);
    basic_istream& get(basic_streambuf<char_type, traits>& sb);
    basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
    basic_istream& getline(char_type* s, streamsize n);
    basic_istream& getline(char_type* s, streamsize n, char_type delim);
    basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
    int_type       peek();
    basic_istream& read    (char_type* s, streamsize n);
    streamsize     readsome(char_type* s, streamsize n);
    basic_istream& putback(char_type c);
    basic_istream& unget();
    int sync();
    pos_type tellg();
    basic_istream& seekg(pos_type);
    basic_istream& seekg(off_type, ios_base::seekdir);
protected:
// 31.7.4.2.2, copy/move constructor basic_istream(const basic_istream&) = delete; basic_istream(basic_istream&& rhs);
// 31.7.4.2.3, assignment and swap
    basic_istream& operator=(const basic_istream&) = delete;
    basic_istream& operator=(basic_istream&& rhs);
    void swap(basic_istream& rhs);
};
// 31.7.4.3.3, character extraction templates template<class charT, class traits>
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
template<class traits>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, unsigned char&);
template<class traits>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, signed char&);
template<class charT, class traits, size_t N>
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT(&)[N]);
template<class traits, size_t N>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, unsigned char(&)[N]);
template<class traits, size_t N>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>&, signed char(&)[N]);
}
// signatures that assist in reading and interpreting input from sequences controlled by a stream buffer.
// Effects: Initializes the base class subobject with basic_ios::init(sb) (31.5.4.2).
// Postconditions: gcount() == 0.
}
// The class sentry defines a class that is responsible for doing exception safe prefix and suffix operations.
explicit sentry(basic_istream& is, bool noskipws = false);
//  Two groups of member function signatures share common properties: the formatted input functions (or extractors) and the unformatted input functions. Both groups of input functions are described as if they obtain (or extract) input characters by calling rdbuf()->sbumpc() or rdbuf()->sgetc(). They may use other public members of istream.
//  If rdbuf()->sbumpc() or rdbuf()->sgetc() returns traits::eof(), then the input function, except as explicitly noted otherwise, completes its actions and does setstate(eofbit), which may throw ios_- base::failure (31.5.4.4), before returning.
// If one of these called functions throws an exception, then unless explicitly noted otherwise, the input function sets badbit in the error state. If badbit is set in exceptions(), the input function rethrows the exception without completing its actions, otherwise it does not throw anything and proceeds as if the called function had returned a failure indication.
// 31.7.4.2.2 Constructors [istream.cons]
explicit basic_istream(basic_streambuf<charT, traits>* sb);
basic_istream(basic_istream&& rhs);
// Effects: Default constructs the base class, copies the gcount() from rhs, calls basic_ios<charT, traits>::move(rhs) to initialize the base class, and sets the gcount() for rhs to 0.
virtual ~basic_istream();
// Remarks: Does not perform any operations of rdbuf().
// 31.7.4.2.3 Assignment and swap [istream.assign]
basic_istream& operator=(basic_istream&& rhs);
// Effects: Equivalent to: swap(rhs). Returns: *this.
void swap(basic_istream& rhs);
// Effects: Calls basic_ios<charT, traits>::swap(rhs). Exchanges the values returned by gcount() and rhs.gcount().
// 31.7.4.2.4 Class basic_istream::sentry [istream.sentry]
namespace std {
template<class charT, class traits>
class basic_istream<charT, traits>::sentry {
    bool ok_; // exposition only public:
    explicit sentry(basic_istream& is, bool noskipws = false);
    ~sentry();
    explicit operator bool() const {
        return ok_;
    } sentry(const sentry&) = delete;
    sentry& operator=(const sentry&) = delete;
};
// Effects: If is.good() is false, calls is.setstate(failbit). Otherwise, prepares for formatted or unformatted input. First, if is.tie() is not a null pointer, the function calls is.tie()->flush() to synchronize the output sequence with any associated external C stream. Except that this call can be suppressed if the put area of is.tie() is empty. Further an implementation is allowed to defer the call to flush until a call of is.rdbuf()->underflow() occurs. If no such call occurs before the sentry object is destroyed, the call to flush may be eliminated entirely.288 If noskipws is zero and is.flags() & ios_base::skipws is nonzero, the function extracts and discards each character as long as the next available input character c is a whitespace character. If is.rdbuf()->sbumpc() or is.rdbuf()->sgetc() returns traits::eof(), the function calls setstate(failbit | eofbit) (which may throw ios_base::failure). Remarks: The constructor
//  explicit sentry(basic_istream& is, bool noskipws = false) uses the currently imbued locale in is, to determine whether the next input character is whitespace or not. To decide if the character c is a whitespace character, the constructor performs as if it executes the following code fragment:
const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
if (ctype.is(ctype.space, c) != 0)
// c is a whitespace character.
// If, after any preparation is completed, is.good() is true, ok_ != false otherwise, ok_ == false. During preparation, the constructor may call setstate(failbit) (which may throw ios_base:: failure (31.5.4.4)).289
// As in the case of the inserters, these extractors depend on the locale’s num_get<> (30.4.3.2) object to perform parsing the input stream data. These extractors behave as formatted input functions (as described in 31.7.4.3.1). After a sentry object is constructed, the conversion occurs as if performed by the following code fragment:
    using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
iostate err = iostate::goodbit;
use_facet<numget>(loc).get(*this, 0, *this, err, val);
setstate(err);
// 288) This will be possible only in functions that are part of the library. The semantics of the constructor used in user code is as specified.
// 289) The sentry constructor and destructor can also perform additional implementation-dependent operations.
// 290) This is done without causing an ios_base::failure to be thrown.
~sentry();
// Effects: None.
explicit operator bool() const;
// Returns: ok_.
// 31.7.4.3 Formatted input functions [istream.formatted]
// 31.7.4.3.1 Common requirements [istream.formatted.reqmts]
// Each formatted input function begins execution by constructing an object of class sentry with the noskipws (second) argument false. If the sentry object returns true, when converted to a value of type bool, the function endeavors to obtain the requested input. If an exception is thrown during input then ios_- base::badbit is turned on290 in *this’s error state. If (exceptions()&badbit) != 0 then the exception is rethrown. In any case, the formatted input function destroys the sentry object. If no exception has been thrown, it returns *this.
// 31.7.4.3.2 Arithmetic extractors [istream.formatted.arithmetic]
basic_istream& operator>>(unsigned short& val);
basic_istream& operator>>(unsigned int& val);
basic_istream& operator>>(long& val);
basic_istream& operator>>(unsigned long& val);
basic_istream& operator>>(long long& val);
basic_istream& operator>>(unsigned long long& val);
basic_istream& operator>>(float& val);
basic_istream& operator>>(double& val);
basic_istream& operator>>(long double& val);
basic_istream& operator>>(bool& val);
basic_istream& operator>>(void*& val);
// In the above fragment, loc stands for the private member of the basic_ios class.
// [Note 1: The first argument provides an object of the istreambuf_iterator class which is an iterator pointed to an input stream. It bypasses istreams and uses streambufs directly.
// Class locale relies on this type as its interface to istream, so that it does not need to depend directly on istream.
basic_istream& operator>>(short& val);
// The conversion occurs as if performed by the following code fragment (using the same notation as for the preceding code fragment):
using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
iostate err = ios_base::goodbit;
long lval;
use_facet<numget>(loc).get(*this, 0, *this, err, lval);
if (lval < numeric_limits<short>::min()) {
    err |= ios_base::failbit;
    val = numeric_limits<short>::min();
} else if (numeric_limits<short>::max() < lval) {
    err |= ios_base::failbit;
    val = numeric_limits<short>::max();
}  else
    val = static_cast<short>(lval);
// The conversion occurs as if performed by the following code fragment (using the same notation as for the preceding code fragment):
// Effects: None. This extractor does not behave as a formatted input function (as described in 31.7.4.3.1). Returns: pf(*this).291
setstate(err);
basic_istream& operator>>(int& val);
using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
iostate err = ios_base::goodbit;
long lval;
use_facet<numget>(loc).get(*this, 0, *this, err, lval);
if (lval < numeric_limits<int>::min()) {
    err |= ios_base::failbit;
    val = numeric_limits<int>::min();
} else if (numeric_limits<int>::max() < lval) {
    err |= ios_base::failbit;
    val = numeric_limits<int>::max();
}  else
    val = static_cast<int>(lval);
setstate(err);
// 31.7.4.3.3 basic_istream::operator>> [istream.extractors]
basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
// Effects: Calls pf(*this). This extractor does not behave as a formatted input function (as described in 31.7.4.3.1).
// Returns: *this.
basic_istream& operator>>(ios_base& (*pf)(ios_base&));
// Effects:Callspf(*this).292 Thisextractordoesnotbehaveasaformattedinputfunction(asdescribed in 31.7.4.3.1).
// Returns: *this.
//  291) See, for example, the function signature ws(basic_istream&) (31.7.4.5). 292) See, for example, the function signature dec(ios_base&) (31.5.5.3).
template<class charT, class traits, size_t N>
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& in, charT (&s)[N]);
template<class traits, size_t N>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, unsigned char (&s)[N]);
template<class traits, size_t N>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, signed char (&s)[N]);
// Effects: Behaves like a formatted input member (as described in 31.7.4.3.1) of in. After a sentry object is constructed, operator>> extracts characters and stores them into s. If width() is greater than zero, n is min(size_t(width()), N). Otherwise n is N. n is the maximum number of characters stored.
// Characters are extracted and stored until any of the following occurs:
// — n-1 characters are stored;
// — end of file occurs on the input sequence;
// — letting ct be use_facet<ctype<charT>>(in.getloc()), ct.is(ct.space, c) is true. operator>> then stores a null byte (charT()) in the next position, which may be the first position if no characters were extracted. operator>> then calls width(0). If the function extracted no characters, it calls setstate(failbit), which may throw ios_base:: failure (31.5.4.4).
// Returns: in.
//  Each unformatted input function begins execution by constructing an object of class sentry with the default argument noskipws (second) argument true. If the sentry object returns true, when converted to a value of type bool, the function endeavors to obtain the requested input. Otherwise, if the sentry constructor exits by throwing an exception or if the sentry object returns false, when converted to a value of type bool, the function returns without attempting to obtain any input. In either case the number of extracted characters is set to 0; unformatted input functions taking a character array of nonzero size as an argument shall also store a null character (using charT()) in the first location of the array. If an exception is thrown during input then
template<class charT, class traits>
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& in, charT& c);
template<class traits>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, unsigned char& c);
template<class traits>
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, signed char& c);
// Effects: Behaves like a formatted input member (as described in 31.7.4.3.1) of in. After a sentry object is constructed a character is extracted from in, if one is available, and stored in c. Otherwise, the function calls in.setstate(failbit).
// Returns: in.
basic_istream& operator>>(basic_streambuf<charT, traits>* sb);
// Effects: Behaves as an unformatted input function (31.7.4.4). If sb is null, calls setstate(fail- bit), which may throw ios_base::failure (31.5.4.4). After a sentry object is constructed, extracts characters from *this and inserts them in the output sequence controlled by sb. Characters are extracted and inserted until any of the following occurs:
// — end-of-file occurs on the input sequence;
// — inserting in the output sequence fails (in which case the character to be inserted is not extracted); — an exception occurs (in which case the exception is caught).
// If the function inserts no characters, it calls setstate(failbit), which may throw ios_base:: failure (31.5.4.4). If it inserted no characters because it caught an exception thrown while extracting characters from *this and failbit is set in exceptions() (31.5.4.4), then the caught exception is rethrown.
// Returns: *this.
// 31.7.4.4 Unformatted input functions [istream.unformatted]
// ios_base::badbit is turned on293 in *this’s error state. (Exceptions thrown from basic_ios<>::clear() are not caught or rethrown.) If (exceptions()&badbit) != 0 then the exception is rethrown. It also counts the number of characters extracted. If no exception has been thrown it ends by storing the count in a member object and returning the value specified. In any event the sentry object is destroyed before leaving the unformatted input function.
streamsize gcount() const;
// Effects: None. This member function does not behave as an unformatted input function (as described above).
// Returns: The number of characters extracted by the last unformatted input member function called for the object. If the number cannot be represented, returns numeric_limits<streamsize>::max().
int_type get();
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, extracts a character c, if one is available. Otherwise, the function calls setstate(failbit), which may throw ios_base::failure (31.5.4.4).
// Returns: c if available, otherwise traits::eof(). basic_istream& get(char_type& c);
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, extracts a character, if one is available, and assigns it to c.294 Otherwise, the function calls setstate(failbit) (which may throw ios_base::failure (31.5.4.4)).
// Returns: *this.
basic_istream& get(char_type* s, streamsize n, char_type delim);
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, extracts characters and stores them into successive locations of an array whose first element is designated by s.295 Characters are extracted and stored until any of the following occurs:
// — n is less than one or n - 1 characters are stored;
// — end-of-file occurs on the input sequence (in which case the function calls setstate(eofbit)); — traits::eq(c, delim) for the next available input character c (in which case c is not extracted).
// If the function stores no characters, it calls setstate(failbit) (which may throw ios_base::failure (31.5.4.4)). In any case, if n is greater than zero it then stores a null character into the next successive location of the array. Returns: *this.
basic_istream& get(char_type* s, streamsize n);
// Effects: Calls get(s, n, widen(’\n’)). Returns: Value returned by the call.
basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, extracts characters and inserts them in the output sequence controlled by sb. Characters are extracted and inserted until any of the following occurs:
// — end-of-file occurs on the input sequence;
// — inserting in the output sequence fails (in which case the character to be inserted is not extracted); — traits::eq(c, delim) for the next available input character c (in which case c is not extracted); — an exception occurs (in which case, the exception is caught but not rethrown).
// If the function inserts no characters, it calls setstate(failbit), which may throw ios_base:: failure (31.5.4.4).
//  293) This is done without causing an ios_base::failure to be thrown.
// 294) Note that this function is not overloaded on types signed char  and unsigned char. 295) Note that this function is not overloaded on types signed char and unsigned char.
// Returns: *this.
basic_istream& get(basic_streambuf<char_type, traits>& sb);
// Effects: Calls get(sb, widen(’\n’)). Returns: Value returned by the call.
// Returns: getline(s, n, widen(’\n’))
basic_istream& getline(char_type* s, streamsize n, char_type delim);
}
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, extracts characters and stores them into successive locations of an array whose first element is designated by s.296 Characters are extracted and stored until one of the following occurs:
// 1. end-of-file occurs on the input sequence (in which case the function calls setstate(eofbit));
// 2. traits::eq(c, delim) for the next available input character c (in which case the input character is extracted but not stored);297
// 3. n is less than one or n - 1 characters are stored (in which case the function calls setstate(failbit)).
// These conditions are tested in the order shown.298
// If the function extracts no characters, it calls setstate(failbit) (which may throw ios_base:: failure (31.5.4.4)).299
// In any case, if n is greater than zero, it then stores a null character (using charT()) into the next successive location of the array.
// Returns: *this. [Example 1:
#include <iostream>
int main() {
    using namespace std;
    const int line_buffer_size = 100;
    char buffer[line_buffer_size];
    int line_number = 0;
    while (cin.getline(buffer, line_buffer_size, '\n') || cin.gcount()) {
        int count = cin.gcount();
        if (cin.eof())
            cout << "Partial final line"; // cin.fail() is false
        else if (cin.fail()) {
            cout << "Partial long line";
            cin.clear(cin.rdstate() & ~ios_base::failbit);
        }
        else {
            count--; // Don't include newline in count
            cout << "Line " << ++line_number;
        }
        cout << " (" << count << " chars): " << buffer << endl;
    }
    main2();
}
basic_istream& getline(char_type* s, streamsize n);
//  296) Note that this function is not overloaded on types signed char and unsigned char.
// 297) Since the final input character is “extracted”, it is counted in the gcount(), even though it is not stored.
// 298) This allows an input line which exactly fills the buffer, without setting failbit. This is different behavior than the historical AT&T implementation.
// 299) This implies an empty input line will not cause failbit to be set.
basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, extracts characters and discards them. Characters are extracted until any of the following occurs:
// — n != numeric_limits<streamsize>::max() (17.3.5) and n characters have been extracted so far
// — end-of-file occurs on the input sequence (in which case the function calls setstate(eofbit), which may throw ios_base::failure (31.5.4.4));
// — traits::eq_int_type(traits::to_int_type(c), delim) for the next available input character c (in which case c is extracted).
// [Note 1: The last condition will never occur if traits::eq_int_type(delim, traits::eof()). —end note] Returns: *this.
int_type peek();
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, reads but does not extract the current input character.
// Returns: traits::eof() if good() is false. Otherwise, returns rdbuf()->sgetc(). basic_istream& read(char_type* s, streamsize n);
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. Otherwise extracts characters and stores them into successive locations of an array whose first element is designated by s.300 Characters are extracted and stored until either of the following occurs:
// — n characters are stored;
// — end-of-file occurs on the input sequence (in which case the function calls setstate(failbit | eofbit), which may throw ios_base::failure (31.5.4.4)). Returns: *this.
streamsize readsome(char_type* s, streamsize n);
// Effects: Behaves as an unformatted input function (as described above). After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. Other- wise extracts characters and stores them into successive locations of an array whose first element is designated by s. If rdbuf()->in_avail() == -1, calls setstate(eofbit) (which may throw ios_base::failure (31.5.4.4)), and extracts no characters;
// — If rdbuf()->in_avail() == 0, extracts no characters
// — If rdbuf()->in_avail() > 0, extracts min(rdbuf()->in_avail(), n)). Returns: The number of characters extracted.
basic_istream& putback(char_type c);
// Effects: Behaves as an unformatted input function (as described above), except that the function first clears eofbit. After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. If rdbuf() is not null, calls rdbuf()->sputbackc(c). If rdbuf() is null, or if sputbackc returns traits::eof(), calls setstate(badbit) (which may throw ios_base::failure (31.5.4.4)).
// [Note 2 : This function extracts no characters, so the value returned by the next call to gcount() is 0. — end note ]
// Returns: *this. basic_istream& unget();
// Effects: Behaves as an unformatted input function (as described above), except that the function first clears eofbit. After constructing a sentry object, if !good() calls setstate(failbit) which may throw an exception, and return. If rdbuf() is not null, calls rdbuf()->sungetc(). If rdbuf()
//  300) Note that this function is not overloaded on types signed char and unsigned char.
// Effects: Behaves as an unformatted input function (31.7.4.4), except that it does not count the number of characters extracted and does not affect the value returned by subsequent calls to is.gcount(). After constructing a sentry object extracts characters as long as the next available character c is whitespace or until there are no more characters in the sequence. Whitespace characters are distinguished with the same criterion as used by sentry::sentry (31.7.4.2.4). If ws stops extracting characters because there are no more available it sets eofbit, but not failbit.
// Returns: is.
// is null, or if sungetc returns traits::eof(), calls setstate(badbit) (which may throw ios_- base::failure (31.5.4.4)).
// [Note 3 : This function extracts no characters, so the value returned by the next call to gcount() is 0.
// Returns: *this. int sync();
//  Each instantiation of the function template specified in this subclause is a designated addressable function (16.4.5.2.1).
template<class charT, class traits>
basic_istream<charT, traits>& ws(basic_istream<charT, traits>& is);
// Effects: Behaves as an unformatted input function (as described above), except that it does not count the number of characters extracted and does not affect the value returned by subsequent calls to gcount(). After constructing a sentry object, if rdbuf() is a null pointer, returns -1. Otherwise, calls rdbuf()->pubsync() and, if that function returns -1 calls setstate(badbit) (which may throw ios_base::failure (31.5.4.4), and returns -1. Otherwise, returns zero.
pos_type tellg();
// Effects: Behaves as an unformatted input function (as described above), except that it does not count the number of characters extracted and does not affect the value returned by subsequent calls to gcount().
//Returns: After constructing a sentry object, if fail() != false, returns pos_type(-1) to indicate failure. Otherwise, returns rdbuf()->pubseekoff(0, cur, in).
basic_istream& seekg(pos_type pos);
// Effects: Behaves as an unformatted input function (as described above), except that the function first clears eofbit, it does not count the number of characters extracted, and it does not affect the value returned by subsequent calls to gcount(). After constructing a sentry object, if fail() != true, executes rdbuf()->pubseekpos(pos, ios_base::in). In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure).
// Returns: *this.
basic_istream& seekg(off_type off, ios_base::seekdir dir);
// Effects: Behaves as an unformatted input function (as described above), except that the function first clears eofbit, does not count the number of characters extracted, and does not affect the value returned by subsequent calls to gcount(). After constructing a sentry object, if fail() != true, executes rdbuf()->pubseekoff(off, dir, ios_base::in). In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure).
// Returns: *this.
// 31.7.4.5 Standard basic_istream manipulators [istream.manip]
// 31.7.4.6 Rvalue stream extraction [istream.rvalue]
template<class Istream, class T>
Istream&& operator>>(Istream&& is, T&& x);
// Constraints: The expression is >> std::forward<T>(x) is well-formed when treated as an unevaluated operand (7.2.3) and Istream is publicly and unambiguously derived from ios_base.
// Effects: Equivalent to:
// Effects: Initializes the base class subobjects with basic_istream<charT, traits>(sb) (31.7.4.2) and basic_ostream<charT, traits>(sb) (31.7.5.2).
is >> std::forward<T>(x);
return std::move(is);
// 31.7.4.7 Class template basic_iostream [iostreamclass]
// 31.7.4.7.1 General [iostreamclass.general]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_iostream
    : public basic_istream<charT, traits>,
      public basic_ostream<charT, traits> {
public:
    using char_type = charT;
    using int_type = typename traits::int_type;
    using pos_type = typename traits::pos_type;
    using off_type = typename traits::off_type;
    using traits_type = traits;
// 31.7.4.7.2, constructor
    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
// 31.7.4.7.3, destructor virtual ~basic_iostream();
protected:
// 31.7.4.7.2, constructor
    basic_iostream(const basic_iostream&) = delete;
    basic_iostream(basic_iostream&& rhs);
// 31.7.4.7.4, assignment and swap
    basic_iostream& operator=(const basic_iostream&) = delete;
    basic_iostream& operator=(basic_iostream&& rhs);
    void swap(basic_iostream& rhs);
};
}
// The class template basic_iostream inherits a number of functions that allow reading input and writing output to sequences controlled by a stream buffer.
// 31.7.4.7.2 Constructors [iostream.cons]
explicit basic_iostream(basic_streambuf<charT, traits>* sb);
// Postconditions: rdbuf() == sb and gcount() == 0. basic_iostream(basic_iostream&& rhs);
// Effects: Move constructs from the rvalue rhs by constructing the basic_istream base class with move(rhs).
// 31.7.4.7.3 Destructor [iostream.dest]
virtual ~basic_iostream();
// Remarks: Does not perform any operations on rdbuf().
// 31.7.4.7.4 Assignment and swap [iostream.assign]
basic_iostream& operator=(basic_iostream&& rhs);
// Effects: Equivalent to: swap(rhs).
void swap(basic_iostream& rhs);
// Effects: Calls basic_istream<charT, traits>::swap(rhs).
// 31.7.5 Output streams [output.streams]
// 31.7.5.1 General [output.streams.general]
//  The header <ostream> defines a class template and several function templates that control output to a
stream buffer, along with a function template that inserts into stream rvalues.
// 31.7.5.2 Class template basic_ostream  [ostream] 
// 31.7.5.2.1 General [ostream.general]
  namespace std {
    template<class charT, class traits = char_traits<charT>>
    class basic_ostream : virtual public basic_ios<charT, traits> {
    public:
// types (inherited from basic_ios (31.5.4))
using char_type = charT;
using int_type = typename traits::int_type;
using pos_type = typename traits::pos_type;
using off_type = typename traits::off_type;
using traits_type = traits;
// 31.7.5.2.2, constructor/destructor
explicit basic_ostream(basic_streambuf<char_type, traits>* sb); virtual ~basic_ostream();
// 31.7.5.2.4, prefix/suffix class sentry;
// 31.7.5.3, formatted output
basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&)); basic_ostream& operator<<(ios_base& (*pf)(ios_base&));
  basic_ostream& operator<<(bool n);
  basic_ostream& operator<<(short n);
  basic_ostream& operator<<(unsigned short n);
  basic_ostream& operator<<(int n);
  basic_ostream& operator<<(unsigned int n);
  basic_ostream& operator<<(long n);
  basic_ostream& operator<<(unsigned long n);
  basic_ostream& operator<<(long long n);
  basic_ostream& operator<<(unsigned long long n);
  basic_ostream& operator<<(float f);
  basic_ostream& operator<<(double f);
  basic_ostream& operator<<(long double f);
  basic_ostream& operator<<(const void* p);
  basic_ostream& operator<<(const volatile void* p);
  basic_ostream& operator<<(nullptr_t);
  basic_ostream& operator<<(basic_streambuf<char_type, traits>* sb);
// 31.7.5.4, unformatted output
basic_ostream& put(char_type c);
basic_ostream& write(const char_type* s, streamsize n);
  basic_ostream& flush();
// 31.7.5.2.5, seeks
pos_type tellp();
basic_ostream& seekp(pos_type);
basic_ostream& seekp(off_type, ios_base::seekdir);
protected:
// 31.7.5.2.2, copy/move constructor basic_ostream(const basic_ostream&) = delete; basic_ostream(basic_ostream&& rhs);
// 31.7.5.2.3, assignment and swap
basic_ostream& operator=(const basic_ostream&) = delete; basic_ostream& operator=(basic_ostream&& rhs);
void swap(basic_ostream& rhs);
};
// 31.7.5.3.4, character inserters template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&, charT);
template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&, char);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, char);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, signed char);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, unsigned char);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, wchar_t) = delete;
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, char8_t) = delete;
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, char16_t) = delete;
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, char32_t) = delete;
template<class traits>
  basic_ostream<wchar_t, traits>&
    operator<<(basic_ostream<wchar_t, traits>&, char8_t) = delete;
template<class traits>
  basic_ostream<wchar_t, traits>&
    operator<<(basic_ostream<wchar_t, traits>&, char16_t) = delete;
template<class traits>
  basic_ostream<wchar_t, traits>&
    operator<<(basic_ostream<wchar_t, traits>&, char32_t) = delete;
template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&, const charT*);
template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>&, const char*);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, const char*);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, const signed char*);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>&, const unsigned char*);
template<class traits>
  basic_ostream<char, traits>&
    operator<<(basic_ostream<char, traits>&, const wchar_t*) = delete;
template<class traits>
  basic_ostream<char, traits>&
    operator<<(basic_ostream<char, traits>&, const char8_t*) = delete;
template<class traits>
  basic_ostream<char, traits>&
    operator<<(basic_ostream<char, traits>&, const char16_t*) = delete;
template<class traits>
  basic_ostream<char, traits>&
    operator<<(basic_ostream<char, traits>&, const char32_t*) = delete;
template<class traits>
  basic_ostream<wchar_t, traits>&
    operator<<(basic_ostream<wchar_t, traits>&, const char8_t*) = delete;
// Effects: Initializes the base class subobject with basic_ios<charT, traits>::init(sb) (31.5.4.2). Postconditions: rdbuf() == sb.
       template<class traits>
         basic_ostream<wchar_t, traits>&
           operator<<(basic_ostream<wchar_t, traits>&, const char16_t*) = delete;
       template<class traits>
         basic_ostream<wchar_t, traits>&
           operator<<(basic_ostream<wchar_t, traits>&, const char32_t*) = delete;
}
//  The class template basic_ostream defines a number of member function signatures that assist in formatting and writing output to output sequences controlled by a stream buffer.
//  Two groups of member function signatures share common properties: the formatted output functions (or inserters) and the unformatted output functions. Both groups of output functions generate (or insert) output characters by actions equivalent to calling rdbuf()->sputc(int_type). They may use other public members of basic_ostream except that they shall not invoke any virtual members of rdbuf() except overflow(), xsputn(), and sync().
//  If one of these called functions throws an exception, then unless explicitly noted otherwise the output function sets badbit in the error state. If badbit is set in exceptions(), the output function rethrows the exception without completing its actions, otherwise it does not throw anything and proceeds as if the called function had returned a failure indication.
//  [Note 1: The deleted overloads of operator<< prevent formatting characters as integers and strings as pointers. —end note]
// 31.7.5.2.2 Constructors [ostream.cons]
   explicit basic_ostream(basic_streambuf<charT, traits>* sb);
basic_ostream(basic_ostream&& rhs);
// Effects: Move constructs from the rvalue rhs. This is accomplished by default constructing the base class and calling basic_ios<charT, traits>::move(rhs) to initialize the base class.
virtual ~basic_ostream();
// Remarks: Does not perform any operations on rdbuf().
// 31.7.5.2.3 Assignment and swap [ostream.assign]
basic_ostream& operator=(basic_ostream&& rhs);
// Effects: Equivalent to: swap(rhs). Returns: *this.
void swap(basic_ostream& rhs);
// Effects: Calls basic_ios<charT, traits>::swap(rhs). 
31.7.5.2.4 Class basic_ostream::sentry [ostream.sentry]
  namespace std {
    template<class charT, class traits>
    class basic_ostream<charT, traits>::sentry {
bool ok_; // exposition only public:
explicit sentry(basic_ostream& os);
~sentry();
explicit operator bool() const { return ok_; }
      sentry(const sentry&) = delete;
      sentry& operator=(const sentry&) = delete;
    };
}
//  The class sentry defines a class that is responsible for doing exception safe prefix and suffix operations.
   explicit sentry(basic_ostream& os);
~sentry();
// If os.good() is nonzero, prepares for formatted or unformatted output. If os.tie() is not a null pointer, calls os.tie()->flush().301
If, after any preparation is completed, os.good() is true, ok_ == true otherwise, ok_ == false. During preparation, the constructor may call setstate(failbit) (which may throw ios_base:: failure (31.5.4.4)).302
If (os.flags() & ios_base::unitbuf) && !uncaught_exceptions() && os.good() is true, calls os.rdbuf()->pubsync(). If that function returns 1, sets badbit in os.rdstate() without propa- gating an exception.
//  Each seek member function begins execution by constructing an object of class sentry. It returns by destroying the sentry object.
   pos_type tellp();
explicit operator bool() const;
// Effects: Returns ok_.
// 31.7.5.2.5 Seek members [ostream.seeks]
// Returns: If fail() != false, returns pos_type(-1) to indicate failure. Otherwise, returns rdbuf()-> pubseekoff(0, cur, out).
//  Each formatted output function begins execution by constructing an object of class sentry. If that object returns true when converted to a value of type bool, the function endeavors to generate the requested output. If the generation fails, then the formatted output function does setstate(ios_base::failbit), which can throw an exception. If an exception is thrown during output, then ios_base::badbit is turned on303 in *this’s error state. If (exceptions()&badbit) != 0 then the exception is rethrown. Whether or not an exception is thrown, the sentry object is destroyed before leaving the formatted output function. If no exception is thrown, the result of the formatted output function is *this.
//  The descriptions of the individual formatted output functions describe how they perform output and do not mention the sentry object.
//  If a formatted output function of a stream os determines padding, it does so as follows. Given a charT character sequence seq where charT is the character type of the stream, if the length of seq is less than os.width(), then enough copies of os.fill() are added to this sequence as necessary to pad to a width of os.width() characters. If (os.flags() & ios_base::adjustfield) == ios_base::left is true, the fill characters are placed after the character sequence; otherwise, they are placed before the character sequence.
// 31.7.5.3.2 Arithmetic inserters [ostream.inserters.arithmetic]
   basic_ostream& operator<<(bool val);
   basic_ostream& operator<<(short val);
// 301) The call os.tie()->flush() does not necessarily occur if the function can determine that no synchronization is necessary. 302) The sentry constructor and destructor can also perform additional implementation-dependent operations.
// 303) This is done without causing an ios_base::failure to be thrown.
basic_ostream& seekp(pos_type pos);
// Effects: If fail() != true, executes rdbuf()->pubseekpos(pos, ios_base::out). In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure).
// Returns: *this.
basic_ostream& seekp(off_type off, ios_base::seekdir dir);
// Effects: If fail() != true, executes rdbuf()->pubseekoff(off, dir, ios_base::out). In case of failure, the function calls setstate(failbit) (which may throw ios_base::failure).
// Returns: *this.
// 31.7.5.3 Formatted output functions [ostream.formatted]
// 31.7.5.3.1 Common requirements [ostream.formatted.reqmts]
// Effects: The classes num_get<> and num_put<> handle locale-dependent numeric formatting and parsing. These inserter functions use the imbued locale value to perform numeric formatting. When val is of type bool, long, unsigned long, long long, unsigned long long, double, long double, or const void*, the formatting conversion occurs as if it performed the following code fragment:
  bool failed = use_facet<
    num_put<charT, ostreambuf_iterator<charT, traits>>
      >(getloc()).put(*this, *this, fill(), val).failed();
// When val is of type short the formatting conversion occurs as if it performed the following code fragment:
  ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
  bool failed = use_facet<
    num_put<charT, ostreambuf_iterator<charT, traits>>
      >(getloc()).put(*this, *this, fill(),
      baseflags == ios_base::oct || baseflags == ios_base::hex
        ? static_cast<long>(static_cast<unsigned short>(val))
        : static_cast<long>(val)).failed();
// When val is of type int the formatting conversion occurs as if it performed the following code fragment:
  ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
  bool failed = use_facet<
    num_put<charT, ostreambuf_iterator<charT, traits>>
      >(getloc()).put(*this, *this, fill(),
      baseflags == ios_base::oct || baseflags == ios_base::hex
        ? static_cast<long>(static_cast<unsigned int>(val))
        : static_cast<long>(val)).failed();
// When val is of type unsigned short or unsigned int the formatting conversion occurs as if it performed the following code fragment:
  bool failed = use_facet<
    num_put<charT, ostreambuf_iterator<charT, traits>>
      >(getloc()).put(*this, *this, fill(),
        static_cast<unsigned long>(val)).failed();
// When val is of type float the formatting conversion occurs as if it performed the following code fragment:
  bool failed = use_facet<
    num_put<charT, ostreambuf_iterator<charT, traits>>
      >(getloc()).put(*this, *this, fill(),
        static_cast<double>(val)).failed();
// The first argument provides an object of the ostreambuf_iterator<> class which is an iterator for class basic_ostream<>. It bypasses ostreams and uses streambufs directly. Class locale relies on these types as its interface to iostreams, since for flexibility it has been abstracted away from direct dependence on ostream. The second parameter is a reference to the base class subobject of type ios_base. It provides formatting specifications such as field width, and a locale from which to obtain other facets. If failed is true then does setstate(badbit), which may throw an exception, and returns.
// Returns: *this.
basic_ostream& operator<<(unsigned short val);
basic_ostream& operator<<(int val);
basic_ostream& operator<<(unsigned int val);
basic_ostream& operator<<(long val);
basic_ostream& operator<<(unsigned long val);
basic_ostream& operator<<(long long val);
basic_ostream& operator<<(unsigned long long val);
basic_ostream& operator<<(float val);
basic_ostream& operator<<(double val);
basic_ostream& operator<<(long double val);
basic_ostream& operator<<(const void* val);
// Effects: Behaves as a formatted output function (31.7.5.3.1) of out. Constructs a character sequence seq. If c has type char and the character type of the stream is not char, then seq consists of
     basic_ostream& operator<<(const volatile void* p);
// Effects: Equivalent to: return operator<<(const_cast<const void*>(p));
// 31.7.5.3.3 basic_ostream::operator<< [ostream.inserters]
basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
// Effects: None. Does not behave as a formatted output function (as described in 31.7.5.3.1). Returns: pf(*this).304
basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
// Effects: Calls pf(*this). This inserter does not behave as a formatted output function (as described in 31.7.5.3.1).
// Returns: *this.305
basic_ostream& operator<<(ios_base& (*pf)(ios_base&));
// Effects: Calls pf(*this). This inserter does not behave as a formatted output function (as described in 31.7.5.3.1).
Returns: *this.
basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
// Effects: Behaves as an unformatted output function (31.7.5.4). After the sentry object is constructed, if sb is null calls setstate(badbit) (which may throw ios_base::failure).
Gets characters from sb and inserts them in *this. Characters are read from sb and inserted until any of the following occurs:
// — end-of-file occurs on the input sequence;
// — inserting in the output sequence fails (in which case the character to be inserted is not extracted); — an exception occurs while getting a character from sb.
// If the function inserts no characters, it calls setstate(failbit) (which may throw ios_base:: failure (31.5.4.4)). If an exception was thrown while extracting a character, the function sets failbit in the error state, and if failbit is set in exceptions() the caught exception is rethrown.
// Returns: *this.
basic_ostream& operator<<(nullptr_t);
Effects: Equivalent to: return *this << s;
where s is an implementation-defined NTCTS (3.37).
31.7.5.3.4 Character inserter function templates [ostream.inserters.character]
template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, charT c);
template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, char c);
// specialization
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, char c);
// signed and unsigned
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, signed char c);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, unsigned char c);
//  304) See, for example, the function signature endl(basic_ostream&) (31.7.5.5). 305) See, for example, the function signature dec(ios_base&) (31.5.5.3).
// Effects: Behaves as an unformatted output function (as described above). After constructing a sentry object, inserts the character c, if possible.307
// Otherwise, calls setstate(badbit) (which may throw ios_base::failure (31.5.4.4)). Returns: *this.
out.widen(c);
//  otherwise seq consists of c. Determines padding for seq as described in 31.7.5.3.1. Inserts seq into out. Calls os.width(0).
Returns: out.
template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const charT* s);
template<class charT, class traits>
  basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const char* s);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const char* s);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const signed char* s);
template<class traits>
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out,
// Preconditions: s is not a null pointer.
const unsigned char* s);
//  Each unformatted output function begins execution by constructing an object of class sentry. If that object returns true, while converting to a value of type bool, the function endeavors to generate the requested output. If an exception is thrown during output, then ios_base::badbit is turned on306 in *this’s error state. If (exceptions() & badbit) != 0 then the exception is rethrown. In any case, the unformatted output function ends by destroying the sentry object, then, if no exception was thrown, returning the value specified for the unformatted output function.
     basic_ostream& put(char_type c);
// Effects: Behaves like a formatted inserter (as described in 31.7.5.3.1) of out. Creates a character sequence seq of n characters starting at s, each widened using out.widen() (31.5.4.3), where n is the number that would be computed as if by:
// — traits::length(s) for the overload where the first argument is of type basic_ostream<charT, traits>& and the second is of type const charT*, and also for the overload where the first argument is of type basic_ostream<char, traits>& and the second is of type const char*,
// — char_traits<char>::length(s) for the overload where the first argument is of type basic_- ostream<charT, traits>& and the second is of type const char*,
// — traits::length(reinterpret_cast<const char*>(s)) for the other two overloads. Determines padding for seq as described in 31.7.5.3.1. Inserts seq into out. Calls width(0). Returns: out.
// 31.7.5.4 Unformatted output functions [ostream.unformatted]
basic_ostream& write(const char_type* s, streamsize n);
// Effects: Behaves as an unformatted output function (as described above). After constructing a sentry object, obtains characters to insert from successive locations of an array whose first element is designated by s.308 Characters are inserted until either of the following occurs:
// — n characters are inserted;
// — inserting in the output sequence fails (in which case the function calls setstate(badbit), which
may throw ios_base::failure (31.5.4.4)). Returns: *this.
//  306) This is done without causing an ios_base::failure to be thrown.
// 307) Note that this function is not overloaded on types signed char and unsigned char. 308) Note that this function is not overloaded on types signed char and unsigned char.
// Effects: Calls os.put(os.widen(’\n’)), then os.flush(). Returns: os.
   basic_ostream& flush();
// Each instantiation of any of the function templates specified in this subclause is a designated addressable function (16.4.5.2.1).
   template<class charT, class traits>
     basic_ostream<charT, traits>& endl(basic_ostream<charT, traits>& os);
// Effects: Behaves as an unformatted output function (as described above). If rdbuf() is not a null pointer, constructs a sentry object. If that object returns true when converted to a value of type bool the function calls rdbuf()->pubsync(). If that function returns −1 calls setstate(badbit) (which may throw ios_base::failure (31.5.4.4)). Otherwise, if the sentry object returns false, does nothing.
Returns: *this.
// 31.7.5.5 Standard manipulators [ostream.manip]
template<class charT, class traits>
  basic_ostream<charT, traits>& ends(basic_ostream<charT, traits>& os);
// Effects: Inserts a null character into the output sequence: calls os.put(charT()). Returns: os.
template<class charT, class traits>
  basic_ostream<charT, traits>& flush(basic_ostream<charT, traits>& os);
// Effects: Calls os.flush(). Returns: os.
template<class charT, class traits>
  basic_ostream<charT, traits>& emit_on_flush(basic_ostream<charT, traits>& os);
// Effects: If os.rdbuf() is a basic_syncbuf<charT, traits, Allocator>*, called buf for the purpose of exposition, calls buf->set_emit_on_sync(true). Otherwise this manipulator has no effect.
[Note 1: To work around the issue that the Allocator template argument cannot be deduced, implementations can introduce an intermediate base class to basic_syncbuf that manages its emit_on_sync flag. end note]
Returns: os.
template<class charT, class traits>
basic_ostream<charT, traits>& noemit_on_flush(basic_ostream<charT, traits>& os);
Effects: If os.rdbuf() is a basic_syncbuf<charT, traits, Allocator>*, called buf for the purpose of exposition, calls buf->set_emit_on_sync(false). Otherwise this manipulator has no effect.
Returns: os.
template<class charT, class traits>
basic_ostream<charT, traits>& flush_emit(basic_ostream<charT, traits>& os);
// Effects: Calls os.flush(). Then, if os.rdbuf() is a basic_syncbuf<charT, traits, Allocator>*, called buf for the purpose of exposition, behaves as an unformatted output function (31.7.5.4) of os. After constructing a sentry object, calls buf->emit(). If that call returns false, calls os.setstate(ios_base::badbit).
// Returns: os.
// 31.7.5.6 Rvalue stream insertion [ostream.rvalue]
template<class Ostream, class T>
  Ostream&& operator<<(Ostream&& os, const T& x);
Constraints: The expression os << x is well-formed when treated as an unevaluated operand and Ostream is publicly and unambiguously derived from ios_base.
// Effects: As if by: os << x;
// Returns: An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> then the expression out << resetiosflags(mask) behaves as if it called f(out, mask), or if in is an object of type basic_istream<charT, traits> then the expression in >> resetiosflags( mask) behaves as if it called f(in, mask), where the function f is defined as:309
  void f(ios_base& str, ios_base::fmtflags mask) {
// reset specified flags
    str.setf(ios_base::fmtflags(0), mask);
  }
The expression out << resetiosflags(mask) has type basic_ostream<charT, traits>& and value out. The expression in >> resetiosflags(mask) has type basic_istream<charT, traits>& and value in.
3
// Returns: An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> then the expression out << setiosflags(mask) behaves as if it called f(out, mask), or if in is an object of type basic_istream<charT, traits> then the expression in >> setiosflags(mask) behaves as if it called f(in, mask), where the function f is defined as:
  void f(ios_base& str, ios_base::fmtflags mask) {
// set specified flags
    str.setf(mask);
  }
// The expression out << setiosflags(mask) has type basic_ostream<charT, traits>& and value out. The expression in >> setiosflags(mask) has type basic_istream<charT, traits>& and value in.
// Returns: An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> then the expression out << setbase(base) behaves as if it called f(out, base), or if in is an object of type basic_istream<charT, traits> then the expression in >> setbase(base) behaves as if it called f(in, base), where the function f is defined as:
void f(ios_base& str, int base) {
// set basefield
str.setf(base == 8 ? ios_base::oct :
        base == 10 ? ios_base::dec :
        base == 16 ? ios_base::hex :
        ios_base::fmtflags(0), ios_base::basefield);
}
// The expression out << setbase(base) has type basic_ostream<charT, traits>& and value out. The expression in >> setbase(base) has type basic_istream<charT, traits>& and value in.
// Returns: An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> and c has type charT then the expression out << setfill(c) behaves as if it called f(out, c), where the function f is defined as:
// Returns: std::move(os).
// 31.7.6 Standard manipulators [std.manip]
//  The header <iomanip> defines several functions that support extractors and inserters that alter information maintained by class ios_base and its derived classes.
unspecified resetiosflags(ios_base::fmtflags mask);
unspecified setiosflags(ios_base::fmtflags mask);
unspecified setbase(int base);
unspecified setfill(char_type c);
//  309) The expression cin >> resetiosflags(ios_base::skipws) clears ios_base::skipws in the format flags stored in the basic_istream<charT, traits> object cin (the same as cin >> noskipws), and the expression cout << resetiosflags(ios_- base::showbase) clears ios_base::showbase in the format flags stored in the basic_ostream<charT, traits> object cout (the same as cout << noshowbase).
// Returns: An object of unspecified type such that if out is an instance of basic_ostream<charT, traits> then the expression out << setw(n) behaves as if it called f(out, n), or if in is an object of type basic_istream<charT, traits> then the expression in >> setw(n) behaves as if it called f(in, n), where the function f is defined as:
  void f(ios_base& str, int n) {
// set width
    str.width(n);
  }
// The expression out << setw(n) has type basic_ostream<charT, traits>& and value out. The expression in >> setw(n) has type basic_istream<charT, traits>& and value in.
          template<class charT, class traits>
          void f(basic_ios<charT, traits>& str, charT c) {
// set fill character
            str.fill(c);
          }
// The expression out << setfill(c) has type basic_ostream<charT, traits>& and value out. unspecified setprecision(int n);
// Returns: An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> then the expression out << setprecision(n) behaves as if it called f(out, n), or if in is an object of type basic_istream<charT, traits> then the expression in >> setprecision(n) behaves as if it called f(in, n), where the function f is defined as:
  void f(ios_base& str, int n) {
// set precision
    str.precision(n);
  }
// The expression out << setprecision(n) has type basic_ostream<charT, traits>& and value out. The expression in >> setprecision(n) has type basic_istream<charT, traits>& and value in.
unspecified setw(int n);
31.7.7 Extended manipulators [ext.manip]
1 The header <iomanip> defines several functions that support extractors and inserters that allow for the parsing and formatting of sequences and values for money and time.
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false);
// Mandates: The type moneyT is either long double or a specialization of the basic_string template( Clause 23).
// Effects: The expression in >> get_money(mon, intl) described below behaves as a formatted input function (31.7.4.3.1).
// Returns: An object of unspecified type such that if in is an object of type basic_istream<charT, traits> then the expression in >> get_money(mon, intl) behaves as if it called f(in, mon, intl), where the function f is defined as:
  template<class charT, class traits, class moneyT>
  void f(basic_ios<charT, traits>& str, moneyT& mon, bool intl) {
    using Iter     = istreambuf_iterator<charT, traits>;
    using MoneyGet = money_get<charT, Iter>;
    ios_base::iostate err = ios_base::goodbit;
    const MoneyGet& mg = use_facet<MoneyGet>(str.getloc());
    mg.get(Iter(str.rdbuf()), Iter(), intl, str, err, mon);
    if (ios_base::goodbit != err)
      str.setstate(err);
}
template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
// Preconditions: The argument tmb is a valid pointer to an object of type tm, and [fmt, fmt + char_-
template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false);
// Mandates: The type moneyT is either long double or a specialization of the basic_string template
template<class charT> unspecified get_time(tm* tmb, const charT* fmt);
// Preconditions: The argument tmb is a valid pointer to an object of type tm, and [fmt, fmt + char_-
// The expression in >> get_money(mon, intl) has type basic_istream<charT, traits>& and value in. (Clause 23).
// Returns: An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> then the expression out << put_money(mon, intl) behaves as a formatted output function
(31.7.5.3.1) that calls f(out, mon, intl), where the function f is defined as:
  template<class charT, class traits, class moneyT>
  void f(basic_ios<charT, traits>& str, const moneyT& mon, bool intl) {
    using Iter     = ostreambuf_iterator<charT, traits>;
    using MoneyPut = money_put<charT, Iter>;
    const MoneyPut& mp = use_facet<MoneyPut>(str.getloc());
    const Iter end = mp.put(Iter(str.rdbuf()), intl, str, str.fill(), mon);
    if (end.failed())
      str.setstate(ios_base::badbit);
}
// The expression out << put_money(mon, intl) has type basic_ostream<charT, traits>& and value out.
traits<charT>::length(fmt)) is a valid range.
// Returns: An object of unspecified type such that if in is an object of type basic_istream<charT, traits> then the expression in >> get_time(tmb, fmt) behaves as if it called f(in, tmb, fmt), where the function f is defined as:
  template<class charT, class traits>
  void f(basic_ios<charT, traits>& str, tm* tmb, const charT* fmt) {
    using Iter    = istreambuf_iterator<charT, traits>;
    using TimeGet = time_get<charT, Iter>;
    ios_base::iostate err = ios_base::goodbit;
    const TimeGet& tg = use_facet<TimeGet>(str.getloc());
    tg.get(Iter(str.rdbuf()), Iter(), str, err, tmb,
      fmt, fmt + traits::length(fmt));
    if (err != ios_base::goodbit)
      str.setstate(err);
}
// The expression in >> get_time(tmb, fmt) has type basic_istream<charT, traits>& and value in. traits<charT>::length(fmt)) is a valid range.
// Returns: An object of unspecified type such that if out is an object of type basic_ostream<charT, traits> then the expression out << put_time(tmb, fmt) behaves as if it called f(out, tmb, fmt), where the function f is defined as:
  template<class charT, class traits>
  void f(basic_ios<charT, traits>& str, const tm* tmb, const charT* fmt) {
    using Iter    = ostreambuf_iterator<charT, traits>;
    using TimePut = time_put<charT, Iter>;
const TimePut& tp = use_facet<TimePut>(str.getloc());
unspecified quoted(basic_string_view<charT, traits> s,
charT delim = charT("’), charT escape = charT(’\\’));
// Returns: An object of unspecified type such that if out is an instance of basic_ostream with member type char_type the same as charT and with member type traits_type, which in the second and third forms is the same as traits, then the expression out << quoted(s, delim, escape) behaves as a formatted output function (31.7.5.3.1) of out. This forms a character sequence seq, initially consisting of the following elements:
// — delim.
// — Each character in s. If the character to be output is equal to escape or delim, as determined by
traits_type::eq, first output escape.
// — delim.
// Let x be the number of elements initially in seq. Then padding is determined for seq as described in 31.7.5.3.1, seq is inserted as if by calling out.rdbuf()->sputn(seq, n), where n is the larger of out.width() and x, and out.width(0) is called. The expression out << quoted(s, delim, escape) has type basic_ostream<charT, traits>& and value out.
            const Iter end = tp.put(Iter(str.rdbuf()), str, str.fill(), tmb,
              fmt, fmt + traits::length(fmt));
            if (end.failed())
              str.setstate(ios_base::badbit);
}
// The expression out << put_time(tmb, fmt) has type basic_ostream<charT, traits>& and value out.
// 31.7.8 Quoted manipulators [quoted.manip]
//  [Note 1: Quoted manipulators provide string insertion and extraction of quoted strings (for example, XML and CSV formats). Quoted manipulators are useful in ensuring that the content of a string with embedded spaces remains unchanged if inserted and then extracted via stream I/O. 
template<class charT>
unspecified quoted(const charT* s, charT delim = charT(’"), charT escape = charT(’\\’));
template<class charT, class traits, class Allocator>
unspecified quoted(const basic_string<charT, traits, Allocator>& s,
                        charT delim = charT("’), charT escape = charT(’\\’));
   template<class charT, class traits>
template<class charT, class traits, class Allocator> unspecified quoted(basic_string<charT, traits, Allocator>& s,
                charT delim = charT(’"), charT escape = charT(’\\’));
// Returns: An object of unspecified type such that:
// —If in is an instance of basic_istream with member types char_type and traits_type the same as charT and traits, respectively, then the expression in >> quoted(s, delim, escape) behaves as if it extracts the following characters from in using operator>>(basic_istream<charT, traits>&, charT&) (31.7.4.3.3) which may throw ios_base::failure (31.5.2.2.1):
// — If the first character extracted is equal to delim, as determined by traits_type::eq, then: — Turn off the skipws flag.
// — s.clear()
// — Until an unescaped delim character is reached or !in, extract characters from in and append them to s, except that if an escape is reached, ignore it and append the next character to s.
// — Discard the final delim character.
// — Restore the skipws flag to its original value. — Otherwise, in >> s.
// — If out is an instance of basic_ostream with member types char_type and traits_type the same as charT and traits, respectively, then the expression out << quoted(s, delim, escape) behaves as specified for the const basic_string<charT, traits, Allocator>& overload of the quoted function.
// — The expression in >> quoted(s, delim, escape) has type basic_istream<charT, traits>& and value in.
// — The expression out << quoted(s, delim, escape) has type basic_ostream<charT, traits>& and value out.
int main2() {
    cout  <<  n4910 << endl;
    return EXIT_SUCCESS;
}

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

bash
$ clang++ p1514.cpp -std=03 -o p1514l -I. -Wall
In file included from p1514.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 \
 ^
p1514.cpp:16:59: error: a space is required between consecutive right angle brackets (use '> >')
    template<class charT, class traits = char_traits<charT>>
                                                          ^~
                                                          > >
p1514.cpp:16:42: error: template parameter redefines default argument
    template<class charT, class traits = char_traits<charT>>
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:82:48: note: previous default template argument defined here
  template<typename _CharT, typename _Traits = char_traits<_CharT> >
                                               ^
p1514.cpp:18:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
    using istream  = basic_istream<char>;
                     ^
p1514.cpp:19:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
    using wistream = basic_istream<wchar_t>;
                     ^
p1514.cpp:20:59: error: a space is required between consecutive right angle brackets (use '> >')
    template<class charT, class traits = char_traits<charT>>
                                                          ^~
                                                          > >
p1514.cpp:20:42: error: template parameter redefines default argument
    template<class charT, class traits = char_traits<charT>>
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:88:48: note: previous default template argument defined here
  template<typename _CharT, typename _Traits = char_traits<_CharT> >
                                               ^
p1514.cpp:22:23: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
    using iostream  = basic_iostream<char>;
                      ^
p1514.cpp:23:23: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
    using wiostream = basic_iostream<wchar_t>;
                      ^
p1514.cpp:27:14: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Istream&& operator>>(Istream&& is, T&& x);
             ^
p1514.cpp:27:35: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Istream&& operator>>(Istream&& is, T&& x);
                                  ^
p1514.cpp:27:43: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
      Istream&& operator>>(Istream&& is, T&& x);
                                          ^
p1514.cpp:28:2: error: unexpected type name 'iostream': expected expression
[iostream.format] [istream.syn]
 ^
p1514.cpp:28:20: error: unexpected type name 'istream': expected expression
[iostream.format] [istream.syn]
                   ^
p1514.cpp:29:1: error: expected unqualified-id
}
^
p1514.cpp:32:59: error: a space is required between consecutive right angle brackets (use '> >')
    template<class charT, class traits = char_traits<charT>>
                                                          ^~
                                                          > >
p1514.cpp:32:42: error: template parameter redefines default argument
    template<class charT, class traits = char_traits<charT>>
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:85:48: note: previous default template argument defined here
  template<typename _CharT, typename _Traits = char_traits<_CharT> >
                                               ^
p1514.cpp:34:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
    using ostream  = basic_ostream<char>;
                     ^
p1514.cpp:35:22: warning: alias declarations are a C++11 extension [-Wc++11-extensions]
    using wostream = basic_ostream<wchar_t>;
                     ^
p1514.cpp:49:12: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
    Ostream&& operator<<(Ostream&& os, const T& x);
           ^
p1514.cpp:49:33: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
    Ostream&& operator<<(Ostream&& os, const T& x);
                                ^
p1514.cpp:53:1: error: unknown type name 'unspecified'
unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
^
p1514.cpp:53:53: error: unknown type name 'unspecified'
unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
                                                    ^
p1514.cpp:55:1: error: unknown type name 'unspecified'
unspecified setbase(int base);
^
p1514.cpp:56:23: error: unknown type name 'unspecified'
template<class charT> unspecified setfill(charT c);
                      ^
p1514.cpp:57:1: error: unknown type name 'unspecified'
unspecified setprecision(int n);
^
p1514.cpp:58:1: error: unknown type name 'unspecified'
unspecified setw(int n);
^
p1514.cpp:59:24: error: unknown type name 'unspecified'
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
                       ^
p1514.cpp:59:102: error: unknown type name 'unspecified'
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
                                                                                                     ^
p1514.cpp:59:185: error: unknown type name 'unspecified'
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
                                                                                                                                                                                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
11 warnings and 20 errors generated.
$ clang++ p1514.cpp -std=2b -o p1514l -I. -Wall
p1514.cpp:16:42: error: template parameter redefines default argument
    template<class charT, class traits = char_traits<charT>>
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:82:48: note: previous default template argument defined here
  template<typename _CharT, typename _Traits = char_traits<_CharT> >
                                               ^
p1514.cpp:20:42: error: template parameter redefines default argument
    template<class charT, class traits = char_traits<charT>>
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:88:48: note: previous default template argument defined here
  template<typename _CharT, typename _Traits = char_traits<_CharT> >
                                               ^
p1514.cpp:28:2: error: unexpected type name 'iostream': expected expression
[iostream.format] [istream.syn]
 ^
p1514.cpp:28:20: error: unexpected type name 'istream': expected expression
[iostream.format] [istream.syn]
                   ^
p1514.cpp:29:1: error: expected unqualified-id
}
^
p1514.cpp:32:42: error: template parameter redefines default argument
    template<class charT, class traits = char_traits<charT>>
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iosfwd:85:48: note: previous default template argument defined here
  template<typename _CharT, typename _Traits = char_traits<_CharT> >
                                               ^
p1514.cpp:53:1: error: unknown type name 'unspecified'
unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
^
p1514.cpp:53:53: error: unknown type name 'unspecified'
unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
                                                    ^
p1514.cpp:55:1: error: unknown type name 'unspecified'
unspecified setbase(int base);
^
p1514.cpp:56:23: error: unknown type name 'unspecified'
template<class charT> unspecified setfill(charT c);
                      ^
p1514.cpp:57:1: error: unknown type name 'unspecified'
unspecified setprecision(int n);
^
p1514.cpp:58:1: error: unknown type name 'unspecified'
unspecified setw(int n);
^
p1514.cpp:59:24: error: unknown type name 'unspecified'
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
                       ^
p1514.cpp:59:102: error: unknown type name 'unspecified'
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
                                                                                                     ^
p1514.cpp:59:185: error: unknown type name 'unspecified'
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
                                                                                                                                                                                        ^
p1514.cpp:59:256: error: unknown type name 'unspecified'
template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
                                                                                                                                                                                                                                                               ^
p1514.cpp:61:1: error: unknown type name 'unspecified'
unspecified quoted(const charT* s, charT delim = charT('"'), charT escape = charT('\\'));
^
p1514.cpp:63:1: error: unknown type name 'unspecified'
unspecified quoted(const basic_string<charT, traits, Allocator>& s,
^
p1514.cpp:65:54: error: unknown type name 'unspecified'
template<class charT, class traits, class Allocator> unspecified quoted(basic_string<charT, traits, Allocator>& s,
                                                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

$ g++ p1514.cpp -std=03 -o p1514g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
                 from N4910.h:11,
                 from p1514.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 \
      |  ^~~~~
p1514.cpp:16:59: error: spurious '>>', use '>' to terminate a template argument list
   16 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1514.cpp:17:13: error: template argument required for 'class basic_istream'
   17 |       class basic_istream;
      |             ^~~~~~~~~~~~~
p1514.cpp:16:42: error: two or more data types in declaration of 'type name'
   16 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1514.cpp:17:26: error: expected '>' before ';' token
   17 |       class basic_istream;
      |                          ^
p1514.cpp:17:26: error: expected unqualified-id before ';' token
p1514.cpp:18:11: error: expected nested-name-specifier before 'istream'
   18 |     using istream  = basic_istream<char>;
      |           ^~~~~~~
p1514.cpp:19:11: error: expected nested-name-specifier before 'wistream'
   19 |     using wistream = basic_istream<wchar_t>;
      |           ^~~~~~~~
p1514.cpp:20:59: error: spurious '>>', use '>' to terminate a template argument list
   20 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1514.cpp:21:13: error: template argument required for 'class basic_iostream'
   21 |       class basic_iostream;
      |             ^~~~~~~~~~~~~~
p1514.cpp:20:42: error: two or more data types in declaration of 'type name'
   20 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1514.cpp:21:27: error: expected '>' before ';' token
   21 |       class basic_iostream;
      |                           ^
p1514.cpp:21:27: error: expected unqualified-id before ';' token
p1514.cpp:22:11: error: expected nested-name-specifier before 'iostream'
   22 |     using iostream  = basic_iostream<char>;
      |           ^~~~~~~~
p1514.cpp:23:11: error: expected nested-name-specifier before 'wiostream'
   23 |     using wiostream = basic_iostream<wchar_t>;
      |           ^~~~~~~~~
p1514.cpp:27:14: error: expected unqualified-id before '&&' token
   27 |       Istream&& operator>>(Istream&& is, T&& x);
      |              ^~
p1514.cpp:28:1: error: expected unqualified-id before '[' token
   28 | [iostream.format] [istream.syn]
      | ^
p1514.cpp:32:59: error: spurious '>>', use '>' to terminate a template argument list
   32 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1514.cpp:33:13: error: template argument required for 'class basic_ostream'
   33 |       class basic_ostream;
      |             ^~~~~~~~~~~~~
p1514.cpp:32:42: error: two or more data types in declaration of 'type name'
   32 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1514.cpp:33:26: error: expected '>' before ';' token
   33 |       class basic_ostream;
      |                          ^
p1514.cpp:33:26: error: expected unqualified-id before ';' token
p1514.cpp:34:11: error: expected nested-name-specifier before 'ostream'
   34 |     using ostream  = basic_ostream<char>;
      |           ^~~~~~~
p1514.cpp:35:11: error: expected nested-name-specifier before 'wostream'
   35 |     using wostream = basic_ostream<wchar_t>;
      |           ^~~~~~~~
p1514.cpp:49:12: error: expected unqualified-id before '&&' token
   49 |     Ostream&& operator<<(Ostream&& os, const T& x);
      |            ^~
p1514.cpp:53:1: error: 'unspecified' does not name a type
   53 | unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
      | ^~~~~~~~~~~
p1514.cpp:53:53: error: 'unspecified' does not name a type
   53 | unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
      |                                                     ^~~~~~~~~~~
p1514.cpp:55:1: error: 'unspecified' does not name a type
   55 | unspecified setbase(int base);
      | ^~~~~~~~~~~
p1514.cpp:56:23: error: 'unspecified' does not name a type
   56 | template<class charT> unspecified setfill(charT c);
      |                       ^~~~~~~~~~~
p1514.cpp:57:1: error: 'unspecified' does not name a type
   57 | unspecified setprecision(int n);
      | ^~~~~~~~~~~
p1514.cpp:58:1: error: 'unspecified' does not name a type
   58 | unspecified setw(int n);
      | ^~~~~~~~~~~
p1514.cpp:59:24: error: 'unspecified' does not name a type
   59 | template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                        ^~~~~~~~~~~
p1514.cpp:59:102: error: 'unspecified' does not name a type
   59 | s moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                                                                                         ^~~~~~~~~~~

p1514.cpp:59:185: error: 'unspecified' does not name a type
   59 | eyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                                                                                         ^~~~~~~~~~~

p1514.cpp:59:256: error: 'unspecified' does not name a type
   59 | ate<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                                                                                         ^~~~~~~~~~~

p1514.cpp:61:1: error: 'unspecified' does not name a type
   61 | unspecified quoted(const charT* s, charT delim = charT('"'), charT escape = charT('\\'));
      | ^~~~~~~~~~~
p1514.cpp:63:1: error: 'unspecified' does not name a type
   63 | unspecified quoted(const basic_string<charT, traits, Allocator>& s,
      | ^~~~~~~~~~~
p1514.cpp:65:54: error: 'unspecified' does not name a type
   65 | template<class charT, class traits, class Allocator> unspecified quoted(basic_string<charT, traits, Allocator>& s,
      |                                                      ^~~~~~~~~~~
p1514.cpp:68:1: error: 'unspecified' does not name a type
   68 | unspecified quoted(basic_string_view<charT, traits> s,
      | ^~~~~~~~~~~
p1514.cpp:77:59: error: spurious '>>', use '>' to terminate a template argument list
   77 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1514.cpp:78:11: error: class template 'basic_istream' redeclared as non-template
   78 |     class basic_istream : virtual public basic_ios<charT, traits> {
      |           ^~~~~~~~~~~~~
In file included from /usr/local/include/c++/12.1.0/ios:38,
                 from /usr/local/include/c++/12.1.0/ostream:38,
                 from /usr/local/include/c++/12.1.0/iostream:39,
                 from N4910.h:2:
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: previous declaration here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:78:59: error: 'traits' was not declared in this scope
   78 |     class basic_istream : virtual public basic_ios<charT, traits> {
      |                                                           ^~~~~~
p1514.cpp:78:65: error: template argument 2 is invalid
   78 |     class basic_istream : virtual public basic_ios<charT, traits> {
      |                                                                 ^
p1514.cpp:77:42: error: two or more data types in declaration of 'type name'
   77 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1514.cpp:130:2: error: expected '>' before ';' token
  130 | };
      |  ^
p1514.cpp:130:2: error: expected unqualified-id before ';' token
p1514.cpp:132:24: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                        ^~~~~
      |                        char
p1514.cpp:132:31: error: 'traits' was not declared in this scope
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                               ^~~~~~
p1514.cpp:132:37: error: template argument 1 is invalid
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                     ^
p1514.cpp:132:37: error: template argument 2 is invalid
p1514.cpp:132:65: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                 ^~~~~
      |                                                                 char
p1514.cpp:132:72: error: 'traits' was not declared in this scope
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                        ^~~~~~
p1514.cpp:132:78: error: template argument 1 is invalid
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                              ^
p1514.cpp:132:78: error: template argument 2 is invalid
p1514.cpp:132:82: error: 'charT' has not been declared
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                                  ^~~~~
p1514.cpp:132:40: error: 'int& std::operator>>(int&, int&)' must have an argument of class or enumerated type
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                        ^~~~~~~~
p1514.cpp:147:1: error: expected declaration before '}' token
  147 | }
      | ^
p1514.cpp:149:10: error: ISO C++ forbids declaration of 'sentry' with no type [-fpermissive]
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |          ^~~~~~
p1514.cpp:149:1: error: 'explicit' outside class declaration
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      | ^~~~~~~~
p1514.cpp:149:30: error: missing template arguments before '&' token
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |                              ^
p1514.cpp:149:32: error: 'is' was not declared in this scope
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |                                ^~
p1514.cpp:149:36: error: expected primary-expression before 'bool'
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |                                    ^~~~
p1514.cpp:149:57: error: expression list treated as compound expression in initializer [-fpermissive]
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |                                                         ^
p1514.cpp:154:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |                                        ^~~~~
      |                                        char
p1514.cpp:154:47: error: 'traits' was not declared in this scope
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |                                               ^~~~~~
p1514.cpp:154:53: error: template argument 1 is invalid
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |                                                     ^
p1514.cpp:154:53: error: template argument 2 is invalid
p1514.cpp:154:10: error: ISO C++ forbids declaration of 'basic_istream' with no type [-fpermissive]
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:154:1: error: 'explicit' outside class declaration
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      | ^~~~~~~~
p1514.cpp:155:14: error: expected constructor, destructor, or type conversion before '(' token
  155 | basic_istream(basic_istream&& rhs);
      |              ^
p1514.cpp:157:23: error: expected class-name before '(' token
  157 | virtual ~basic_istream();
      |                       ^
p1514.cpp:160:1: error: reference to 'basic_istream' is ambiguous
  160 | basic_istream& operator=(basic_istream&& rhs);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:162:6: error: variable or field 'swap' declared void
  162 | void swap(basic_istream& rhs);
      |      ^~~~
p1514.cpp:162:11: error: reference to 'basic_istream' is ambiguous
  162 | void swap(basic_istream& rhs);
      |           ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:162:26: error: 'rhs' was not declared in this scope
  162 | void swap(basic_istream& rhs);
      |                          ^~~
p1514.cpp:167:41: error: redefinition of 'class std::basic_istream<_CharT, _Traits>::sentry'
  167 |     class basic_istream<charT, traits>::sentry {
      |                                         ^~~~~~
In file included from /usr/local/include/c++/12.1.0/iostream:40:
/usr/local/include/c++/12.1.0/istream:686:43: note: previous definition of 'class std::basic_istream<_CharT, _Traits>::sentry'
  686 |     class basic_istream<_CharT, _Traits>::sentry
      |                                           ^~~~~~
p1514.cpp:175:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |               ^~~~~
      |               char
p1514.cpp:175:20: error: template argument 1 is invalid
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                    ^
p1514.cpp:175:23: error: 'const int& std::ctype' redeclared as different kind of entity
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                       ^~~~~
In file included from /usr/local/include/c++/12.1.0/ios:41:
/usr/local/include/c++/12.1.0/bits/localefwd.h:127:11: note: previous declaration 'template<class _CharT> class std::ctype'
  127 |     class ctype;
      |           ^~~~~
p1514.cpp:175:47: error: 'charT' was not declared in this scope; did you mean 'char'?
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                               ^~~~~
      |                                               char
p1514.cpp:175:52: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                                    ^~
p1514.cpp:175:52: note: suggest parentheses around '>>' expression
p1514.cpp:175:55: error: 'is' was not declared in this scope; did you mean 'ws'?
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                                       ^~
      |                                                       ws
p1514.cpp:175:58: error: '.' cannot appear in a constant-expression
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                                          ^~~~~~
p1514.cpp:175:65: error: a function call cannot appear in a constant-expression
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                                                 ^
p1514.cpp:175:66: error: template argument 1 is invalid
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                                                  ^
p1514.cpp:175:31: error: parse error in template argument list
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p1514.cpp:176:3: error: expected unqualified-id before 'if'
  176 |   if (ctype.is(ctype.space, c) != 0)
      |   ^~
p1514.cpp:181:8: error: 'iostate' does not name a type
  181 |        iostate err = iostate::goodbit;
      |        ^~~~~~~
p1514.cpp:182:18: error: 'numget' was not declared in this scope; did you mean 'num_get'?
  182 |        use_facet<numget>(loc).get(*this, 0, *this, err, val);
      |                  ^~~~~~
      |                  num_get
p1514.cpp:182:8: error: specializing member '::use_facet<<expression error> >' requires 'template<>' syntax
  182 |        use_facet<numget>(loc).get(*this, 0, *this, err, val);
      |        ^~~~~~~~~~~~~~~~~
p1514.cpp:183:16: error: expected constructor, destructor, or type conversion before '(' token
  183 |        setstate(err);
      |                ^
p1514.cpp:187:8: error: expected class-name before '(' token
  187 | ~sentry();
      |        ^
p1514.cpp:189:1: error: 'explicit' outside class declaration
  189 | explicit operator bool() const;
      | ^~~~~~~~
p1514.cpp:189:26: error: non-member function 'std::operator bool()' cannot have cv-qualifier
  189 | explicit operator bool() const;
      |                          ^~~~~
p1514.cpp:189:10: error: 'std::operator bool()' must be a non-static member function
  189 | explicit operator bool() const;
      |          ^~~~~~~~
p1514.cpp:195:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  195 | basic_istream& operator>>(unsigned short& val);
      | ^~~~~~~~~~~~~
p1514.cpp:195:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:196:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  196 | basic_istream& operator>>(unsigned int& val);
      | ^~~~~~~~~~~~~
p1514.cpp:196:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:197:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  197 | basic_istream& operator>>(long& val);
      | ^~~~~~~~~~~~~
p1514.cpp:197:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:198:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  198 | basic_istream& operator>>(unsigned long& val);
      | ^~~~~~~~~~~~~
p1514.cpp:198:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:199:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  199 | basic_istream& operator>>(long long& val);
      | ^~~~~~~~~~~~~
p1514.cpp:199:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:200:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  200 | basic_istream& operator>>(unsigned long long& val);
      | ^~~~~~~~~~~~~
p1514.cpp:200:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:201:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  201 | basic_istream& operator>>(float& val);
      | ^~~~~~~~~~~~~
p1514.cpp:201:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:202:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  202 | basic_istream& operator>>(double& val);
      | ^~~~~~~~~~~~~
p1514.cpp:202:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:203:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  203 | basic_istream& operator>>(long double& val);
      | ^~~~~~~~~~~~~
p1514.cpp:203:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:204:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  204 | basic_istream& operator>>(bool& val);
      | ^~~~~~~~~~~~~
p1514.cpp:204:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:205:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  205 | basic_istream& operator>>(void*& val);
      | ^~~~~~~~~~~~~
p1514.cpp:205:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:209:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  209 | basic_istream& operator>>(short& val);
      | ^~~~~~~~~~~~~
p1514.cpp:209:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:211:14: error: expected nested-name-specifier before 'numget'
  211 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |              ^~~~~~
p1514.cpp:212:8: error: 'iostate' does not name a type
  212 |        iostate err = ios_base::goodbit;
      |        ^~~~~~~
p1514.cpp:214:18: error: 'numget' was not declared in this scope; did you mean 'num_get'?
  214 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |                  ^~~~~~
      |                  num_get
p1514.cpp:214:8: error: specializing member '::use_facet<<expression error> >' requires 'template<>' syntax
  214 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |        ^~~~~~~~~~~~~~~~~
p1514.cpp:215:8: error: expected unqualified-id before 'if'
  215 |        if (lval < numeric_limits<short>::min()) {
      |        ^~
p1514.cpp:218:10: error: expected unqualified-id before 'else'
  218 |        } else if (numeric_limits<short>::max() < lval) {
      |          ^~~~
p1514.cpp:221:11: error: expected unqualified-id before 'else'
  221 |        }  else
      |           ^~~~
p1514.cpp:225:16: error: expected constructor, destructor, or type conversion before '(' token
  225 |        setstate(err);
      |                ^
p1514.cpp:226:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  226 | basic_istream& operator>>(int& val);
      | ^~~~~~~~~~~~~
p1514.cpp:226:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:227:14: error: expected nested-name-specifier before 'numget'
  227 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |              ^~~~~~
p1514.cpp:228:8: error: 'iostate' does not name a type
  228 |        iostate err = ios_base::goodbit;
      |        ^~~~~~~
p1514.cpp:229:13: error: redefinition of 'long int std::lval'
  229 |        long lval;
      |             ^~~~
p1514.cpp:213:13: note: 'long int std::lval' previously declared here
  213 |        long lval;
      |             ^~~~
p1514.cpp:230:18: error: 'numget' was not declared in this scope; did you mean 'num_get'?
  230 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |                  ^~~~~~
      |                  num_get
p1514.cpp:230:8: error: specializing member '::use_facet<<expression error> >' requires 'template<>' syntax
  230 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |        ^~~~~~~~~~~~~~~~~
p1514.cpp:231:8: error: expected unqualified-id before 'if'
  231 |        if (lval < numeric_limits<int>::min()) {
      |        ^~
p1514.cpp:234:10: error: expected unqualified-id before 'else'
  234 |        } else if (numeric_limits<int>::max() < lval) {
      |          ^~~~
p1514.cpp:237:11: error: expected unqualified-id before 'else'
  237 |        }  else
      |           ^~~~
p1514.cpp:239:16: error: expected constructor, destructor, or type conversion before '(' token
  239 |        setstate(err);
      |                ^
p1514.cpp:241:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  241 | basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
      | ^~~~~~~~~~~~~
p1514.cpp:241:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:242:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      | ^~~~~~~~~~~~~
p1514.cpp:242:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:245:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  245 | basic_istream& operator>>(ios_base& (*pf)(ios_base&));
      | ^~~~~~~~~~~~~
p1514.cpp:245:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:270:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  270 | basic_istream& operator>>(basic_streambuf<charT, traits>* sb);
      | ^~~~~~~~~~~~~
p1514.cpp:270:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:278:21: error: non-member function 'std::streamsize std::gcount()' cannot have cv-qualifier
  278 | streamsize gcount() const;
      |                     ^~~~~
p1514.cpp:281:1: error: 'int_type' does not name a type
  281 | int_type get();
      | ^~~~~~~~
p1514.cpp:286:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  286 | basic_istream& get(char_type* s, streamsize n, char_type delim);
      | ^~~~~~~~~~~~~
p1514.cpp:286:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:291:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  291 | basic_istream& get(char_type* s, streamsize n);
      | ^~~~~~~~~~~~~
p1514.cpp:291:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:293:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  293 | basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
      | ^~~~~~~~~~~~~
p1514.cpp:293:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:301:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  301 | basic_istream& get(basic_streambuf<char_type, traits>& sb);
      | ^~~~~~~~~~~~~
p1514.cpp:301:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:304:1: error: invalid use of template-name 'std::basic_istream' without an argument list
  304 | basic_istream& getline(char_type* s, streamsize n, char_type delim);
      | ^~~~~~~~~~~~~
p1514.cpp:304:1: note: class template argument deduction is only available with '-std=c++17' or '-std=gnu++17'
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp: In function 'int main()':
p1514.cpp:332:1: error: 'main2' was not declared in this scope; did you mean 'main'?
  332 | main2();
      | ^~~~~
      | main
p1514.cpp: At global scope:
p1514.cpp:334:1: error: reference to 'basic_istream' is ambiguous
  334 | basic_istream& getline(char_type* s, streamsize n);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:339:7: error: reference to 'basic_istream' is ambiguous
  339 |       basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
      |       ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:345:1: error: 'int_type' does not name a type
  345 | int_type peek();
      | ^~~~~~~~
p1514.cpp:351:21: error: 'char_type' was not declared in this scope
  351 | streamsize readsome(char_type* s, streamsize n);
      |                     ^~~~~~~~~
p1514.cpp:351:32: error: 's' was not declared in this scope
  351 | streamsize readsome(char_type* s, streamsize n);
      |                                ^
p1514.cpp:351:46: error: expected primary-expression before 'n'
  351 | streamsize readsome(char_type* s, streamsize n);
      |                                              ^
p1514.cpp:351:47: error: expression list treated as compound expression in initializer [-fpermissive]
  351 | streamsize readsome(char_type* s, streamsize n);
      |                                               ^
p1514.cpp:355:1: error: reference to 'basic_istream' is ambiguous
  355 | basic_istream& putback(char_type c);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:368:6: error: reference to 'basic_istream' is ambiguous
  368 |      basic_istream<charT, traits>& ws(basic_istream<charT, traits>& is);
      |      ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:370:1: error: 'pos_type' does not name a type
  370 | pos_type tellg();
      | ^~~~~~~~
p1514.cpp:373:1: error: reference to 'basic_istream' is ambiguous
  373 | basic_istream& seekg(pos_type pos);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:376:1: error: reference to 'basic_istream' is ambiguous
  376 | basic_istream& seekg(off_type off, ios_base::seekdir dir);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_istream'
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:154:10: note:                 'int basic_istream(int*)'
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
p1514.cpp:382:10: error: expected unqualified-id before '&&' token
  382 |   Istream&& operator>>(Istream&& is, T&& x);
      |          ^~
p1514.cpp:386:8: error: 'is' does not name a type
  386 |        is >> std::forward<T>(x);
      |        ^~
p1514.cpp:387:8: error: expected unqualified-id before 'return'
  387 |        return std::move(is);
      |        ^~~~~~
p1514.cpp:391:59: error: spurious '>>', use '>' to terminate a template argument list
  391 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1514.cpp:392:11: error: class template 'basic_iostream' redeclared as non-template
  392 |     class basic_iostream
      |           ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:89:11: note: previous declaration here
   89 |     class basic_iostream;
      |           ^~~~~~~~~~~~~~
p1514.cpp:393:37: error: 'traits' was not declared in this scope
  393 |       : public basic_istream<charT, traits>,
      |                                     ^~~~~~
p1514.cpp:393:43: error: template argument 2 is invalid
  393 |       : public basic_istream<charT, traits>,
      |                                           ^
p1514.cpp:394:37: error: 'traits' was not declared in this scope
  394 |         public basic_ostream<charT, traits> {
      |                                     ^~~~~~
p1514.cpp:394:43: error: template argument 2 is invalid
  394 |         public basic_ostream<charT, traits> {
      |                                           ^
p1514.cpp:391:42: error: two or more data types in declaration of 'type name'
  391 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1514.cpp:410:2: error: expected '>' before ';' token
  410 | }; }
      |  ^
p1514.cpp:410:2: error: expected unqualified-id before ';' token
p1514.cpp:413:44: error: 'charT' was not declared in this scope; did you mean 'char'?
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |                                            ^~~~~
      |                                            char
p1514.cpp:413:51: error: 'traits' was not declared in this scope
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |                                                   ^~~~~~
p1514.cpp:413:57: error: template argument 1 is invalid
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |                                                         ^
p1514.cpp:413:57: error: template argument 2 is invalid
p1514.cpp:413:13: error: ISO C++ forbids declaration of 'basic_iostream' with no type [-fpermissive]
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~~
p1514.cpp:413:4: error: 'explicit' outside class declaration
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |    ^~~~~~~~
p1514.cpp:417:24: error: expected class-name before '(' token
  417 | virtual ~basic_iostream();
      |                        ^
p1514.cpp:420:1: error: reference to 'basic_iostream' is ambiguous
  420 | basic_iostream& operator=(basic_iostream&& rhs);
      | ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:89:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_iostream'
   89 |     class basic_iostream;
      |           ^~~~~~~~~~~~~~
p1514.cpp:413:13: note:                 'int basic_iostream(int*)'
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~~
p1514.cpp:422:6: error: variable or field 'swap' declared void
  422 | void swap(basic_iostream& rhs);
      |      ^~~~
p1514.cpp:422:11: error: reference to 'basic_iostream' is ambiguous
  422 | void swap(basic_iostream& rhs);
      |           ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:89:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_iostream'
   89 |     class basic_iostream;
      |           ^~~~~~~~~~~~~~
p1514.cpp:413:13: note:                 'int basic_iostream(int*)'
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~~
p1514.cpp:422:27: error: 'rhs' was not declared in this scope
  422 | void swap(basic_iostream& rhs);
      |                           ^~~
p1514.cpp:427:1: error: 'stream' does not name a type
  427 | stream buffer, along with a function template that inserts into stream rvalues.
      | ^~~~~~
p1514.cpp:541:43: error: 'charT' was not declared in this scope; did you mean 'char'?
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |                                           ^~~~~
      |                                           char
p1514.cpp:541:50: error: 'traits' was not declared in this scope
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |                                                  ^~~~~~
p1514.cpp:541:56: error: template argument 1 is invalid
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |                                                        ^
p1514.cpp:541:56: error: template argument 2 is invalid
p1514.cpp:541:13: error: ISO C++ forbids declaration of 'basic_ostream' with no type [-fpermissive]
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:541:4: error: 'explicit' outside class declaration
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |    ^~~~~~~~
p1514.cpp:542:14: error: expected constructor, destructor, or type conversion before '(' token
  542 | basic_ostream(basic_ostream&& rhs);
      |              ^
p1514.cpp:544:23: error: expected class-name before '(' token
  544 | virtual ~basic_ostream();
      |                       ^
p1514.cpp:547:1: error: reference to 'basic_ostream' is ambiguous
  547 | basic_ostream& operator=(basic_ostream&& rhs);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:549:6: error: variable or field 'swap' declared void
  549 | void swap(basic_ostream& rhs);
      |      ^~~~
p1514.cpp:549:11: error: reference to 'basic_ostream' is ambiguous
  549 | void swap(basic_ostream& rhs);
      |           ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:549:26: error: 'rhs' was not declared in this scope
  549 | void swap(basic_ostream& rhs);
      |                          ^~~
p1514.cpp:554:41: error: redefinition of 'class std::basic_ostream<_CharT, _Traits>::sentry'
  554 |     class basic_ostream<charT, traits>::sentry {
      |                                         ^~~~~~
/usr/local/include/c++/12.1.0/ostream:433:43: note: previous definition of 'class std::basic_ostream<_CharT, _Traits>::sentry'
  433 |     class basic_ostream<_CharT, _Traits>::sentry
      |                                           ^~~~~~
p1514.cpp:564:13: error: ISO C++ forbids declaration of 'sentry' with no type [-fpermissive]
  564 |    explicit sentry(basic_ostream& os);
      |             ^~~~~~
p1514.cpp:564:4: error: 'explicit' outside class declaration
  564 |    explicit sentry(basic_ostream& os);
      |    ^~~~~~~~
p1514.cpp:564:13: error: redefinition of 'int sentry'
  564 |    explicit sentry(basic_ostream& os);
      |             ^~~~~~
p1514.cpp:149:10: note: 'int sentry' previously defined here
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |          ^~~~~~
p1514.cpp:564:20: error: reference to 'basic_ostream' is ambiguous
  564 |    explicit sentry(basic_ostream& os);
      |                    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:564:35: error: 'os' was not declared in this scope; did you mean 'cos'?
  564 |    explicit sentry(basic_ostream& os);
      |                                   ^~
      |                                   cos
p1514.cpp:565:8: error: expected class-name before '(' token
  565 | ~sentry();
      |        ^
p1514.cpp:570:4: error: 'pos_type' does not name a type
  570 |    pos_type tellp();
      |    ^~~~~~~~
p1514.cpp:571:1: error: 'explicit' outside class declaration
  571 | explicit operator bool() const;
      | ^~~~~~~~
p1514.cpp:571:26: error: non-member function 'operator bool()' cannot have cv-qualifier
  571 | explicit operator bool() const;
      |                          ^~~~~
p1514.cpp:571:10: error: 'operator bool()' must be a non-static member function
  571 | explicit operator bool() const;
      |          ^~~~~~~~
p1514.cpp:579:4: error: reference to 'basic_ostream' is ambiguous
  579 |    basic_ostream& operator<<(bool val);
      |    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:580:4: error: reference to 'basic_ostream' is ambiguous
  580 |    basic_ostream& operator<<(short val);
      |    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:583:1: error: reference to 'basic_ostream' is ambiguous
  583 | basic_ostream& seekp(pos_type pos);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:586:1: error: reference to 'basic_ostream' is ambiguous
  586 | basic_ostream& seekp(off_type off, ios_base::seekdir dir);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:593:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:593:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:593:47: error: 'traits' was not declared in this scope
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:593:53: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:593:53: note: suggest parentheses around '>>' expression
p1514.cpp:594:7: error: template argument 1 is invalid
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |       ^
p1514.cpp:594:7: error: template argument 2 is invalid
p1514.cpp:594:16: error: a function call cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                ^
p1514.cpp:594:19: error: '.' cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                   ^~~
p1514.cpp:594:24: error: 'this' cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                        ^~~~
p1514.cpp:594:24: error: '*' cannot appear in a constant-expression
p1514.cpp:594:31: error: 'this' cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                               ^~~~
p1514.cpp:594:31: error: '*' cannot appear in a constant-expression
p1514.cpp:594:37: error: 'std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)' cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                     ^~~~
p1514.cpp:594:42: error: a function call cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                          ^
p1514.cpp:594:45: error: 'val' was not declared in this scope
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                             ^~~
p1514.cpp:594:48: error: a function call cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                                ^
p1514.cpp:594:50: error: '.' cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                                  ^~~~~~
p1514.cpp:594:57: error: a function call cannot appear in a constant-expression
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                                         ^
p1514.cpp:594:57: error: template argument 1 is invalid
p1514.cpp:594:57: error: template argument 2 is invalid
p1514.cpp:592:17: error: parse error in template argument list
  592 |   bool failed = use_facet<
      |                 ^~~~~~~~~~
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p1514.cpp:592:17: error: cannot resolve overloaded function 'use_facet' based on conversion to type 'bool'
p1514.cpp:596:49: error: cannot call member function 'std::ios_base::fmtflags std::ios_base::flags() const' without object
  596 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                                  ~~~~~~~~~~~~~~~^~
p1514.cpp:597:8: error: redefinition of 'bool failed'
  597 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:598:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:598:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:598:47: error: 'traits' was not declared in this scope
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:598:53: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:598:53: note: suggest parentheses around '>>' expression
p1514.cpp:599:7: error: template argument 1 is invalid
  599 |       >(getloc()).put(*this, *this, fill(),
      |       ^
p1514.cpp:599:7: error: template argument 2 is invalid
p1514.cpp:599:16: error: a function call cannot appear in a constant-expression
  599 |       >(getloc()).put(*this, *this, fill(),
      |                ^
p1514.cpp:599:19: error: '.' cannot appear in a constant-expression
  599 |       >(getloc()).put(*this, *this, fill(),
      |                   ^~~
p1514.cpp:599:24: error: 'this' cannot appear in a constant-expression
  599 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:599:24: error: '*' cannot appear in a constant-expression
p1514.cpp:599:31: error: 'this' cannot appear in a constant-expression
  599 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:599:31: error: '*' cannot appear in a constant-expression
p1514.cpp:599:37: error: 'std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)' cannot appear in a constant-expression
  599 |       >(getloc()).put(*this, *this, fill(),
      |                                     ^~~~
p1514.cpp:599:42: error: a function call cannot appear in a constant-expression
  599 |       >(getloc()).put(*this, *this, fill(),
      |                                          ^
p1514.cpp:600:7: error: 'baseflags' cannot appear in a constant-expression
  600 |       baseflags == ios_base::oct || baseflags == ios_base::hex
      |       ^~~~~~~~~
p1514.cpp:600:37: error: 'baseflags' cannot appear in a constant-expression
  600 |       baseflags == ios_base::oct || baseflags == ios_base::hex
      |                                     ^~~~~~~~~
p1514.cpp:601:57: error: 'val' was not declared in this scope
  601 |         ? static_cast<long>(static_cast<unsigned short>(val))
      |                                                         ^~~
p1514.cpp:602:29: error: 'val' was not declared in this scope
  602 |         : static_cast<long>(val)).failed();
      |                             ^~~
p1514.cpp:602:33: error: a function call cannot appear in a constant-expression
  602 |         : static_cast<long>(val)).failed();
      |                                 ^
p1514.cpp:602:35: error: '.' cannot appear in a constant-expression
  602 |         : static_cast<long>(val)).failed();
      |                                   ^~~~~~
p1514.cpp:602:42: error: a function call cannot appear in a constant-expression
  602 |         : static_cast<long>(val)).failed();
      |                                          ^
p1514.cpp:602:42: error: template argument 1 is invalid
p1514.cpp:602:42: error: template argument 2 is invalid
p1514.cpp:597:17: error: parse error in template argument list
  597 |   bool failed = use_facet<
      |                 ^~~~~~~~~~
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  599 |       >(getloc()).put(*this, *this, fill(),
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  600 |       baseflags == ios_base::oct || baseflags == ios_base::hex
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  601 |         ? static_cast<long>(static_cast<unsigned short>(val))
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  602 |         : static_cast<long>(val)).failed();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p1514.cpp:604:22: error: redefinition of 'std::ios_base::fmtflags baseflags'
  604 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                      ^~~~~~~~~
p1514.cpp:596:22: note: 'std::ios_base::fmtflags baseflags' previously defined here
  596 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                      ^~~~~~~~~
p1514.cpp:604:49: error: cannot call member function 'std::ios_base::fmtflags std::ios_base::flags() const' without object
  604 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                                  ~~~~~~~~~~~~~~~^~
p1514.cpp:605:8: error: redefinition of 'bool failed'
  605 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:606:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:606:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:606:47: error: 'traits' was not declared in this scope
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:606:53: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:606:53: note: suggest parentheses around '>>' expression
p1514.cpp:607:7: error: template argument 1 is invalid
  607 |       >(getloc()).put(*this, *this, fill(),
      |       ^
p1514.cpp:607:7: error: template argument 2 is invalid
p1514.cpp:607:16: error: a function call cannot appear in a constant-expression
  607 |       >(getloc()).put(*this, *this, fill(),
      |                ^
p1514.cpp:607:19: error: '.' cannot appear in a constant-expression
  607 |       >(getloc()).put(*this, *this, fill(),
      |                   ^~~
p1514.cpp:607:24: error: 'this' cannot appear in a constant-expression
  607 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:607:24: error: '*' cannot appear in a constant-expression
p1514.cpp:607:31: error: 'this' cannot appear in a constant-expression
  607 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:607:31: error: '*' cannot appear in a constant-expression
p1514.cpp:607:37: error: 'std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)' cannot appear in a constant-expression
  607 |       >(getloc()).put(*this, *this, fill(),
      |                                     ^~~~
p1514.cpp:607:42: error: a function call cannot appear in a constant-expression
  607 |       >(getloc()).put(*this, *this, fill(),
      |                                          ^
p1514.cpp:608:7: error: 'baseflags' cannot appear in a constant-expression
  608 |       baseflags == ios_base::oct || baseflags == ios_base::hex
      |       ^~~~~~~~~
p1514.cpp:608:37: error: 'baseflags' cannot appear in a constant-expression
  608 |       baseflags == ios_base::oct || baseflags == ios_base::hex
      |                                     ^~~~~~~~~
p1514.cpp:609:55: error: 'val' was not declared in this scope
  609 |         ? static_cast<long>(static_cast<unsigned int>(val))
      |                                                       ^~~
p1514.cpp:610:29: error: 'val' was not declared in this scope
  610 |         : static_cast<long>(val)).failed();
      |                             ^~~
p1514.cpp:610:33: error: a function call cannot appear in a constant-expression
  610 |         : static_cast<long>(val)).failed();
      |                                 ^
p1514.cpp:610:35: error: '.' cannot appear in a constant-expression
  610 |         : static_cast<long>(val)).failed();
      |                                   ^~~~~~
p1514.cpp:610:42: error: a function call cannot appear in a constant-expression
  610 |         : static_cast<long>(val)).failed();
      |                                          ^
p1514.cpp:610:42: error: template argument 1 is invalid
p1514.cpp:610:42: error: template argument 2 is invalid
p1514.cpp:605:17: error: parse error in template argument list
  605 |   bool failed = use_facet<
      |                 ^~~~~~~~~~
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  607 |       >(getloc()).put(*this, *this, fill(),
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  608 |       baseflags == ios_base::oct || baseflags == ios_base::hex
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  609 |         ? static_cast<long>(static_cast<unsigned int>(val))
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  610 |         : static_cast<long>(val)).failed();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p1514.cpp:612:8: error: redefinition of 'bool failed'
  612 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:613:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:613:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:613:47: error: 'traits' was not declared in this scope
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:613:53: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:613:53: note: suggest parentheses around '>>' expression
p1514.cpp:614:7: error: template argument 1 is invalid
  614 |       >(getloc()).put(*this, *this, fill(),
      |       ^
p1514.cpp:614:7: error: template argument 2 is invalid
p1514.cpp:614:16: error: a function call cannot appear in a constant-expression
  614 |       >(getloc()).put(*this, *this, fill(),
      |                ^
p1514.cpp:614:19: error: '.' cannot appear in a constant-expression
  614 |       >(getloc()).put(*this, *this, fill(),
      |                   ^~~
p1514.cpp:614:24: error: 'this' cannot appear in a constant-expression
  614 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:614:24: error: '*' cannot appear in a constant-expression
p1514.cpp:614:31: error: 'this' cannot appear in a constant-expression
  614 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:614:31: error: '*' cannot appear in a constant-expression
p1514.cpp:614:37: error: 'std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)' cannot appear in a constant-expression
  614 |       >(getloc()).put(*this, *this, fill(),
      |                                     ^~~~
p1514.cpp:614:42: error: a function call cannot appear in a constant-expression
  614 |       >(getloc()).put(*this, *this, fill(),
      |                                          ^
p1514.cpp:615:36: error: 'val' was not declared in this scope
  615 |         static_cast<unsigned long>(val)).failed();
      |                                    ^~~
p1514.cpp:615:40: error: a function call cannot appear in a constant-expression
  615 |         static_cast<unsigned long>(val)).failed();
      |                                        ^
p1514.cpp:615:42: error: '.' cannot appear in a constant-expression
  615 |         static_cast<unsigned long>(val)).failed();
      |                                          ^~~~~~
p1514.cpp:615:49: error: a function call cannot appear in a constant-expression
  615 |         static_cast<unsigned long>(val)).failed();
      |                                                 ^
p1514.cpp:615:49: error: template argument 1 is invalid
p1514.cpp:615:49: error: template argument 2 is invalid
p1514.cpp:612:17: error: parse error in template argument list
  612 |   bool failed = use_facet<
      |                 ^~~~~~~~~~
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  614 |       >(getloc()).put(*this, *this, fill(),
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  615 |         static_cast<unsigned long>(val)).failed();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p1514.cpp:617:8: error: redefinition of 'bool failed'
  617 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:618:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:618:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:618:47: error: 'traits' was not declared in this scope
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:618:53: warning: '>>' operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:618:53: note: suggest parentheses around '>>' expression
p1514.cpp:619:7: error: template argument 1 is invalid
  619 |       >(getloc()).put(*this, *this, fill(),
      |       ^
p1514.cpp:619:7: error: template argument 2 is invalid
p1514.cpp:619:16: error: a function call cannot appear in a constant-expression
  619 |       >(getloc()).put(*this, *this, fill(),
      |                ^
p1514.cpp:619:19: error: '.' cannot appear in a constant-expression
  619 |       >(getloc()).put(*this, *this, fill(),
      |                   ^~~
p1514.cpp:619:24: error: 'this' cannot appear in a constant-expression
  619 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:619:24: error: '*' cannot appear in a constant-expression
p1514.cpp:619:31: error: 'this' cannot appear in a constant-expression
  619 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:619:31: error: '*' cannot appear in a constant-expression
p1514.cpp:619:37: error: 'std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)' cannot appear in a constant-expression
  619 |       >(getloc()).put(*this, *this, fill(),
      |                                     ^~~~
p1514.cpp:619:42: error: a function call cannot appear in a constant-expression
  619 |       >(getloc()).put(*this, *this, fill(),
      |                                          ^
p1514.cpp:620:29: error: 'val' was not declared in this scope
  620 |         static_cast<double>(val)).failed();
      |                             ^~~
p1514.cpp:620:32: error: a cast to a type other than an integral or enumeration type cannot appear in a constant-expression
  620 |         static_cast<double>(val)).failed();
      |                                ^
p1514.cpp:620:33: error: a function call cannot appear in a constant-expression
  620 |         static_cast<double>(val)).failed();
      |                                 ^
p1514.cpp:620:35: error: '.' cannot appear in a constant-expression
  620 |         static_cast<double>(val)).failed();
      |                                   ^~~~~~
p1514.cpp:620:42: error: a function call cannot appear in a constant-expression
  620 |         static_cast<double>(val)).failed();
      |                                          ^
p1514.cpp:620:42: error: template argument 1 is invalid
p1514.cpp:620:42: error: template argument 2 is invalid
p1514.cpp:617:17: error: parse error in template argument list
  617 |   bool failed = use_facet<
      |                 ^~~~~~~~~~
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619 |       >(getloc()).put(*this, *this, fill(),
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  620 |         static_cast<double>(val)).failed();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p1514.cpp:623:1: error: reference to 'basic_ostream' is ambiguous
  623 | basic_ostream& operator<<(unsigned short val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:624:1: error: reference to 'basic_ostream' is ambiguous
  624 | basic_ostream& operator<<(int val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:625:1: error: reference to 'basic_ostream' is ambiguous
  625 | basic_ostream& operator<<(unsigned int val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:626:1: error: reference to 'basic_ostream' is ambiguous
  626 | basic_ostream& operator<<(long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:627:1: error: reference to 'basic_ostream' is ambiguous
  627 | basic_ostream& operator<<(unsigned long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:628:1: error: reference to 'basic_ostream' is ambiguous
  628 | basic_ostream& operator<<(long long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:629:1: error: reference to 'basic_ostream' is ambiguous
  629 | basic_ostream& operator<<(unsigned long long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:630:1: error: reference to 'basic_ostream' is ambiguous
  630 | basic_ostream& operator<<(float val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:631:1: error: reference to 'basic_ostream' is ambiguous
  631 | basic_ostream& operator<<(double val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:632:1: error: reference to 'basic_ostream' is ambiguous
  632 | basic_ostream& operator<<(long double val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:633:1: error: reference to 'basic_ostream' is ambiguous
  633 | basic_ostream& operator<<(const void* val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:635:6: error: reference to 'basic_ostream' is ambiguous
  635 |      basic_ostream& operator<<(const volatile void* p);
      |      ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:638:1: error: reference to 'basic_ostream' is ambiguous
  638 | basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:640:1: error: reference to 'basic_ostream' is ambiguous
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:643:1: error: reference to 'basic_ostream' is ambiguous
  643 | basic_ostream& operator<<(ios_base& (*pf)(ios_base&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:646:1: error: reference to 'basic_ostream' is ambiguous
  646 | basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:653:1: error: reference to 'basic_ostream' is ambiguous
  653 | basic_ostream& operator<<(nullptr_t);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:655:1: error: 'where' does not name a type
  655 | where s is an implementation-defined NTCTS (3.37).
      | ^~~~~
p1514.cpp:660:3: error: reference to 'basic_ostream' is ambiguous
  660 |   basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, char c);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:663:3: error: reference to 'basic_ostream' is ambiguous
  663 |   basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, char c);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:666:3: error: reference to 'basic_ostream' is ambiguous
  666 |   basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, signed char c);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:668:3: error: reference to 'basic_ostream' is ambiguous
  668 |   basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, unsigned char c);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:672:1: error: 'out' does not name a type
  672 | out.widen(c);
      | ^~~
p1514.cpp:676:3: error: reference to 'basic_ostream' is ambiguous
  676 |   basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const charT* s);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:678:3: error: reference to 'basic_ostream' is ambiguous
  678 |   basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const char* s);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:680:3: error: reference to 'basic_ostream' is ambiguous
  680 |   basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const char* s);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:682:3: error: reference to 'basic_ostream' is ambiguous
  682 |   basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const signed char* s);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:684:3: error: reference to 'basic_ostream' is ambiguous
  684 |   basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out,
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:688:6: error: reference to 'basic_ostream' is ambiguous
  688 |      basic_ostream& put(char_type c);
      |      ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:694:1: error: reference to 'basic_ostream' is ambiguous
  694 | basic_ostream& write(const char_type* s, streamsize n);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:701:4: error: reference to 'basic_ostream' is ambiguous
  701 |    basic_ostream& flush();
      |    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:704:6: error: reference to 'basic_ostream' is ambiguous
  704 |      basic_ostream<charT, traits>& endl(basic_ostream<charT, traits>& os);
      |      ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:709:3: error: reference to 'basic_ostream' is ambiguous
  709 |   basic_ostream<charT, traits>& ends(basic_ostream<charT, traits>& os);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:712:3: error: reference to 'basic_ostream' is ambiguous
  712 |   basic_ostream<charT, traits>& flush(basic_ostream<charT, traits>& os);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:715:3: error: reference to 'basic_ostream' is ambiguous
  715 |   basic_ostream<charT, traits>& emit_on_flush(basic_ostream<charT, traits>& os);
      |   ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: candidates are: 'template<class _CharT, class _Traits> class std::basic_ostream'
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:541:13: note:                 'int basic_ostream(int*)'
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
p1514.cpp:717:1: error: expected unqualified-id before '[' token
  717 | [// Note 1: To work around the issue that the Allocator template argument cannot be deduced, implementations can introduce an intermediate base class to basic_syncbuf that manages its emit_on_sync flag. —end note]
      | ^
p1514.cpp:722:8: error: found ':' in nested-name-specifier, expected '::'
  722 | Returns: os.
      |        ^
      |        ::
p1514.cpp:722:1: error: 'Returns' does not name a type
  722 | Returns: os.
      | ^~~~~~~
p1514.cpp:729:10: error: expected unqualified-id before '&&' token
  729 |   Ostream&& operator<<(Ostream&& os, const T& x);
      |          ^~
p1514.cpp:739:8: error: redefinition of 'void f(std::ios_base&, std::ios_base::fmtflags)'
  739 |   void f(ios_base& str, ios_base::fmtflags mask) {
      |        ^
p1514.cpp:733:8: note: 'void f(std::ios_base&, std::ios_base::fmtflags)' previously defined here
  733 |   void f(ios_base& str, ios_base::fmtflags mask) {
      |        ^
p1514.cpp:757:1: error: 'unspecified' does not name a type
  757 | unspecified resetiosflags(ios_base::fmtflags mask);
      | ^~~~~~~~~~~
p1514.cpp:758:1: error: 'unspecified' does not name a type
  758 | unspecified setiosflags(ios_base::fmtflags mask);
      | ^~~~~~~~~~~
p1514.cpp:759:1: error: 'unspecified' does not name a type
  759 | unspecified setbase(int base);
      | ^~~~~~~~~~~
p1514.cpp:760:1: error: 'unspecified' does not name a type
  760 | unspecified setfill(char_type c);
      | ^~~~~~~~~~~
p1514.cpp:763:8: error: redefinition of 'void f(std::ios_base&, int)'
  763 |   void f(ios_base& str, int n) {
      |        ^
p1514.cpp:745:6: note: 'void f(std::ios_base&, int)' previously defined here
  745 | void f(ios_base& str, int base) {
      |      ^
p1514.cpp:775:8: error: redefinition of 'void f(std::ios_base&, int)'
  775 |   void f(ios_base& str, int n) {
      |        ^
p1514.cpp:745:6: note: 'void f(std::ios_base&, int)' previously defined here
  745 | void f(ios_base& str, int base) {
      |      ^
p1514.cpp:780:1: error: 'unspecified' does not name a type
  780 | unspecified setw(int n);
      | ^~~~~~~~~~~
p1514.cpp:783:24: error: 'unspecified' does not name a type
  783 | template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false);
      |                        ^~~~~~~~~~~
p1514.cpp: In function 'void f(std::basic_ios<_CharT, _Traits>&, moneyT&, bool)':
p1514.cpp:789:11: error: expected nested-name-specifier before 'Iter'
  789 |     using Iter     = istreambuf_iterator<charT, traits>;
      |           ^~~~
p1514.cpp:790:11: error: expected nested-name-specifier before 'MoneyGet'
  790 |     using MoneyGet = money_get<charT, Iter>;
      |           ^~~~~~~~
p1514.cpp:792:11: error: 'MoneyGet' does not name a type; did you mean 'moneyT'?
  792 |     const MoneyGet& mg = use_facet<MoneyGet>(str.getloc());
      |           ^~~~~~~~
      |           moneyT
p1514.cpp:793:5: error: 'mg' was not declared in this scope
  793 |     mg.get(Iter(str.rdbuf()), Iter(), intl, str, err, mon);
      |     ^~
p1514.cpp:793:31: error: there are no arguments to 'Iter' that depend on a template parameter, so a declaration of 'Iter' must be available [-fpermissive]
  793 |     mg.get(Iter(str.rdbuf()), Iter(), intl, str, err, mon);
      |                               ^~~~
p1514.cpp:793:31: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
p1514.cpp: At global scope:
p1514.cpp:797:23: error: 'unspecified' does not name a type
  797 | template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                       ^~~~~~~~~~~
p1514.cpp:799:24: error: 'unspecified' does not name a type
  799 | template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false);
      |                        ^~~~~~~~~~~
p1514.cpp:801:23: error: 'unspecified' does not name a type
  801 | template<class charT> unspecified get_time(tm* tmb, const charT* fmt);
      |                       ^~~~~~~~~~~
p1514.cpp: In function 'void f(std::basic_ios<_CharT, _Traits>&, const moneyT&, bool)':
p1514.cpp:807:11: error: expected nested-name-specifier before 'Iter'
  807 |     using Iter     = ostreambuf_iterator<charT, traits>;
      |           ^~~~
p1514.cpp:808:11: error: expected nested-name-specifier before 'MoneyPut'
  808 |     using MoneyPut = money_put<charT, Iter>;
      |           ^~~~~~~~
p1514.cpp:809:11: error: 'MoneyPut' does not name a type; did you mean 'moneyT'?
  809 |     const MoneyPut& mp = use_facet<MoneyPut>(str.getloc());
      |           ^~~~~~~~
      |           moneyT
p1514.cpp:810:11: error: 'Iter' does not name a type
  810 |     const Iter end = mp.put(Iter(str.rdbuf()), intl, str, str.fill(), mon);
      |           ^~~~
p1514.cpp:811:9: error: 'end' was not declared in this scope
  811 |     if (end.failed())
      |         ^~~
p1514.cpp:811:9: note: 'std::end' is only available from C++11 onwards
p1514.cpp: In function 'void f(std::basic_ios<_CharT, _Traits>&, tm*, const charT*)':
p1514.cpp:818:11: error: expected nested-name-specifier before 'Iter'
  818 |     using Iter    = istreambuf_iterator<charT, traits>;
      |           ^~~~
p1514.cpp:819:11: error: expected nested-name-specifier before 'TimeGet'
  819 |     using TimeGet = time_get<charT, Iter>;
      |           ^~~~~~~
p1514.cpp:821:11: error: 'TimeGet' does not name a type
  821 |     const TimeGet& tg = use_facet<TimeGet>(str.getloc());
      |           ^~~~~~~
p1514.cpp:822:5: error: 'tg' was not declared in this scope; did you mean 'tm'?
  822 |     tg.get(Iter(str.rdbuf()), Iter(), str, err, tmb,
      |     ^~
      |     tm
p1514.cpp:822:31: error: there are no arguments to 'Iter' that depend on a template parameter, so a declaration of 'Iter' must be available [-fpermissive]
  822 |     tg.get(Iter(str.rdbuf()), Iter(), str, err, tmb,
      |                               ^~~~
p1514.cpp: In function 'void f(std::basic_ios<_CharT, _Traits>&, const tm*, const charT*)':
p1514.cpp:831:11: error: expected nested-name-specifier before 'Iter'
  831 |     using Iter    = ostreambuf_iterator<charT, traits>;
      |           ^~~~
p1514.cpp:832:11: error: expected nested-name-specifier before 'TimePut'
  832 |     using TimePut = time_put<charT, Iter>;
      |           ^~~~~~~
p1514.cpp:833:7: error: 'TimePut' does not name a type
  833 | const TimePut& tp = use_facet<TimePut>(str.getloc());
      |       ^~~~~~~
p1514.cpp:834:1: error: 'unspecified' was not declared in this scope
  834 | unspecified quoted(basic_string_view<charT, traits> s,
      | ^~~~~~~~~~~
p1514.cpp:839:1: error: 'traits_type' has not been declared
  839 | traits_type::eq, first output escape.
      | ^~~~~~~~~~~
p1514.cpp:839:18: error: 'first' was not declared in this scope
  839 | traits_type::eq, first output escape.
      |                  ^~~~~
p1514.cpp:844:17: error: 'end' was not declared in this scope
  844 |             if (end.failed())
      |                 ^~~
p1514.cpp:844:17: note: 'std::end' is only available from C++11 onwards
p1514.cpp: At global scope:
p1514.cpp:851:1: error: 'unspecified' does not name a type
  851 | unspecified quoted(const charT* s, charT delim = charT(), charT escape = charT());
      | ^~~~~~~~~~~
p1514.cpp:853:1: error: 'unspecified' does not name a type
  853 | unspecified quoted(const basic_string<charT, traits, Allocator>& s,
      | ^~~~~~~~~~~
p1514.cpp:856:10: error: declaration of template parameter 'charT' shadows template parameter
  856 | template<class charT, class traits, class Allocator>
      |          ^~~~~
p1514.cpp:855:13: note: template parameter 'charT' declared here
  855 |    template<class charT, class traits>
      |             ^~~~~
p1514.cpp:856:23: error: declaration of template parameter 'traits' shadows template parameter
  856 | template<class charT, class traits, class Allocator>
      |                       ^~~~~
p1514.cpp:855:26: note: template parameter 'traits' declared here
  855 |    template<class charT, class traits>
      |                          ^~~~~
p1514.cpp:857:1: error: 'unspecified' does not name a type
  857 | unspecified quoted(basic_string<charT, traits, Allocator>& s,   charT delim = charT(),
      | ^~~~~~~~~~~

$ g++ p1514.cpp -std=2b -o p1514g -I. -Wall
p1514.cpp:16:27: error: redefinition of default argument for 'class traits'
   16 |     template<class charT, class traits = char_traits<charT>>
      |                           ^~~~~
In file included from /usr/local/include/c++/12.1.0/ios:38,
                 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 p1514.cpp:10:
/usr/local/include/c++/12.1.0/iosfwd:82:29: note: original definition appeared here
   82 |   template<typename _CharT, typename _Traits = char_traits<_CharT> >
      |                             ^~~~~~~~
p1514.cpp:20:27: error: redefinition of default argument for 'class traits'
   20 |     template<class charT, class traits = char_traits<charT>>
      |                           ^~~~~
/usr/local/include/c++/12.1.0/iosfwd:88:29: note: original definition appeared here
   88 |   template<typename _CharT, typename _Traits = char_traits<_CharT> >
      |                             ^~~~~~~~
p1514.cpp:28:1: error: expected unqualified-id before '[' token
   28 | [iostream.format] [istream.syn]
      | ^
p1514.cpp:32:27: error: redefinition of default argument for 'class traits'
   32 |     template<class charT, class traits = char_traits<charT>>
      |                           ^~~~~
/usr/local/include/c++/12.1.0/iosfwd:85:29: note: original definition appeared here
   85 |   template<typename _CharT, typename _Traits = char_traits<_CharT> >
      |                             ^~~~~~~~
p1514.cpp:53:1: error: 'unspecified' does not name a type
   53 | unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
      | ^~~~~~~~~~~
p1514.cpp:53:53: error: 'unspecified' does not name a type
   53 | unspecified resetiosflags(ios_base::fmtflags mask); unspecified setiosflags (ios_base::fmtflags mask);
      |                                                     ^~~~~~~~~~~
p1514.cpp:55:1: error: 'unspecified' does not name a type
   55 | unspecified setbase(int base);
      | ^~~~~~~~~~~
p1514.cpp:56:23: error: 'unspecified' does not name a type
   56 | template<class charT> unspecified setfill(charT c);
      |                       ^~~~~~~~~~~
p1514.cpp:57:1: error: 'unspecified' does not name a type
   57 | unspecified setprecision(int n);
      | ^~~~~~~~~~~
p1514.cpp:58:1: error: 'unspecified' does not name a type
   58 | unspecified setw(int n);
      | ^~~~~~~~~~~
p1514.cpp:59:24: error: 'unspecified' does not name a type
   59 | template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                        ^~~~~~~~~~~
p1514.cpp:59:102: error: 'unspecified' does not name a type
   59 | s moneyT> unspecified get_money(moneyT& mon, bool intl = false); template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                                                                                         ^~~~~~~~~~~

p1514.cpp:59:185: error: 'unspecified' does not name a type
   59 | eyT> unspecified put_money(const moneyT& mon, bool intl = false); template<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                                                                                         ^~~~~~~~~~~

p1514.cpp:59:256: error: 'unspecified' does not name a type
   59 | ate<class charT> unspecified get_time(tm* tmb, const charT* fmt); template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                                                                                         ^~~~~~~~~~~

p1514.cpp:61:1: error: 'unspecified' does not name a type
   61 | unspecified quoted(const charT* s, charT delim = charT('"'), charT escape = charT('\\'));
      | ^~~~~~~~~~~
p1514.cpp:63:1: error: 'unspecified' does not name a type
   63 | unspecified quoted(const basic_string<charT, traits, Allocator>& s,
      | ^~~~~~~~~~~
p1514.cpp:65:54: error: 'unspecified' does not name a type
   65 | template<class charT, class traits, class Allocator> unspecified quoted(basic_string<charT, traits, Allocator>& s,
      |                                                      ^~~~~~~~~~~
p1514.cpp:68:1: error: 'unspecified' does not name a type
   68 | unspecified quoted(basic_string_view<charT, traits> s,
      | ^~~~~~~~~~~
p1514.cpp:77:27: error: redefinition of default argument for 'class traits'
   77 |     template<class charT, class traits = char_traits<charT>>
      |                           ^~~~~
/usr/local/include/c++/12.1.0/iosfwd:82:29: note: original definition appeared here
   82 |   template<typename _CharT, typename _Traits = char_traits<_CharT> >
      |                             ^~~~~~~~
p1514.cpp:132:24: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                        ^~~~~
      |                        char
p1514.cpp:132:31: error: 'traits' was not declared in this scope
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                               ^~~~~~
p1514.cpp:132:37: error: template argument 1 is invalid
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                     ^
p1514.cpp:132:37: error: template argument 2 is invalid
p1514.cpp:132:65: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                 ^~~~~
      |                                                                 char
p1514.cpp:132:72: error: 'traits' was not declared in this scope
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                        ^~~~~~
p1514.cpp:132:78: error: template argument 1 is invalid
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                              ^
p1514.cpp:132:78: error: template argument 2 is invalid
p1514.cpp:132:82: error: 'charT' has not been declared
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                                                                  ^~~~~
p1514.cpp:132:40: error: 'int& std::operator>>(int&, int&)' must have an argument of class or enumerated type
  132 |          basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>&, charT&);
      |                                        ^~~~~~~~
p1514.cpp:147:1: error: expected declaration before '}' token
  147 | }
      | ^
p1514.cpp:149:17: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |                 ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:149:34: error: expected ')' before ',' token
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |                ~                 ^
      |                                  )
p1514.cpp:149:10: error: ISO C++ forbids declaration of 'sentry' with no type [-fpermissive]
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |          ^~~~~~
p1514.cpp:149:1: error: 'explicit' outside class declaration
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      | ^~~~~~~~
p1514.cpp:149:36: error: expected unqualified-id before 'bool'
  149 | explicit sentry(basic_istream& is, bool noskipws = false);
      |                                    ^~~~
p1514.cpp:154:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |                                        ^~~~~
      |                                        char
p1514.cpp:154:47: error: 'traits' was not declared in this scope
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |                                               ^~~~~~
p1514.cpp:154:53: error: template argument 1 is invalid
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |                                                     ^
p1514.cpp:154:53: error: template argument 2 is invalid
p1514.cpp:154:10: error: deduction guide for 'std::basic_istream<_CharT, _Traits>' must have trailing return type
  154 | explicit basic_istream(basic_streambuf<charT, traits>* sb);
      |          ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:155:15: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  155 | basic_istream(basic_istream&& rhs);
      |               ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:155:1: error: deduction guide for 'std::basic_istream<_CharT, _Traits>' must have trailing return type
  155 | basic_istream(basic_istream&& rhs);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:157:23: error: expected class-name before '(' token
  157 | virtual ~basic_istream();
      |                       ^
p1514.cpp:160:26: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  160 | basic_istream& operator=(basic_istream&& rhs);
      |                          ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:160:1: error: deduced class type 'basic_istream' in function return type
  160 | basic_istream& operator=(basic_istream&& rhs);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:162:11: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  162 | void swap(basic_istream& rhs);
      |           ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:167:41: error: redefinition of 'class std::basic_istream<_CharT, _Traits>::sentry'
  167 |     class basic_istream<charT, traits>::sentry {
      |                                         ^~~~~~
In file included from /usr/local/include/c++/12.1.0/iostream:40:
/usr/local/include/c++/12.1.0/istream:686:43: note: previous definition of 'class std::basic_istream<_CharT, _Traits>::sentry'
  686 |     class basic_istream<_CharT, _Traits>::sentry
      |                                           ^~~~~~
p1514.cpp:175:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |               ^~~~~
      |               char
p1514.cpp:175:20: error: template argument 1 is invalid
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                    ^
p1514.cpp:175:23: error: 'const int& std::ctype' redeclared as different kind of entity
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                       ^~~~~
In file included from /usr/local/include/c++/12.1.0/ios:41:
/usr/local/include/c++/12.1.0/bits/localefwd.h:127:11: note: previous declaration 'template<class _CharT> class std::ctype'
  127 |     class ctype;
      |           ^~~~~
p1514.cpp:175:47: error: 'charT' was not declared in this scope; did you mean 'char'?
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                               ^~~~~
      |                                               char
p1514.cpp:175:47: error: template argument 1 is invalid
p1514.cpp:175:55: error: 'is' was not declared in this scope; did you mean 'ws'?
  175 |   const ctype<charT>& ctype = use_facet<ctype<charT>>(is.getloc());
      |                                                       ^~
      |                                                       ws
p1514.cpp:176:3: error: expected unqualified-id before 'if'
  176 |   if (ctype.is(ctype.space, c) != 0)
      |   ^~
p1514.cpp:181:8: error: 'iostate' does not name a type; did you mean 'monostate'?
  181 |        iostate err = iostate::goodbit;
      |        ^~~~~~~
      |        monostate
p1514.cpp:182:18: error: 'numget' was not declared in this scope; did you mean 'num_get'?
  182 |        use_facet<numget>(loc).get(*this, 0, *this, err, val);
      |                  ^~~~~~
      |                  num_get
p1514.cpp:182:8: error: specializing member '::use_facet<<expression error> >' requires 'template<>' syntax
  182 |        use_facet<numget>(loc).get(*this, 0, *this, err, val);
      |        ^~~~~~~~~~~~~~~~~
p1514.cpp:183:16: error: expected constructor, destructor, or type conversion before '(' token
  183 |        setstate(err);
      |                ^
p1514.cpp:187:8: error: expected class-name before '(' token
  187 | ~sentry();
      |        ^
p1514.cpp:189:1: error: 'explicit' outside class declaration
  189 | explicit operator bool() const;
      | ^~~~~~~~
p1514.cpp:189:26: error: non-member function 'std::operator bool()' cannot have cv-qualifier
  189 | explicit operator bool() const;
      |                          ^~~~~
p1514.cpp:189:10: error: 'std::operator bool()' must be a non-static member function
  189 | explicit operator bool() const;
      |          ^~~~~~~~
p1514.cpp:195:1: error: deduced class type 'basic_istream' in function return type
  195 | basic_istream& operator>>(unsigned short& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:196:1: error: deduced class type 'basic_istream' in function return type
  196 | basic_istream& operator>>(unsigned int& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:197:1: error: deduced class type 'basic_istream' in function return type
  197 | basic_istream& operator>>(long& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:198:1: error: deduced class type 'basic_istream' in function return type
  198 | basic_istream& operator>>(unsigned long& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:199:1: error: deduced class type 'basic_istream' in function return type
  199 | basic_istream& operator>>(long long& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:200:1: error: deduced class type 'basic_istream' in function return type
  200 | basic_istream& operator>>(unsigned long long& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:201:1: error: deduced class type 'basic_istream' in function return type
  201 | basic_istream& operator>>(float& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:202:1: error: deduced class type 'basic_istream' in function return type
  202 | basic_istream& operator>>(double& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:203:1: error: deduced class type 'basic_istream' in function return type
  203 | basic_istream& operator>>(long double& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:204:1: error: deduced class type 'basic_istream' in function return type
  204 | basic_istream& operator>>(bool& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:205:1: error: deduced class type 'basic_istream' in function return type
  205 | basic_istream& operator>>(void*& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:209:1: error: deduced class type 'basic_istream' in function return type
  209 | basic_istream& operator>>(short& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:211:31: error: 'charT' was not declared in this scope; did you mean 'char'?
  211 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                               ^~~~~
      |                               char
p1514.cpp:211:58: error: 'charT' was not declared in this scope; did you mean 'char'?
  211 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                                                          ^~~~~
      |                                                          char
p1514.cpp:211:65: error: 'traits' was not declared in this scope
  211 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                                                                 ^~~~~~
p1514.cpp:211:65: error: template argument 1 is invalid
p1514.cpp:211:65: error: template argument 2 is invalid
p1514.cpp:211:71: error: template argument 1 is invalid
  211 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                                                                       ^~
p1514.cpp:211:71: error: template argument 2 is invalid
p1514.cpp:212:8: error: 'iostate' does not name a type; did you mean 'monostate'?
  212 |        iostate err = ios_base::goodbit;
      |        ^~~~~~~
      |        monostate
p1514.cpp:214:18: error: 'numget' was not declared in this scope; did you mean 'num_get'?
  214 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |                  ^~~~~~
      |                  num_get
p1514.cpp:214:8: error: specializing member '::use_facet<<expression error> >' requires 'template<>' syntax
  214 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |        ^~~~~~~~~~~~~~~~~
p1514.cpp:215:8: error: expected unqualified-id before 'if'
  215 |        if (lval < numeric_limits<short>::min()) {
      |        ^~
p1514.cpp:218:10: error: expected unqualified-id before 'else'
  218 |        } else if (numeric_limits<short>::max() < lval) {
      |          ^~~~
p1514.cpp:221:11: error: expected unqualified-id before 'else'
  221 |        }  else
      |           ^~~~
p1514.cpp:225:16: error: expected constructor, destructor, or type conversion before '(' token
  225 |        setstate(err);
      |                ^
p1514.cpp:226:1: error: deduced class type 'basic_istream' in function return type
  226 | basic_istream& operator>>(int& val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:227:31: error: 'charT' was not declared in this scope; did you mean 'char'?
  227 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                               ^~~~~
      |                               char
p1514.cpp:227:58: error: 'charT' was not declared in this scope; did you mean 'char'?
  227 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                                                          ^~~~~
      |                                                          char
p1514.cpp:227:65: error: 'traits' was not declared in this scope
  227 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                                                                 ^~~~~~
p1514.cpp:227:65: error: template argument 1 is invalid
p1514.cpp:227:65: error: template argument 2 is invalid
p1514.cpp:227:71: error: template argument 1 is invalid
  227 |        using numget = num_get<charT, istreambuf_iterator<charT, traits>>;
      |                                                                       ^~
p1514.cpp:227:71: error: template argument 2 is invalid
p1514.cpp:228:8: error: 'iostate' does not name a type; did you mean 'monostate'?
  228 |        iostate err = ios_base::goodbit;
      |        ^~~~~~~
      |        monostate
p1514.cpp:229:13: error: redefinition of 'long int std::lval'
  229 |        long lval;
      |             ^~~~
p1514.cpp:213:13: note: 'long int std::lval' previously declared here
  213 |        long lval;
      |             ^~~~
p1514.cpp:230:18: error: 'numget' was not declared in this scope; did you mean 'num_get'?
  230 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |                  ^~~~~~
      |                  num_get
p1514.cpp:230:8: error: specializing member '::use_facet<<expression error> >' requires 'template<>' syntax
  230 |        use_facet<numget>(loc).get(*this, 0, *this, err, lval);
      |        ^~~~~~~~~~~~~~~~~
p1514.cpp:231:8: error: expected unqualified-id before 'if'
  231 |        if (lval < numeric_limits<int>::min()) {
      |        ^~
p1514.cpp:234:10: error: expected unqualified-id before 'else'
  234 |        } else if (numeric_limits<int>::max() < lval) {
      |          ^~~~
p1514.cpp:237:11: error: expected unqualified-id before 'else'
  237 |        }  else
      |           ^~~~
p1514.cpp:239:16: error: expected constructor, destructor, or type conversion before '(' token
  239 |        setstate(err);
      |                ^
p1514.cpp:241:48: error: class template placeholder 'std::basic_istream' not permitted in this context
  241 | basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
      |                                                ^~~~~~~~~~~~~
p1514.cpp:241:48: note: use 'auto' for an abbreviated function template
p1514.cpp:241:27: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  241 | basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
      |                           ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:241:1: error: deduced class type 'basic_istream' in function return type
  241 | basic_istream& operator>>(basic_istream& (*pf)(basic_istream&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:242:37: error: 'charT' was not declared in this scope; did you mean 'char'?
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                     ^~~~~
      |                                     char
p1514.cpp:242:44: error: 'traits' was not declared in this scope
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                            ^~~~~~
p1514.cpp:242:50: error: template argument 1 is invalid
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                  ^
p1514.cpp:242:50: error: template argument 2 is invalid
p1514.cpp:242:69: error: 'charT' was not declared in this scope; did you mean 'char'?
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                                     ^~~~~
      |                                                                     char
p1514.cpp:242:76: error: 'traits' was not declared in this scope
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                                            ^~~~~~
p1514.cpp:242:82: error: template argument 1 is invalid
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                                                  ^
p1514.cpp:242:82: error: template argument 2 is invalid
p1514.cpp:242:1: error: deduced class type 'basic_istream' in function return type
  242 | basic_istream& operator>>(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:245:1: error: deduced class type 'basic_istream' in function return type
  245 | basic_istream& operator>>(ios_base& (*pf)(ios_base&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:270:43: error: 'charT' was not declared in this scope; did you mean 'char'?
  270 | basic_istream& operator>>(basic_streambuf<charT, traits>* sb);
      |                                           ^~~~~
      |                                           char
p1514.cpp:270:50: error: 'traits' was not declared in this scope
  270 | basic_istream& operator>>(basic_streambuf<charT, traits>* sb);
      |                                                  ^~~~~~
p1514.cpp:270:56: error: template argument 1 is invalid
  270 | basic_istream& operator>>(basic_streambuf<charT, traits>* sb);
      |                                                        ^
p1514.cpp:270:56: error: template argument 2 is invalid
p1514.cpp:270:1: error: deduced class type 'basic_istream' in function return type
  270 | basic_istream& operator>>(basic_streambuf<charT, traits>* sb);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:278:21: error: non-member function 'std::streamsize std::gcount()' cannot have cv-qualifier
  278 | streamsize gcount() const;
      |                     ^~~~~
p1514.cpp:281:1: error: 'int_type' does not name a type
  281 | int_type get();
      | ^~~~~~~~
p1514.cpp:286:1: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  286 | basic_istream& get(char_type* s, streamsize n, char_type delim);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:286:20: error: 'char_type' was not declared in this scope
  286 | basic_istream& get(char_type* s, streamsize n, char_type delim);
      |                    ^~~~~~~~~
p1514.cpp:286:31: error: 's' was not declared in this scope; did you mean 'ws'?
  286 | basic_istream& get(char_type* s, streamsize n, char_type delim);
      |                               ^
      |                               ws
p1514.cpp:286:45: error: expected primary-expression before 'n'
  286 | basic_istream& get(char_type* s, streamsize n, char_type delim);
      |                                             ^
p1514.cpp:286:48: error: 'char_type' was not declared in this scope
  286 | basic_istream& get(char_type* s, streamsize n, char_type delim);
      |                                                ^~~~~~~~~
p1514.cpp:291:1: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  291 | basic_istream& get(char_type* s, streamsize n);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:291:20: error: 'char_type' was not declared in this scope
  291 | basic_istream& get(char_type* s, streamsize n);
      |                    ^~~~~~~~~
p1514.cpp:291:31: error: 's' was not declared in this scope; did you mean 'ws'?
  291 | basic_istream& get(char_type* s, streamsize n);
      |                               ^
      |                               ws
p1514.cpp:291:45: error: expected primary-expression before 'n'
  291 | basic_istream& get(char_type* s, streamsize n);
      |                                             ^
p1514.cpp:293:36: error: 'char_type' was not declared in this scope
  293 | basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
      |                                    ^~~~~~~~~
p1514.cpp:293:47: error: 'traits' was not declared in this scope
  293 | basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
      |                                               ^~~~~~
p1514.cpp:293:53: error: template argument 1 is invalid
  293 | basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
      |                                                     ^
p1514.cpp:293:53: error: template argument 2 is invalid
p1514.cpp:293:60: error: 'char_type' has not been declared
  293 | basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
      |                                                            ^~~~~~~~~
p1514.cpp:293:1: error: deduced class type 'basic_istream' in function return type
  293 | basic_istream& get(basic_streambuf<char_type, traits>& sb, char_type delim);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:301:36: error: 'char_type' was not declared in this scope
  301 | basic_istream& get(basic_streambuf<char_type, traits>& sb);
      |                                    ^~~~~~~~~
p1514.cpp:301:47: error: 'traits' was not declared in this scope
  301 | basic_istream& get(basic_streambuf<char_type, traits>& sb);
      |                                               ^~~~~~
p1514.cpp:301:53: error: template argument 1 is invalid
  301 | basic_istream& get(basic_streambuf<char_type, traits>& sb);
      |                                                     ^
p1514.cpp:301:53: error: template argument 2 is invalid
p1514.cpp:301:1: error: deduced class type 'basic_istream' in function return type
  301 | basic_istream& get(basic_streambuf<char_type, traits>& sb);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:304:1: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  304 | basic_istream& getline(char_type* s, streamsize n, char_type delim);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:304:24: error: 'char_type' was not declared in this scope
  304 | basic_istream& getline(char_type* s, streamsize n, char_type delim);
      |                        ^~~~~~~~~
p1514.cpp:304:35: error: 's' was not declared in this scope; did you mean 'ws'?
  304 | basic_istream& getline(char_type* s, streamsize n, char_type delim);
      |                                   ^
      |                                   ws
p1514.cpp:304:49: error: expected primary-expression before 'n'
  304 | basic_istream& getline(char_type* s, streamsize n, char_type delim);
      |                                                 ^
p1514.cpp:304:52: error: 'char_type' was not declared in this scope
  304 | basic_istream& getline(char_type* s, streamsize n, char_type delim);
      |                                                    ^~~~~~~~~
p1514.cpp: In function 'int main()':
p1514.cpp:332:1: error: 'main2' was not declared in this scope; did you mean 'main'?
  332 | main2();
      | ^~~~~
      | main
p1514.cpp: At global scope:
p1514.cpp:334:1: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  334 | basic_istream& getline(char_type* s, streamsize n);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:334:24: error: 'char_type' was not declared in this scope
  334 | basic_istream& getline(char_type* s, streamsize n);
      |                        ^~~~~~~~~
p1514.cpp:334:35: error: 's' was not declared in this scope
  334 | basic_istream& getline(char_type* s, streamsize n);
      |                                   ^
p1514.cpp:334:49: error: expected primary-expression before 'n'
  334 | basic_istream& getline(char_type* s, streamsize n);
      |                                                 ^
p1514.cpp:339:47: error: 'int_type' has not been declared
  339 |       basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
      |                                               ^~~~~~~~
p1514.cpp:339:64: error: 'traits' has not been declared
  339 |       basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
      |                                                                ^~~~~~
p1514.cpp:339:7: error: deduced class type 'basic_istream' in function return type
  339 |       basic_istream& ignore(streamsize n = 1, int_type delim = traits::eof());
      |       ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:345:1: error: 'int_type' does not name a type
  345 | int_type peek();
      | ^~~~~~~~
p1514.cpp:351:21: error: 'char_type' was not declared in this scope
  351 | streamsize readsome(char_type* s, streamsize n);
      |                     ^~~~~~~~~
p1514.cpp:351:32: error: 's' was not declared in this scope
  351 | streamsize readsome(char_type* s, streamsize n);
      |                                ^
p1514.cpp:351:46: error: expected primary-expression before 'n'
  351 | streamsize readsome(char_type* s, streamsize n);
      |                                              ^
p1514.cpp:351:47: error: expression list treated as compound expression in initializer [-fpermissive]
  351 | streamsize readsome(char_type* s, streamsize n);
      |                                               ^
p1514.cpp:355:1: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  355 | basic_istream& putback(char_type c);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:355:24: error: 'char_type' was not declared in this scope
  355 | basic_istream& putback(char_type c);
      |                        ^~~~~~~~~
p1514.cpp:370:1: error: 'pos_type' does not name a type
  370 | pos_type tellg();
      | ^~~~~~~~
p1514.cpp:373:1: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  373 | basic_istream& seekg(pos_type pos);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:373:22: error: 'pos_type' was not declared in this scope
  373 | basic_istream& seekg(pos_type pos);
      |                      ^~~~~~~~
p1514.cpp:376:1: error: template placeholder type 'basic_istream<...auto...>' must be followed by a simple declarator-id
  376 | basic_istream& seekg(off_type off, ios_base::seekdir dir);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:83:11: note: 'template<class _CharT, class _Traits> class std::basic_istream' declared here
   83 |     class basic_istream;
      |           ^~~~~~~~~~~~~
p1514.cpp:376:22: error: 'off_type' was not declared in this scope; did you mean 'off_t'?
  376 | basic_istream& seekg(off_type off, ios_base::seekdir dir);
      |                      ^~~~~~~~
      |                      off_t
p1514.cpp:376:54: error: expected primary-expression before 'dir'
  376 | basic_istream& seekg(off_type off, ios_base::seekdir dir);
      |                                                      ^~~
p1514.cpp:386:8: error: 'is' does not name a type
  386 |        is >> std::forward<T>(x);
      |        ^~
p1514.cpp:387:8: error: expected unqualified-id before 'return'
  387 |        return std::move(is);
      |        ^~~~~~
p1514.cpp:391:27: error: redefinition of default argument for 'class traits'
  391 |     template<class charT, class traits = char_traits<charT>>
      |                           ^~~~~
/usr/local/include/c++/12.1.0/iosfwd:88:29: note: original definition appeared here
   88 |   template<typename _CharT, typename _Traits = char_traits<_CharT> >
      |                             ^~~~~~~~
p1514.cpp:413:44: error: 'charT' was not declared in this scope; did you mean 'char'?
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |                                            ^~~~~
      |                                            char
p1514.cpp:413:51: error: 'traits' was not declared in this scope
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |                                                   ^~~~~~
p1514.cpp:413:57: error: template argument 1 is invalid
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |                                                         ^
p1514.cpp:413:57: error: template argument 2 is invalid
p1514.cpp:413:13: error: deduction guide for 'std::basic_iostream<_CharT, _Traits>' must have trailing return type
  413 |    explicit basic_iostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:89:11: note: 'template<class _CharT, class _Traits> class std::basic_iostream' declared here
   89 |     class basic_iostream;
      |           ^~~~~~~~~~~~~~
p1514.cpp:417:24: error: expected class-name before '(' token
  417 | virtual ~basic_iostream();
      |                        ^
p1514.cpp:420:27: error: template placeholder type 'basic_iostream<...auto...>' must be followed by a simple declarator-id
  420 | basic_iostream& operator=(basic_iostream&& rhs);
      |                           ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:89:11: note: 'template<class _CharT, class _Traits> class std::basic_iostream' declared here
   89 |     class basic_iostream;
      |           ^~~~~~~~~~~~~~
p1514.cpp:420:1: error: deduced class type 'basic_iostream' in function return type
  420 | basic_iostream& operator=(basic_iostream&& rhs);
      | ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:89:11: note: 'template<class _CharT, class _Traits> class std::basic_iostream' declared here
   89 |     class basic_iostream;
      |           ^~~~~~~~~~~~~~
p1514.cpp:422:11: error: template placeholder type 'basic_iostream<...auto...>' must be followed by a simple declarator-id
  422 | void swap(basic_iostream& rhs);
      |           ^~~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:89:11: note: 'template<class _CharT, class _Traits> class std::basic_iostream' declared here
   89 |     class basic_iostream;
      |           ^~~~~~~~~~~~~~
p1514.cpp:427:1: error: 'stream' does not name a type
  427 | stream buffer, along with a function template that inserts into stream rvalues.
      | ^~~~~~
p1514.cpp:541:43: error: 'charT' was not declared in this scope; did you mean 'char'?
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |                                           ^~~~~
      |                                           char
p1514.cpp:541:50: error: 'traits' was not declared in this scope
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |                                                  ^~~~~~
p1514.cpp:541:56: error: template argument 1 is invalid
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |                                                        ^
p1514.cpp:541:56: error: template argument 2 is invalid
p1514.cpp:541:13: error: deduction guide for 'std::basic_ostream<_CharT, _Traits>' must have trailing return type
  541 |    explicit basic_ostream(basic_streambuf<charT, traits>* sb);
      |             ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:542:15: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  542 | basic_ostream(basic_ostream&& rhs);
      |               ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:542:1: error: deduction guide for 'std::basic_ostream<_CharT, _Traits>' must have trailing return type
  542 | basic_ostream(basic_ostream&& rhs);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:544:23: error: expected class-name before '(' token
  544 | virtual ~basic_ostream();
      |                       ^
p1514.cpp:547:26: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  547 | basic_ostream& operator=(basic_ostream&& rhs);
      |                          ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:547:1: error: deduced class type 'basic_ostream' in function return type
  547 | basic_ostream& operator=(basic_ostream&& rhs);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:549:11: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  549 | void swap(basic_ostream& rhs);
      |           ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:554:41: error: redefinition of 'class std::basic_ostream<_CharT, _Traits>::sentry'
  554 |     class basic_ostream<charT, traits>::sentry {
      |                                         ^~~~~~
/usr/local/include/c++/12.1.0/ostream:433:43: note: previous definition of 'class std::basic_ostream<_CharT, _Traits>::sentry'
  433 |     class basic_ostream<_CharT, _Traits>::sentry
      |                                           ^~~~~~
p1514.cpp:564:20: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  564 |    explicit sentry(basic_ostream& os);
      |                    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:564:13: error: ISO C++ forbids declaration of 'sentry' with no type [-fpermissive]
  564 |    explicit sentry(basic_ostream& os);
      |             ^~~~~~
p1514.cpp:564:4: error: 'explicit' outside class declaration
  564 |    explicit sentry(basic_ostream& os);
      |    ^~~~~~~~
p1514.cpp:565:8: error: expected class-name before '(' token
  565 | ~sentry();
      |        ^
p1514.cpp:570:4: error: 'pos_type' does not name a type
  570 |    pos_type tellp();
      |    ^~~~~~~~
p1514.cpp:571:1: error: 'explicit' outside class declaration
  571 | explicit operator bool() const;
      | ^~~~~~~~
p1514.cpp:571:26: error: non-member function 'operator bool()' cannot have cv-qualifier
  571 | explicit operator bool() const;
      |                          ^~~~~
p1514.cpp:571:10: error: 'operator bool()' must be a non-static member function
  571 | explicit operator bool() const;
      |          ^~~~~~~~
p1514.cpp:579:4: error: deduced class type 'basic_ostream' in function return type
  579 |    basic_ostream& operator<<(bool val);
      |    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:580:4: error: deduced class type 'basic_ostream' in function return type
  580 |    basic_ostream& operator<<(short val);
      |    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:583:1: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  583 | basic_ostream& seekp(pos_type pos);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:583:22: error: 'pos_type' was not declared in this scope
  583 | basic_ostream& seekp(pos_type pos);
      |                      ^~~~~~~~
p1514.cpp:586:1: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  586 | basic_ostream& seekp(off_type off, ios_base::seekdir dir);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:586:22: error: 'off_type' was not declared in this scope; did you mean 'off_t'?
  586 | basic_ostream& seekp(off_type off, ios_base::seekdir dir);
      |                      ^~~~~~~~
      |                      off_t
p1514.cpp:586:54: error: expected primary-expression before 'dir'
  586 | basic_ostream& seekp(off_type off, ios_base::seekdir dir);
      |                                                      ^~~
p1514.cpp:593:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:593:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:593:47: error: 'traits' was not declared in this scope
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:593:47: error: template argument 1 is invalid
p1514.cpp:593:47: error: template argument 2 is invalid
p1514.cpp:593:53: error: template argument 1 is invalid
  593 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:593:53: error: template argument 2 is invalid
p1514.cpp:594:9: error: 'getloc' was not declared in this scope; did you mean 'getwc'?
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |         ^~~~~~
      |         getwc
p1514.cpp:594:24: error: invalid use of 'this' at top level
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                        ^~~~
p1514.cpp:594:31: error: invalid use of 'this' at top level
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                               ^~~~
p1514.cpp:594:41: error: no matching function for call to 'fill()'
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                     ~~~~^~
In file included from /usr/local/include/c++/12.1.0/string:50,
                 from /usr/local/include/c++/12.1.0/bits/locale_classes.h:40,
                 from /usr/local/include/c++/12.1.0/bits/ios_base.h:41,
                 from /usr/local/include/c++/12.1.0/ios:42:
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)'
  991 |     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
      |     ^~~~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note:   template argument deduction/substitution failed:
p1514.cpp:594:41: note:   candidate expects 3 arguments, 0 provided
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                     ~~~~^~
p1514.cpp:594:45: error: 'val' was not declared in this scope
  594 |       >(getloc()).put(*this, *this, fill(), val).failed();
      |                                             ^~~
p1514.cpp:596:49: error: cannot call member function 'std::ios_base::fmtflags std::ios_base::flags() const' without object
  596 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                                  ~~~~~~~~~~~~~~~^~
p1514.cpp:597:8: error: redefinition of 'bool failed'
  597 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:598:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:598:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:598:47: error: 'traits' was not declared in this scope
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:598:47: error: template argument 1 is invalid
p1514.cpp:598:47: error: template argument 2 is invalid
p1514.cpp:598:53: error: template argument 1 is invalid
  598 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:598:53: error: template argument 2 is invalid
p1514.cpp:599:9: error: 'getloc' was not declared in this scope; did you mean 'getwc'?
  599 |       >(getloc()).put(*this, *this, fill(),
      |         ^~~~~~
      |         getwc
p1514.cpp:599:24: error: invalid use of 'this' at top level
  599 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:599:31: error: invalid use of 'this' at top level
  599 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:599:41: error: no matching function for call to 'fill()'
  599 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)'
  991 |     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
      |     ^~~~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note:   template argument deduction/substitution failed:
p1514.cpp:599:41: note:   candidate expects 3 arguments, 0 provided
  599 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
p1514.cpp:601:57: error: 'val' was not declared in this scope
  601 |         ? static_cast<long>(static_cast<unsigned short>(val))
      |                                                         ^~~
p1514.cpp:602:29: error: 'val' was not declared in this scope
  602 |         : static_cast<long>(val)).failed();
      |                             ^~~
p1514.cpp:604:22: error: redefinition of 'std::ios_base::fmtflags baseflags'
  604 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                      ^~~~~~~~~
p1514.cpp:596:22: note: 'std::ios_base::fmtflags baseflags' previously defined here
  596 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                      ^~~~~~~~~
p1514.cpp:604:49: error: cannot call member function 'std::ios_base::fmtflags std::ios_base::flags() const' without object
  604 |   ios_base::fmtflags baseflags = ios_base::flags() & ios_base::basefield;
      |                                  ~~~~~~~~~~~~~~~^~
p1514.cpp:605:8: error: redefinition of 'bool failed'
  605 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:606:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:606:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:606:47: error: 'traits' was not declared in this scope
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:606:47: error: template argument 1 is invalid
p1514.cpp:606:47: error: template argument 2 is invalid
p1514.cpp:606:53: error: template argument 1 is invalid
  606 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:606:53: error: template argument 2 is invalid
p1514.cpp:607:9: error: 'getloc' was not declared in this scope; did you mean 'getwc'?
  607 |       >(getloc()).put(*this, *this, fill(),
      |         ^~~~~~
      |         getwc
p1514.cpp:607:24: error: invalid use of 'this' at top level
  607 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:607:31: error: invalid use of 'this' at top level
  607 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:607:41: error: no matching function for call to 'fill()'
  607 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)'
  991 |     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
      |     ^~~~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note:   template argument deduction/substitution failed:
p1514.cpp:607:41: note:   candidate expects 3 arguments, 0 provided
  607 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
p1514.cpp:609:55: error: 'val' was not declared in this scope
  609 |         ? static_cast<long>(static_cast<unsigned int>(val))
      |                                                       ^~~
p1514.cpp:610:29: error: 'val' was not declared in this scope
  610 |         : static_cast<long>(val)).failed();
      |                             ^~~
p1514.cpp:612:8: error: redefinition of 'bool failed'
  612 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:613:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:613:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:613:47: error: 'traits' was not declared in this scope
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:613:47: error: template argument 1 is invalid
p1514.cpp:613:47: error: template argument 2 is invalid
p1514.cpp:613:53: error: template argument 1 is invalid
  613 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:613:53: error: template argument 2 is invalid
p1514.cpp:614:9: error: 'getloc' was not declared in this scope; did you mean 'getwc'?
  614 |       >(getloc()).put(*this, *this, fill(),
      |         ^~~~~~
      |         getwc
p1514.cpp:614:24: error: invalid use of 'this' at top level
  614 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:614:31: error: invalid use of 'this' at top level
  614 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:614:41: error: no matching function for call to 'fill()'
  614 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)'
  991 |     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
      |     ^~~~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note:   template argument deduction/substitution failed:
p1514.cpp:614:41: note:   candidate expects 3 arguments, 0 provided
  614 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
p1514.cpp:615:36: error: 'val' was not declared in this scope
  615 |         static_cast<unsigned long>(val)).failed();
      |                                    ^~~
p1514.cpp:617:8: error: redefinition of 'bool failed'
  617 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:592:8: note: 'bool failed' previously defined here
  592 |   bool failed = use_facet<
      |        ^~~~~~
p1514.cpp:618:13: error: 'charT' was not declared in this scope; did you mean 'char'?
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |             ^~~~~
      |             char
p1514.cpp:618:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                        ^~~~~
      |                                        char
p1514.cpp:618:47: error: 'traits' was not declared in this scope
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                               ^~~~~~
p1514.cpp:618:47: error: template argument 1 is invalid
p1514.cpp:618:47: error: template argument 2 is invalid
p1514.cpp:618:53: error: template argument 1 is invalid
  618 |     num_put<charT, ostreambuf_iterator<charT, traits>>
      |                                                     ^~
p1514.cpp:618:53: error: template argument 2 is invalid
p1514.cpp:619:9: error: 'getloc' was not declared in this scope; did you mean 'getwc'?
  619 |       >(getloc()).put(*this, *this, fill(),
      |         ^~~~~~
      |         getwc
p1514.cpp:619:24: error: invalid use of 'this' at top level
  619 |       >(getloc()).put(*this, *this, fill(),
      |                        ^~~~
p1514.cpp:619:31: error: invalid use of 'this' at top level
  619 |       >(getloc()).put(*this, *this, fill(),
      |                               ^~~~
p1514.cpp:619:41: error: no matching function for call to 'fill()'
  619 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note: candidate: 'template<class _ForwardIterator, class _Tp> constexpr void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)'
  991 |     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
      |     ^~~~
/usr/local/include/c++/12.1.0/bits/stl_algobase.h:991:5: note:   template argument deduction/substitution failed:
p1514.cpp:619:41: note:   candidate expects 3 arguments, 0 provided
  619 |       >(getloc()).put(*this, *this, fill(),
      |                                     ~~~~^~
p1514.cpp:620:29: error: 'val' was not declared in this scope
  620 |         static_cast<double>(val)).failed();
      |                             ^~~
p1514.cpp:623:1: error: deduced class type 'basic_ostream' in function return type
  623 | basic_ostream& operator<<(unsigned short val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:624:1: error: deduced class type 'basic_ostream' in function return type
  624 | basic_ostream& operator<<(int val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:625:1: error: deduced class type 'basic_ostream' in function return type
  625 | basic_ostream& operator<<(unsigned int val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:626:1: error: deduced class type 'basic_ostream' in function return type
  626 | basic_ostream& operator<<(long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:627:1: error: deduced class type 'basic_ostream' in function return type
  627 | basic_ostream& operator<<(unsigned long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:628:1: error: deduced class type 'basic_ostream' in function return type
  628 | basic_ostream& operator<<(long long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:629:1: error: deduced class type 'basic_ostream' in function return type
  629 | basic_ostream& operator<<(unsigned long long val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:630:1: error: deduced class type 'basic_ostream' in function return type
  630 | basic_ostream& operator<<(float val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:631:1: error: deduced class type 'basic_ostream' in function return type
  631 | basic_ostream& operator<<(double val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:632:1: error: deduced class type 'basic_ostream' in function return type
  632 | basic_ostream& operator<<(long double val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:633:1: error: deduced class type 'basic_ostream' in function return type
  633 | basic_ostream& operator<<(const void* val);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:635:6: error: deduced class type 'basic_ostream' in function return type
  635 |      basic_ostream& operator<<(const volatile void* p);
      |      ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:638:48: error: class template placeholder 'std::basic_ostream' not permitted in this context
  638 | basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
      |                                                ^~~~~~~~~~~~~
p1514.cpp:638:48: note: use 'auto' for an abbreviated function template
p1514.cpp:638:27: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  638 | basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
      |                           ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:638:1: error: deduced class type 'basic_ostream' in function return type
  638 | basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:640:37: error: 'charT' was not declared in this scope; did you mean 'char'?
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                     ^~~~~
      |                                     char
p1514.cpp:640:44: error: 'traits' was not declared in this scope
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                            ^~~~~~
p1514.cpp:640:50: error: template argument 1 is invalid
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                  ^
p1514.cpp:640:50: error: template argument 2 is invalid
p1514.cpp:640:69: error: 'charT' was not declared in this scope; did you mean 'char'?
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                                     ^~~~~
      |                                                                     char
p1514.cpp:640:76: error: 'traits' was not declared in this scope
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                                            ^~~~~~
p1514.cpp:640:82: error: template argument 1 is invalid
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      |                                                                                  ^
p1514.cpp:640:82: error: template argument 2 is invalid
p1514.cpp:640:1: error: deduced class type 'basic_ostream' in function return type
  640 | basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:643:1: error: deduced class type 'basic_ostream' in function return type
  643 | basic_ostream& operator<<(ios_base& (*pf)(ios_base&));
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:646:43: error: 'charT' was not declared in this scope; did you mean 'char'?
  646 | basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
      |                                           ^~~~~
      |                                           char
p1514.cpp:646:50: error: 'traits' was not declared in this scope
  646 | basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
      |                                                  ^~~~~~
p1514.cpp:646:56: error: template argument 1 is invalid
  646 | basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
      |                                                        ^
p1514.cpp:646:56: error: template argument 2 is invalid
p1514.cpp:646:1: error: deduced class type 'basic_ostream' in function return type
  646 | basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:653:1: error: deduced class type 'basic_ostream' in function return type
  653 | basic_ostream& operator<<(nullptr_t);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:655:1: error: 'where' does not name a type
  655 | where s is an implementation-defined NTCTS (3.37).
      | ^~~~~
p1514.cpp:672:1: error: 'out' does not name a type
  672 | out.widen(c);
      | ^~~
p1514.cpp:688:6: error: template placeholder type 'basic_ostream<...auto...>' must be followed by a simple declarator-id
  688 |      basic_ostream& put(char_type c);
      |      ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:688:25: error: 'char_type' was not declared in this scope
  688 |      basic_ostream& put(char_type c);
      |                         ^~~~~~~~~
p1514.cpp:694:28: error: 'char_type' does not name a type
  694 | basic_ostream& write(const char_type* s, streamsize n);
      |                            ^~~~~~~~~
p1514.cpp:694:1: error: deduced class type 'basic_ostream' in function return type
  694 | basic_ostream& write(const char_type* s, streamsize n);
      | ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:701:4: error: deduced class type 'basic_ostream' in function return type
  701 |    basic_ostream& flush();
      |    ^~~~~~~~~~~~~
/usr/local/include/c++/12.1.0/iosfwd:86:11: note: 'template<class _CharT, class _Traits> class std::basic_ostream' declared here
   86 |     class basic_ostream;
      |           ^~~~~~~~~~~~~
p1514.cpp:717:1: error: expected unqualified-id before '[' token
  717 | [// Note 1: To work around the issue that the Allocator template argument cannot be deduced, implementations can introduce an intermediate base class to basic_syncbuf that manages its emit_on_sync flag. —end note]
      | ^
p1514.cpp:722:8: error: found ':' in nested-name-specifier, expected '::'
  722 | Returns: os.
      |        ^
      |        ::
p1514.cpp:722:1: error: 'Returns' does not name a type
  722 | Returns: os.
      | ^~~~~~~
p1514.cpp:739:8: error: redefinition of 'void f(std::ios_base&, std::ios_base::fmtflags)'
  739 |   void f(ios_base& str, ios_base::fmtflags mask) {
      |        ^
p1514.cpp:733:8: note: 'void f(std::ios_base&, std::ios_base::fmtflags)' previously defined here
  733 |   void f(ios_base& str, ios_base::fmtflags mask) {
      |        ^
p1514.cpp:757:1: error: 'unspecified' does not name a type
  757 | unspecified resetiosflags(ios_base::fmtflags mask);
      | ^~~~~~~~~~~
p1514.cpp:758:1: error: 'unspecified' does not name a type
  758 | unspecified setiosflags(ios_base::fmtflags mask);
      | ^~~~~~~~~~~
p1514.cpp:759:1: error: 'unspecified' does not name a type
  759 | unspecified setbase(int base);
      | ^~~~~~~~~~~
p1514.cpp:760:1: error: 'unspecified' does not name a type
  760 | unspecified setfill(char_type c);
      | ^~~~~~~~~~~
p1514.cpp:763:8: error: redefinition of 'void f(std::ios_base&, int)'
  763 |   void f(ios_base& str, int n) {
      |        ^
p1514.cpp:745:6: note: 'void f(std::ios_base&, int)' previously defined here
  745 | void f(ios_base& str, int base) {
      |      ^
p1514.cpp:775:8: error: redefinition of 'void f(std::ios_base&, int)'
  775 |   void f(ios_base& str, int n) {
      |        ^
p1514.cpp:745:6: note: 'void f(std::ios_base&, int)' previously defined here
  745 | void f(ios_base& str, int base) {
      |      ^
p1514.cpp:780:1: error: 'unspecified' does not name a type
  780 | unspecified setw(int n);
      | ^~~~~~~~~~~
p1514.cpp:783:24: error: 'unspecified' does not name a type
  783 | template<class moneyT> unspecified get_money(moneyT& mon, bool intl = false);
      |                        ^~~~~~~~~~~
p1514.cpp:797:23: error: 'unspecified' does not name a type
  797 | template<class charT> unspecified put_time(const tm* tmb, const charT* fmt);
      |                       ^~~~~~~~~~~
p1514.cpp:799:24: error: 'unspecified' does not name a type
  799 | template<class moneyT> unspecified put_money(const moneyT& mon, bool intl = false);
      |                        ^~~~~~~~~~~
p1514.cpp:801:23: error: 'unspecified' does not name a type
  801 | template<class charT> unspecified get_time(tm* tmb, const charT* fmt);
      |                       ^~~~~~~~~~~
p1514.cpp: In function 'void f(std::basic_ios<_CharT, _Traits>&, const tm*, const charT*)':
p1514.cpp:834:1: error: 'unspecified' was not declared in this scope
  834 | unspecified quoted(basic_string_view<charT, traits> s,
      | ^~~~~~~~~~~
p1514.cpp:839:1: error: 'traits_type' has not been declared
  839 | traits_type::eq, first output escape.
      | ^~~~~~~~~~~
p1514.cpp:839:18: error: 'first' was not declared in this scope
  839 | traits_type::eq, first output escape.
      |                  ^~~~~
p1514.cpp:844:21: error: overloaded function with no contextual type information
  844 |             if (end.failed())
      |                     ^~~~~~
p1514.cpp: At global scope:
p1514.cpp:851:1: error: 'unspecified' does not name a type
  851 | unspecified quoted(const charT* s, charT delim = charT(), charT escape = charT());
      | ^~~~~~~~~~~
p1514.cpp:853:1: error: 'unspecified' does not name a type
  853 | unspecified quoted(const basic_string<charT, traits, Allocator>& s,
      | ^~~~~~~~~~~
p1514.cpp:856:10: error: declaration of template parameter 'charT' shadows template parameter
  856 | template<class charT, class traits, class Allocator>
      |          ^~~~~
p1514.cpp:855:13: note: template parameter 'charT' declared here
  855 |    template<class charT, class traits>
      |             ^~~~~
p1514.cpp:856:23: error: declaration of template parameter 'traits' shadows template parameter
  856 | template<class charT, class traits, class Allocator>
      |                       ^~~~~
p1514.cpp:855:26: note: template parameter 'traits' declared here
  855 |    template<class charT, class traits>
      |                          ^~~~~
p1514.cpp:857:1: error: 'unspecified' does not name a type
  857 | unspecified quoted(basic_string<charT, traits, Allocator>& s,   charT delim = charT(),
      | ^~~~~~~~~~~
p1514.cpp: In function 'int main2()':
p1514.cpp:870:11: error: ambiguous overload for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char*')
  870 |     cout  <<  n4910 << endl;
      |     ~~~~  ^~  ~~~~~
      |     |         |
      |     |         const char*
      |     std::ostream {aka std::basic_ostream<char>}
/usr/local/include/c++/12.1.0/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  174 |       operator<<(bool __n)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:245:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  245 |       operator<<(const void* __p)
      |       ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:257:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const volatile void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
  257 |       operator<<(const volatile void* __p)
      |       ^~~~~~~~
p1514.cpp:676:33: note: candidate: 'std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, const charT*) [with charT = char; traits = std::char_traits<char>]'
  676 |   basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const charT* s);
      |                                 ^~~~~~~~
p1514.cpp:678:33: note: candidate: 'std::basic_ostream<_CharT, _Traits>& operator<<(std::basic_ostream<_CharT, _Traits>&, const char*) [with charT = char; traits = std::char_traits<char>]'
  678 |   basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const char* s);
      |                                 ^~~~~~~~
p1514.cpp:680:32: note: candidate: 'std::basic_ostream<char, _Traits>& operator<<(std::basic_ostream<char, _Traits>&, const char*) [with traits = std::char_traits<char>]'
  680 |   basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const char* s);
      |                                ^~~~~~~~
p1514.cpp:729:13: note: candidate: 'Ostream&& operator<<(Ostream&&, const T&) [with Ostream = std::basic_ostream<char>&; T = const char*]'
  729 |   Ostream&& operator<<(Ostream&& os, const T& x);
      |             ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:598:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*) [with _CharT = char; _Traits = char_traits<char>]'
  598 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
      |     ^~~~~~~~
In file included from /usr/local/include/c++/12.1.0/ostream:833:
/usr/local/include/c++/12.1.0/bits/ostream.tcc:302:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*) [with _CharT = char; _Traits = char_traits<char>]'
  302 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
      |     ^~~~~~~~
/usr/local/include/c++/12.1.0/ostream:615:5: note: candidate: 'std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*) [with _Traits = char_traits<char>]'
  615 |     operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
      |     ^~~~~~~~```

# 検討事項(agenda)
コンパイルエラーを取るか、コンパイルエラーの理由を解説する。

<!-- リンクエラーの解説をする。clang++とg++の比較。意味のある出力。
コンパイルエラーを取るか、コンパイルエラーの理由を解説する。-->

## 応用例1 AUTOSAR C++

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

Autosar Guidelines C++14 example code compile list

https://qiita.com/kaizen_nagoya/items/8ccbf6675c3494d57a76

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

https://qiita.com/kaizen_nagoya/items/3436fbd49865e0da7d35

## 応用例2 MISRA C/C++

MISRA C まとめ #include <misra_c.h>

https://qiita.com/kaizen_nagoya/items/f1a79a7cbd281607c7c9

MISRA C++ 5-0-16

https://qiita.com/kaizen_nagoya/items/7df2d4e05db724752a74

## 応用例3 CERT C/C++

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

https://qiita.com/kaizen_nagoya/items/fe06719aef10f3f985ae

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

https://qiita.com/kaizen_nagoya/items/8dff19511e42b2593db1

## 応用例4 箱庭 

箱庭もくもく会 #10 日時:2022/09/14(水) 17:30-19:30

https://hakoniwa.connpass.com/event/258129/

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

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

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

仮想戦略会議「箱庭」

https://qiita.com/kaizen_nagoya/items/73cb132707653176a461

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

https://qiita.com/kaizen_nagoya/items/a22bf2b1dab0ad3258d4

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

https://qiita.com/kaizen_nagoya/items/e3c0ceb2dcc9cf3f3fac


# エンジニア夏休み企画

https://qiita.com/official-events/6d31965c499a69377c0b

個人開発と読書感想文に焦点を当てたのは良い企画だと思った。

## 個人開発

【個人開発】 効率的な背景 <エンジニア夏休み企画>

https://qiita.com/kaizen_nagoya/items/3ebab436e63731e4b885

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

## 読書感想文

CコンパイラによるC言語規格の読書感想文として掲載しています。
コンパイル実験が、C++N4910に対する、G++とClang++による感想文だということご理解いただけると幸いです。

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

https://qiita.com/tags/読書感想文

## 自己参考資料(self reference)

関連する自己参照以外は、こちらの先頭に移転。

C言語(C++)に対する誤解、曲解、無理解、爽快。

https://qiita.com/kaizen_nagoya/items/3f3992c9722c1cee2e3a

#include "N4910.h"

https://qiita.com/kaizen_nagoya/items/163a47cef7d6bb1c33a8

C++N4910資料の改善点

https://qiita.com/kaizen_nagoya/items/fb4ceb5d117a54641af3

dockerにclang

https://qiita.com/kaizen_nagoya/items/8829ffeee397eda50e80

docker gnu(gcc/g++) and llvm(clang/clang++)

https://qiita.com/kaizen_nagoya/items/059874ea39c4de64c0f7

コンパイル用shell script C版(clangとgcc)とC++版(clang++とg++)

https://qiita.com/kaizen_nagoya/items/74220c0577a512c2d7da

C++N4910:2022 tag follower 300人超えました。ありがとうございます。

https://qiita.com/kaizen_nagoya/items/a63fb96d351ac5c16ff7

astyle 使ってみた

https://qiita.com/kaizen_nagoya/items/3c9a87a781d53a1a23f3

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

# 文書履歴(document history)
ver. 0.01 初稿  20220825

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