31.9 Span-based streams [span.streams] C++N4910:2022 (692) p1553.cpp

 エンジニア夏休み企画
https://qiita.com/official-events/6d31965c499a69377c0b

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

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

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

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

## 個人開発
【個人開発】　効率的な背景　＜エンジニア夏休み企画＞
https://qiita.com/kaizen_nagoya/items/3ebab436e63731e4b885

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

### 箱庭
箱庭もくもく会 #10 日時：2022/09/14(水) 17:30-19:30
https://hakoniwa.connpass.com/event/258129/

# はじめに(Introduction)
N4910  Working Draft, Standard for Programming Language C++
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4910.pdf

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++でコンパイルエラーが出ると、途方にくれることがしばしばあります。
何回かに１回は、該当するエラーが検索できます。
ただ、条件が違っていて、そこでの修正方法では目的を達成しないこともしばしばです。いろいろな条件のコンパイルエラーとその対応方法について、広く記録することによって、いつか同じエラーに遭遇した時にやくに立つことを目指しています。

この半年の間で、三度、自分のネットでの記録に助けられたことがあります。
また過去に解決できなかった記録を１０種類以上、最近になって解決できたことがあります。それは、主に次の３つの情報に基づいています。

https://stackoverflow.com

http://ja.cppreference.com/

cpprefjp - C++日本語リファレンス

https://cpprefjp.github.io/

コンパイラの実装状況

https://cpprefjp.github.io/implementation-status.html

また
https://researchmap.jp/joub9b3my-1797580/#_1797580
に記載したサイトのお世話になっています。

## 作業方針(sequence)
Clang++では-std=c++03, C++2bの2種類
g++では-std=c++03, c++2bの２種類
でコンパイルし、

１）コンパイルエラーを収集する。
２）コンパイルエラーをなくす方法を検討する。
コンパイルエラーになる例を示すだけが目的のコードは、コンパイルエラーをなくすのではなく、コンパイルエラーの種類を収集するだけにする。
文法を示すのが目的のコード場合に、コンパイルエラーをなくすのに手間がかかる場合は、順次作業します。
３）リンクエラーをなくす方法を検討する。
文法を示すのが目的のコード場合に、リンクエラーをなくすのに手間がかかる場合は、順次作業します。
４）意味のある出力を作る。
コンパイル、リンクが通っても、意味のある出力を示そうとすると、コンパイル・リンクエラーが出て収拾できそうにない場合がある。順次作業します。

１）だけのものから４）まで進んだものと色々ある状態です。一歩でも前に進むご助言をお待ちしています。「検討事項」の欄に現状を記録するようにしています。

### C++N4910:2022 Standard Working Draft on ISO/IEC 14882(0) sample code compile list  

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

### C++N4741, 2018 Standard Working Draft on ISO/IEC 14882 sample code compile list
https://qiita.com/kaizen_nagoya/items/3294c014044550896010

### 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++
https://qiita.com/kaizen_nagoya/items/685b5c1a2c17c1bf1318

## 編纂器(Compiler)
### clang++ --version
#####  20220826 以前
> Debian clang version 14.0.5-++20220610033153+c12386ae247c-1~exp1~20220610153237.151
Target: x86_64-pc-linux-gnu, Thread model: posix, InstalledDir: /usr/bin

##### 20220827 以降
> Debian clang version 14.0.6-++20220622053050+f28c006a5895-1~exp1~20220622173135.152
Target: x86_64-pc-linux-gnu　Thread model: posix InstalledDir: /usr/bin

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

# 31.9 Span-based streams [span.streams] C++N4910:2022 (692) p1553.cpp

## 算譜(source code)

```c++:p1553.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 = "31.9 Span-based streams [span.streams] C++N4910:2022 (692) p1553.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.9.1 Overview [span.streams.overview]
//  The header <spanstream> defines class templates and types that associate stream buffers with objects whose
types are specializations of span as described in 24.7.3.
// [Note 1: A user of these classes is responsible for ensuring that the character sequence represented by the given span outlives the use of the sequence by objects of the classes in subclause 31.9. Using multiple basic_spanbuf objects referring to overlapping underlying sequences from different threads, where at least one basic_spanbuf object is used for writing to the sequence, results in a data race. —end note]
// 31.9.2 Header <spanstream> synopsis [spanstream.syn]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_spanbuf;
using spanbuf = basic_spanbuf<char>;
using wspanbuf = basic_spanbuf<wchar_t>;
template<class charT, class traits = char_traits<charT>>
class basic_ispanstream;
using ispanstream = basic_ispanstream<char>;
using wispanstream = basic_ispanstream<wchar_t>;
template<class charT, class traits = char_traits<charT>>
class basic_ospanstream;
using ospanstream = basic_ospanstream<char>;
using wospanstream = basic_ospanstream<wchar_t>;
template<class charT, class traits = char_traits<charT>>
class basic_spanstream;
using spanstream = basic_spanstream<char>;
using wspanstream = basic_spanstream<wchar_t>;
}
// — ios_base::openmode mode , has in set if the input sequence can be read, and out set if the output sequence can be written.
// 31.9.3 Class template spanbuf [spanbuf]
// 31.9.3.1 General  [spanbuf.general]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_spanbuf
    : public basic_streambuf<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.9.3.2, constructors
    basic_spanbuf() : basic_spanbuf(ios_base::in | ios_base::out) {} explicit basic_spanbuf(ios_base::openmode which)
        : basic_spanbuf(std::span<charT>(), which) {}
    explicit basic_spanbuf(std::span<charT> s,
                           ios_base::openmode which = ios_base::in | ios_base::out);
    basic_spanbuf(const basic_spanbuf&) = delete;
    basic_spanbuf(basic_spanbuf&& rhs);
// 31.9.3.3, assignment and swap
    basic_spanbuf& operator=(const basic_spanbuf&) = delete;
    basic_spanbuf& operator=(basic_spanbuf&& rhs);
    void swap(basic_spanbuf& rhs);
// 31.9.3.4, member functions std::span<charT> span() const noexcept; void span(std::span<charT> s) noexcept;
protected:
// 31.9.3.5, overridden virtual functions
    basic_streambuf<charT, traits>* setbuf(charT*, streamsize) override;
    pos_type seekoff(off_type off, ios_base::seekdir way,
                     ios_base::openmode which = ios_base::in | ios_base::out) override;
    pos_type seekpos(pos_type sp,
                     ios_base::openmode which = ios_base::in | ios_base::out) override;
private:
    ios_base::openmode mode ; // exposition only std::span<charT> buf ; // exposition only
};
template<class charT, class traits>
void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
}
//  The class template basic_spanbuf is derived from basic_streambuf to associate possibly the input sequence and possibly the output sequence with a sequence of arbitrary characters. The sequence is provided by an object of class span<charT>.
//  For the sake of exposition, the maintained data is presented here as:
// — std::span<charT> buf is the view to the underlying character sequence.
// 31.9.3.2 Constructors [spanbuf.ctor]
explicit basic_spanbuf(std::span<charT> s,
                       ios_base::openmode which = ios_base::in | ios_base::out);
// Effects: Initializes the base class with basic_streambuf() (31.6.3.2), and mode with which. Initializes the internal pointers as if calling span(s).
basic_spanbuf(basic_spanbuf&& rhs);
// Effects: Initializes the base class with std::move(rhs) and mode with std::move(rhs.mode ) and buf with std::move(rhs.buf). The sequence pointers in *this (eback(), gptr(), egptr(), pbase(), pptr(), epptr()) obtain the values which rhs had. It is implementation-defined whether rhs.buf . empty() returns true after the move.
// Postconditions: Let rhs_p refer to the state of rhs just prior to this construction. — span().data() == rhs_p.span().data()
// — span().size() == rhs_p.span().size()
// — eback() == rhs_p.eback()
// — gptr() == rhs_p.gptr()
// — egptr() == rhs_p.egptr() — pbase() == rhs_p.pbase() — pptr() == rhs_p.pptr()
// — epptr() == rhs_p.epptr() — getloc() == rhs_p.getloc()
// 31.9.3.3 Assignment and swap [spanbuf.assign]
basic_spanbuf& operator=(basic_spanbuf&& rhs);
// Effects: Equivalent to:
basic_spanbuf tmp{std::move(rhs)};
this->swap(tmp);
return *this;
void swap(basic_spanbuf& rhs);
// Effects: Equivalent to:
basic_streambuf<charT, traits>::swap(rhs);
std::swap(mode, rhs.mode);
std::swap(buf, rhs.buf);
template<class charT, class traits>
void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
// Effects: Equivalent to x.swap(y).
// 31.9.3.4 Member functions [spanbuf.members]
std::span<charT> span() const noexcept;
// Returns: If ios_base::out is set in mode , returns std::span<charT>(pbase(), pptr()), otherwise returns buf .
// [Note 1: In contrast to basic_stringbuf, the underlying sequence never grows and is not owned. An owning copy can be obtained by converting the result to basic_string<charT>. —end note]
void span(std::span<charT> s) noexcept;
// Effects: buf = s. Initializes the input and output sequences according to mode . Postconditions:—
// — If ios_base::out is set in mode ,
pbase() == s.data() && epptr() == pbase() + s.size() is true;
// — in addition, if ios_base::ate is set in mode , pptr() == pbase() + s.size() is true,
// — otherwise pptr() == pbase() is true.
// If ios_base::in is set in mode , eback() == s.data() && gptr() == eback() && egptr() == eback() + s.size() is true.
// Effects: Alters the stream position within one or both of the controlled sequences, if possible, as follows:
// — If ios_base::in is set in which, positions the input sequence; xnext is gptr(), xbeg is eback().
// — If ios_base::out is set in which, positions the output sequence; xnext is pptr(), xbeg is pbase().
// If both ios_base::in and ios_base::out are set in which and way is ios_base::cur, the positioning operation fails.
// For a sequence to be positioned, if its next pointer xnext (either gptr() or pptr()) is a null pointer and the new offset newoff as computed below is nonzero, the positioning operation fails. Otherwise, the function determines baseoff as a value of type off_type as follows:
// — 0 when way is ios_base::beg;
// — (pptr() - pbase()) for the output sequence, or (gptr() - eback()) for the input sequence when way is ios_base::cur; — when way is ios_base::end :
// — (pptr() - pbase()) if ios_base::out is set in mode and ios_base::in is not set in mode ,
// — buf.size() otherwise.
// If baseoff + off would overflow, or if baseoff + off is less than zero, or if baseoff + off is greater than buf .size(), the positioning operation fails. Otherwise, the function computes
off_type newoff = baseoff + off;
// and assigns xbeg + newoff to the next pointer xnext.
// Returns: pos_type(off_type(-1)) if the positioning operation fails; pos_type(newoff) otherwise.
// 31.9.3.5 Overridden virtual functions [spanbuf.virtuals]
//  [Note 1: Because the underlying buffer is of fixed size, neither overflow, underflow, nor pbackfail can provide useful behavior. —end note]
pos_type seekoff(off_type off, ios_base::seekdir way,
                 ios_base::openmode which = ios_base::in | ios_base::out) override;
pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override;
// Effects: Equivalent to:
return seekoff(off_type(sp), ios_base::beg, which);
basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
// Effects: Equivalent to:
this->span(std::span<charT>(s, n));
return this;
// 31.9.4 Class template basic_ispanstream [ispanstream]
// 31.9.4.1 General [ispanstream.general]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_ispanstream
    : public basic_istream<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.9.4.2, constructors
    explicit basic_ispanstream(std::span<charT> s,
                               ios_base::openmode which = ios_base::in);
    basic_ispanstream(const basic_ispanstream&) = delete;
    basic_ispanstream(basic_ispanstream&& rhs);
    template<class ROS> explicit basic_ispanstream(ROS&& s);
Effects:
    Initializes the base class with basic_istream<charT, traits>(addressof(sb)) and sb with basic_spanbuf<charT, traits>(s, which | ios_base::in)
        basic_ispanstream& operator=(const basic_ispanstream&) = delete;
    basic_ispanstream& operator=(basic_ispanstream&& rhs);
// 31.9.4.3, swap
    void swap(basic_ispanstream& rhs);
// 31.9.4.4, member functions
    basic_spanbuf<charT, traits>* rdbuf() const noexcept;
    std::span<const charT> span() const noexcept;
    void span(std::span<charT> s) noexcept;
    template<class ROS> void span(ROS&& s) noexcept;
private:
    basic_spanbuf<charT, traits> sb; // exposition only
};
template<class charT, class traits>
void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
}
//  [Note 1: Constructing an ispanstream from a string-literal includes the termination character ’\0’ in the underlying
spanbuf.
// 31.9.4.2 Constructors [ispanstream.ctor]
explicit basic_ispanstream(std::span<charT> s, ios_base::openmode which = ios_base::in);
basic_ispanstream(basic_ispanstream&& rhs);
// Effects: Initializes the base class with std::move(rhs) and sb with std::move(rhs.sb). Next, basic_- istream<charT, traits>::set_rdbuf(addressof(sb)) is called to install the contained basic_- spanbuf.
template<class ROS> explicit basic_ispanstream(ROS&& s)
// Constraints: ROS models ranges::borrowed_range. !convertible_to<ROS, std::span<charT>> && convertible_to<ROS, std::span<charT const>> is true.
// Effects: Let sp be std::span<const charT>(std::forward<ROS>(s)). Equivalent to basic_ispanstream(std::span<charT>(const_cast<charT*>(sp.data()), sp.size()))
// 31.9.4.3 Swap [ispanstream.swap]
void swap(basic_ispanstream& rhs);
// Effects: Equivalent to:
basic_istream<charT, traits>::swap(rhs);
sb.swap(rhs.sb);
template<class charT, class traits>
void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
// Effects: Equivalent to x.swap(y).
// 31.9.4.4 Member functions [ispanstream.members]
basic_spanbuf<charT, traits>* rdbuf() const noexcept;
// Effects: Equivalent to:
return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
std::span<const charT> span() const noexcept;
// Effects: Equivalent to:
return rdbuf()->span();
void span(std::span<charT> s) noexcept;
// Effects: Equivalent to rdbuf()->span(s).
template<class ROS> void span(ROS&& s) noexcept;
// Effects: Initializes the base class with basic_ostream<charT, traits>(addressof(sb)) and sb with basic_spanbuf<charT, traits>(s, which | ios_base::out)
// Constraints: ROS models ranges::borrowed_range. (!convertible_to<ROS, std::span<charT>>) && convertible_to<ROS, std::span<const charT>> is true.
// Effects: Let sp be std::span<const charT>(std::forward<ROS>(s)). Equivalent to: this->span(std::span<charT>(const_cast<charT*>(sp.data()), sp.size()))
// 31.9.5 Class template basic_ospanstream [ospanstream]
// 31.9.5.1 General [ospanstream.general]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_ospanstream
    : 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.9.5.2, constructors
    explicit basic_ospanstream(std::span<charT> s,
                               ios_base::openmode which = ios_base::out);
    basic_ospanstream(const basic_ospanstream&) = delete;
    basic_ospanstream(basic_ospanstream&& rhs);
    basic_ospanstream& operator=(const basic_ospanstream&) = delete;
    basic_ospanstream& operator=(basic_ospanstream&& rhs);
// 31.9.5.3, swap
    void swap(basic_ospanstream& rhs);
// 31.9.5.4, member functions
    basic_spanbuf<charT, traits>* rdbuf() const noexcept;
    std::span<charT> span() const noexcept;
    void span(std::span<charT> s) noexcept;
private:
    basic_spanbuf<charT, traits> sb; // exposition only };
    template<class charT, class traits>
    void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
};
}
// 31.9.5.2 Constructors [ospanstream.ctor]
explicit basic_ospanstream(std::span<charT> s,
                           ios_base::openmode which = ios_base::out);
basic_ospanstream(basic_ospanstream&& rhs) noexcept;
// Effects: Initializes the base class with std::move(rhs) and sb with std::move(rhs.sb). Next, basic_- ostream<charT, traits>::set_rdbuf(addressof(sb)) is called to install the contained basic_- spanbuf.
// 31.9.5.3 Swap [ospanstream.swap]
void swap(basic_ospanstream& rhs);
// Effects: Equivalent to:
basic_ostream<charT, traits>::swap(rhs);
sb.swap(rhs.sb);
template<class charT, class traits>
void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
// Effects: Equivalent to x.swap(y).
// 31.9.5.4 Member functions [ospanstream.members]
basic_spanbuf<charT, traits>* rdbuf() const noexcept;
// Effects: Equivalent to:
return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
std::span<charT> span() const noexcept;
// Effects: Equivalent to: return rdbuf()->span(); void span(std::span<charT> s) noexcept;
// Effects: Equivalent to rdbuf()->span(s).
// 31.9.6 Class template basic_spanstream  [spanstream]
// 31.9.6.1 General [spanstream.general]
namespace std {
template<class charT, class traits = char_traits<charT>>
class basic_spanstream
    : public basic_iostream<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.9.6.2, constructors
explicit basic_spanstream(std::span<charT> s,
                          ios_base::openmode which = ios_base::out | ios_base::in);
basic_spanstream(const basic_spanstream&) = delete;
basic_spanstream(basic_spanstream&& rhs);
basic_spanstream& operator=(const basic_spanstream&) = delete;
basic_spanstream& operator=(basic_spanstream&& rhs);
// 31.9.6.3, swap
void swap(basic_spanstream& rhs);
// 31.9.6.4, members
basic_spanbuf<charT, traits>* rdbuf() const noexcept;
std::span<charT> span() const noexcept;
void span(std::span<charT> s) noexcept;
private:
basic_spanbuf<charT, traits> sb; // exposition only };
template<class charT, class traits>
void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
// 31.9.6.2 Constructors [spanstream.ctor]
explicit basic_spanstream(std::span<charT> s,
                          ios_base::openmode which = ios_base::out | ios_bas::in);
// Effects: Initializes the base class with basic_iostream<charT, traits>(addressof(sb)) and sb with basic_spanbuf<charT, traits>(s, which) (31.9.3.2).
basic_spanstream(basic_spanstream&& rhs);
// Effects: Initializes the base class with std::move(rhs) and sb with std::move(rhs.sb). Next, basic_iostream<charT, traits>::set_rdbuf(addressof(sb)) is called to install the contained basic_spanbuf.
// 31.9.6.3 Swap [spanstream.swap]
void swap(basic_spanstream& rhs);
// Effects: Equivalent to:
basic_iostream<charT, traits>::swap(rhs);
sb.swap(rhs.sb);
template<class charT, class traits>
void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
// Effects: Equivalent to x.swap(y).
// 31.9.6.4 Member functions [spanstream.members]
basic_spanbuf<charT, traits>* rdbuf() const noexcept;
// Effects: Equivalent to:
return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
std::span<charT> span() const noexcept;
// Effects: Equivalent to: return rdbuf()->span(); void span(std::span<charT> s) noexcept;
// Effects: Equivalent to rdbuf()->span(s).
}
int main() {
    cout  <<  n4910 << endl;
    return EXIT_SUCCESS;
}
```

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

```ubuntu:bash
$ clang++ p1553.cpp -std=03 -o p1553l -I. -Wall
In file included from p1553.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 \
 ^
p1553.cpp:16:1: error: unknown type name 'types'
types are specializations of span as described in 24.7.3.
^
p1553.cpp:16:10: error: expected ';' after top level declarator
types are specializations of span as described in 24.7.3.
         ^
         ;
p1553.cpp:80:7: error: C++ requires a type specifier for all declarations
      basic_spanbuf(basic_spanbuf&& rhs);
      ^
p1553.cpp:80:37: error: use of undeclared identifier 'rhs'
      basic_spanbuf(basic_spanbuf&& rhs);
                                    ^
p1553.cpp:89:1: error: unknown type name 'basic_spanbuf'
basic_spanbuf& operator=(basic_spanbuf&& rhs);
^
p1553.cpp:89:26: error: unknown type name 'basic_spanbuf'
basic_spanbuf& operator=(basic_spanbuf&& rhs);
                         ^
p1553.cpp:89:39: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
basic_spanbuf& operator=(basic_spanbuf&& rhs);
                                      ^
p1553.cpp:91:3: error: unknown type name 'basic_spanbuf'
  basic_spanbuf tmp{std::move(rhs)};
  ^
p1553.cpp:91:20: error: expected ';' after top level declarator
  basic_spanbuf tmp{std::move(rhs)};
                   ^
                   ;
p1553.cpp:92:3: error: expected unqualified-id
  this->swap(tmp);
  ^
p1553.cpp:93:3: error: expected unqualified-id
  return *this;
  ^
p1553.cpp:94:6: error: variable has incomplete type 'void'
void swap(basic_spanbuf& rhs);
     ^
p1553.cpp:94:26: error: use of undeclared identifier 'rhs'
void swap(basic_spanbuf& rhs);
                         ^
p1553.cpp:96:17: error: use of undeclared identifier 'charT'; did you mean 'char'?
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                ^~~~~
                char
p1553.cpp:96:24: error: use of undeclared identifier 'traits'
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                       ^
p1553.cpp:96:54: error: use of undeclared identifier 'mode'; did you mean 'modf'?
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                                                     ^~~~
                                                     modf
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/cmath:372:11: note: 'modf' declared here
  using ::modf;
          ^
p1553.cpp:96:49: error: C++ requires a type specifier for all declarations
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                                                ^
p1553.cpp:97:6: error: C++ requires a type specifier for all declarations
std::swap(buf, rhs.buf);
     ^
p1553.cpp:97:11: error: use of undeclared identifier 'buf'
std::swap(buf, rhs.buf);
          ^
p1553.cpp:99:8: warning: variable templates are a C++14 extension [-Wc++14-extensions]
  void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
$ clang++ p1553.cpp -std=2b -o p1553l -I. -Wall
p1553.cpp:16:1: error: unknown type name 'types'
types are specializations of span as described in 24.7.3.
^
p1553.cpp:16:10: error: expected ';' after top level declarator
types are specializations of span as described in 24.7.3.
         ^
         ;
p1553.cpp:80:7: error: C++ requires a type specifier for all declarations
      basic_spanbuf(basic_spanbuf&& rhs);
      ^
p1553.cpp:80:37: error: use of undeclared identifier 'rhs'
      basic_spanbuf(basic_spanbuf&& rhs);
                                    ^
p1553.cpp:89:1: error: unknown type name 'basic_spanbuf'
basic_spanbuf& operator=(basic_spanbuf&& rhs);
^
p1553.cpp:89:26: error: unknown type name 'basic_spanbuf'
basic_spanbuf& operator=(basic_spanbuf&& rhs);
                         ^
p1553.cpp:91:3: error: unknown type name 'basic_spanbuf'
  basic_spanbuf tmp{std::move(rhs)};
  ^
p1553.cpp:91:31: error: use of undeclared identifier 'rhs'
  basic_spanbuf tmp{std::move(rhs)};
                              ^
p1553.cpp:92:3: error: expected unqualified-id
  this->swap(tmp);
  ^
p1553.cpp:93:3: error: expected unqualified-id
  return *this;
  ^
p1553.cpp:94:6: error: variable has incomplete type 'void'
void swap(basic_spanbuf& rhs);
     ^
p1553.cpp:94:26: error: use of undeclared identifier 'rhs'
void swap(basic_spanbuf& rhs);
                         ^
p1553.cpp:96:17: error: use of undeclared identifier 'charT'; did you mean 'char'?
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                ^~~~~
                char
p1553.cpp:96:24: error: use of undeclared identifier 'traits'
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                       ^
p1553.cpp:96:49: error: C++ requires a type specifier for all declarations
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                                                ^
p1553.cpp:96:54: error: use of undeclared identifier 'mode'
basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
                                                     ^
p1553.cpp:97:6: error: C++ requires a type specifier for all declarations
std::swap(buf, rhs.buf);
     ^
p1553.cpp:97:11: error: use of undeclared identifier 'buf'
std::swap(buf, rhs.buf);
          ^
p1553.cpp:99:8: error: variable has incomplete type 'void'
  void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

$ g++ p1553.cpp -std=03 -o p1553g -I. -Wall
In file included from /usr/local/include/c++/12.1.0/atomic:38,
                 from N4910.h:11,
                 from p1553.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 \
      |  ^~~~~
p1553.cpp:16:51: error: too many decimal points in number
   16 | types are specializations of span as described in 24.7.3.
      |                                                   ^~~~~~~
p1553.cpp:102:31: warning: identifier 'noexcept' is a keyword in C++11 [-Wc++11-compat]
  102 | std::span<charT> span() const noexcept;
      |                               ^~~~~~~~
p1553.cpp:16:1: error: 'types' does not name a type
   16 | types are specializations of span as described in 24.7.3.
      | ^~~~~
p1553.cpp:41:59: error: spurious '>>', use '>' to terminate a template argument list
   41 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1553.cpp:43:39: error: 'traits' was not declared in this scope
   43 |       : public basic_streambuf<charT, traits> {
      |                                       ^~~~~~
p1553.cpp:43:45: error: template argument 2 is invalid
   43 |       : public basic_streambuf<charT, traits> {
      |                                             ^
p1553.cpp:43:47: error: definition of 'class std::basic_spanbuf' inside template parameter list
   43 |       : public basic_streambuf<charT, traits> {
      |                                               ^
p1553.cpp:41:42: error: two or more data types in declaration of 'type name'
   41 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1553.cpp:69:2: error: expected '>' before ';' token
   69 | };
      |  ^
p1553.cpp:69:2: error: expected unqualified-id before ';' token
p1553.cpp:71:13: error: variable or field 'swap' declared void
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |             ^~~~
p1553.cpp:71:18: error: 'basic_spanbuf' was not declared in this scope; did you mean 'basic_streambuf'?
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                  ^~~~~~~~~~~~~
      |                  basic_streambuf
p1553.cpp:71:37: error: expected primary-expression before ',' token
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                     ^
p1553.cpp:71:45: error: expected primary-expression before '>' token
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                             ^
p1553.cpp:71:48: error: 'x' was not declared in this scope
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                ^
p1553.cpp:71:51: error: 'basic_spanbuf' was not declared in this scope; did you mean 'basic_streambuf'?
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                   ^~~~~~~~~~~~~
      |                                                   basic_streambuf
p1553.cpp:71:70: error: expected primary-expression before ',' token
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                                      ^
p1553.cpp:71:78: error: expected primary-expression before '>' token
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                                              ^
p1553.cpp:71:81: error: 'y' was not declared in this scope; did you mean 'yn'?
   71 |        void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                                                 ^
      |                                                                                 yn
p1553.cpp:77:10: error: ISO C++ forbids declaration of 'basic_spanbuf' with no type [-fpermissive]
   77 | explicit basic_spanbuf(std::span<charT> s,
      |          ^~~~~~~~~~~~~
p1553.cpp:77:1: error: 'explicit' outside class declaration
   77 | explicit basic_spanbuf(std::span<charT> s,
      | ^~~~~~~~
p1553.cpp:77:29: error: 'span' is not a member of 'std'
   77 | explicit basic_spanbuf(std::span<charT> s,
      |                             ^~~~
p1553.cpp:77:34: error: 'charT' was not declared in this scope; did you mean 'char'?
   77 | explicit basic_spanbuf(std::span<charT> s,
      |                                  ^~~~~
      |                                  char
p1553.cpp:77:41: error: 's' was not declared in this scope
   77 | explicit basic_spanbuf(std::span<charT> s,
      |                                         ^
p1553.cpp:78:20: error: expected primary-expression before 'which'
   78 | ios_base::openmode which = ios_base::in | ios_base::out);
      |                    ^~~~~
p1553.cpp:78:56: error: expression list treated as compound expression in initializer [-fpermissive]
   78 | ios_base::openmode which = ios_base::in | ios_base::out);
      |                                                        ^
p1553.cpp:80:20: error: expected constructor, destructor, or type conversion before '(' token
   80 |       basic_spanbuf(basic_spanbuf&& rhs);
      |                    ^
p1553.cpp:89:1: error: 'basic_spanbuf' does not name a type
   89 | basic_spanbuf& operator=(basic_spanbuf&& rhs);
      | ^~~~~~~~~~~~~
p1553.cpp:91:3: error: 'basic_spanbuf' does not name a type
   91 |   basic_spanbuf tmp{std::move(rhs)};
      |   ^~~~~~~~~~~~~
p1553.cpp:92:3: error: expected unqualified-id before 'this'
   92 |   this->swap(tmp);
      |   ^~~~
p1553.cpp:93:3: error: expected unqualified-id before 'return'
   93 |   return *this;
      |   ^~~~~~
p1553.cpp:94:6: error: variable or field 'swap' declared void
   94 | void swap(basic_spanbuf& rhs);
      |      ^~~~
p1553.cpp:94:26: error: 'rhs' was not declared in this scope
   94 | void swap(basic_spanbuf& rhs);
      |                          ^~~
p1553.cpp:96:17: error: 'charT' was not declared in this scope; did you mean 'char'?
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                 ^~~~~
      |                 char
p1553.cpp:96:24: error: 'traits' was not declared in this scope
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                        ^~~~~~
p1553.cpp:96:30: error: template argument 1 is invalid
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                              ^
p1553.cpp:96:30: error: template argument 2 is invalid
p1553.cpp:96:38: error: 'rhs' was not declared in this scope
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                                      ^~~
p1553.cpp:96:53: error: expected constructor, destructor, or type conversion before '(' token
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                                                     ^
p1553.cpp:97:10: error: expected constructor, destructor, or type conversion before '(' token
   97 | std::swap(buf, rhs.buf);
      |          ^
p1553.cpp:99:8: error: variable or field 'swap' declared void
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |        ^~~~
p1553.cpp:99:32: error: expected primary-expression before ',' token
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                ^
p1553.cpp:99:40: error: expected primary-expression before '>' token
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                        ^
p1553.cpp:99:43: error: 'x' was not declared in this scope
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                           ^
p1553.cpp:99:65: error: expected primary-expression before ',' token
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                                 ^
p1553.cpp:99:73: error: expected primary-expression before '>' token
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                                         ^
p1553.cpp:99:76: error: 'y' was not declared in this scope; did you mean 'yn'?
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |                                                                            ^
      |                                                                            yn
p1553.cpp:102:6: error: 'span' in namespace 'std' does not name a template type
  102 | std::span<charT> span() const noexcept;
      |      ^~~~
p1553.cpp:105:6: error: variable or field 'span' declared void
  105 | void span(std::span<charT> s) noexcept;
      |      ^~~~
p1553.cpp:105:16: error: 'span' is not a member of 'std'
  105 | void span(std::span<charT> s) noexcept;
      |                ^~~~
p1553.cpp:105:21: error: 'charT' was not declared in this scope; did you mean 'char'?
  105 | void span(std::span<charT> s) noexcept;
      |                     ^~~~~
      |                     char
p1553.cpp:105:28: error: 's' was not declared in this scope
  105 | void span(std::span<charT> s) noexcept;
      |                            ^
p1553.cpp:108:9: error: expected constructor, destructor, or type conversion before '==' token
  108 | pbase() == s.data() && epptr() == pbase() + s.size() is true;
      |         ^~
p1553.cpp:122:1: error: 'off_type' does not name a type; did you mean 'off_t'?
  122 | off_type newoff = baseoff + off;
      | ^~~~~~~~
      | off_t
p1553.cpp:127:4: error: 'pos_type' does not name a type
  127 |    pos_type seekoff(off_type off, ios_base::seekdir way,
      |    ^~~~~~~~
p1553.cpp:129:1: error: 'pos_type' does not name a type
  129 | pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override;
      | ^~~~~~~~
p1553.cpp:131:1: error: expected unqualified-id before 'return'
  131 | return seekoff(off_type(sp), ios_base::beg, which);
      | ^~~~~~
p1553.cpp:132:17: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                 ^~~~~
      |                 char
p1553.cpp:132:24: error: 'traits' was not declared in this scope
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                        ^~~~~~
p1553.cpp:132:30: error: template argument 1 is invalid
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                              ^
p1553.cpp:132:30: error: template argument 2 is invalid
p1553.cpp:132:40: error: 'int* setbuf' redeclared as different kind of entity
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                        ^~~~~
In file included from /usr/local/include/c++/12.1.0/cstdio:42,
                 from N4910.h:3:
/usr/include/stdio.h:304:13: note: previous declaration 'void setbuf(FILE*, char*)'
  304 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;
      |             ^~~~~~
p1553.cpp:132:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                        ^~~~~
      |                                        char
p1553.cpp:132:47: error: 's' was not declared in this scope
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                               ^
p1553.cpp:132:61: error: expected primary-expression before 'n'
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                                             ^
p1553.cpp:134:1: error: expected unqualified-id before 'this'
  134 | this->span(std::span<charT>(s, n));
      | ^~~~
p1553.cpp:135:1: error: expected unqualified-id before 'return'
  135 | return this;
      | ^~~~~~
p1553.cpp:139:59: error: spurious '>>', use '>' to terminate a template argument list
  139 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1553.cpp:141:37: error: 'traits' was not declared in this scope
  141 |       : public basic_istream<charT, traits> {
      |                                     ^~~~~~
p1553.cpp:141:43: error: template argument 2 is invalid
  141 |       : public basic_istream<charT, traits> {
      |                                           ^
p1553.cpp:141:45: error: definition of 'class std::basic_ispanstream' inside template parameter list
  141 |       : public basic_istream<charT, traits> {
      |                                             ^
p1553.cpp:139:42: error: two or more data types in declaration of 'type name'
  139 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1553.cpp:166:2: error: expected '>' before ';' token
  166 | };
      |  ^
p1553.cpp:166:2: error: expected unqualified-id before ';' token
p1553.cpp:168:15: error: variable or field 'swap' declared void
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |               ^~~~
p1553.cpp:168:20: error: 'basic_ispanstream' was not declared in this scope; did you mean 'basic_istream'?
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                    ^~~~~~~~~~~~~~~~~
      |                    basic_istream
p1553.cpp:168:43: error: expected primary-expression before ',' token
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                           ^
p1553.cpp:168:51: error: expected primary-expression before '>' token
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                   ^
p1553.cpp:168:54: error: 'x' was not declared in this scope
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                      ^
p1553.cpp:168:57: error: 'basic_ispanstream' was not declared in this scope; did you mean 'basic_istream'?
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                         ^~~~~~~~~~~~~~~~~
      |                                                         basic_istream
p1553.cpp:168:80: error: expected primary-expression before ',' token
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                                                ^
p1553.cpp:168:88: error: expected primary-expression before '>' token
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                                                        ^
p1553.cpp:168:91: error: 'y' was not declared in this scope; did you mean 'yn'?
  168 |          void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                                                           ^
      |                                                                                           yn
p1553.cpp:171:1: error: 'spanbuf' does not name a type
  171 | spanbuf.
      | ^~~~~~~
p1553.cpp:174:18: error: expected constructor, destructor, or type conversion before '(' token
  174 | basic_ispanstream(basic_ispanstream&& rhs);
      |                  ^
p1553.cpp:176:51: error: expected ',' or '...' before '&&' token
  176 | template<class ROS> explicit basic_ispanstream(ROS&& s)
      |                                                   ^~
p1553.cpp:180:1: error: expected initializer before 'void'
  180 | void swap(basic_ispanstream& rhs);
      | ^~~~
p1553.cpp:182:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  182 | basic_istream<charT, traits>::swap(rhs);
      |               ^~~~~
      |               char
p1553.cpp:182:22: error: 'traits' was not declared in this scope
  182 | basic_istream<charT, traits>::swap(rhs);
      |                      ^~~~~~
p1553.cpp:182:28: error: template argument 1 is invalid
  182 | basic_istream<charT, traits>::swap(rhs);
      |                            ^
p1553.cpp:182:28: error: template argument 2 is invalid
p1553.cpp:182:31: error: redefinition of 'int swap'
  182 | basic_istream<charT, traits>::swap(rhs);
      |                               ^~~~
p1553.cpp:96:33: note: 'int swap' previously defined here
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                                 ^~~~
p1553.cpp:182:36: error: 'rhs' was not declared in this scope
  182 | basic_istream<charT, traits>::swap(rhs);
      |                                    ^~~
p1553.cpp:183:3: error: 'sb' does not name a type
  183 |   sb.swap(rhs.sb);
      |   ^~
p1553.cpp:185:8: error: variable or field 'swap' declared void
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |        ^~~~
p1553.cpp:185:13: error: 'basic_ispanstream' was not declared in this scope
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |             ^~~~~~~~~~~~~~~~~
p1553.cpp:185:36: error: expected primary-expression before ',' token
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                    ^
p1553.cpp:185:44: error: expected primary-expression before '>' token
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                            ^
p1553.cpp:185:47: error: 'x' was not declared in this scope
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                               ^
p1553.cpp:185:50: error: 'basic_ispanstream' was not declared in this scope
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                  ^~~~~~~~~~~~~~~~~
p1553.cpp:185:73: error: expected primary-expression before ',' token
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                                         ^
p1553.cpp:185:81: error: expected primary-expression before '>' token
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                                                 ^
p1553.cpp:185:84: error: 'y' was not declared in this scope; did you mean 'yn'?
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |                                                                                    ^
      |                                                                                    yn
p1553.cpp:188:1: error: 'basic_spanbuf' does not name a type
  188 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      | ^~~~~~~~~~~~~
p1553.cpp:190:1: error: expected unqualified-id before 'return'
  190 | return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
      | ^~~~~~
p1553.cpp:191:6: error: 'span' in namespace 'std' does not name a template type
  191 | std::span<const charT> span() const noexcept;
      |      ^~~~
p1553.cpp:193:1: error: expected unqualified-id before 'return'
  193 | return rdbuf()->span();
      | ^~~~~~
p1553.cpp:194:6: error: variable or field 'span' declared void
  194 | void span(std::span<charT> s) noexcept;
      |      ^~~~
p1553.cpp:194:16: error: 'span' is not a member of 'std'
  194 | void span(std::span<charT> s) noexcept;
      |                ^~~~
p1553.cpp:194:21: error: 'charT' was not declared in this scope; did you mean 'char'?
  194 | void span(std::span<charT> s) noexcept;
      |                     ^~~~~
      |                     char
p1553.cpp:194:28: error: 's' was not declared in this scope
  194 | void span(std::span<charT> s) noexcept;
      |                            ^
p1553.cpp:196:34: error: expected ',' or '...' before '&&' token
  196 | template<class ROS> void span(ROS&& s) noexcept;
      |                                  ^~
p1553.cpp:196:40: error: expected initializer before 'noexcept'
  196 | template<class ROS> void span(ROS&& s) noexcept;
      |                                        ^~~~~~~~
p1553.cpp:203:59: error: spurious '>>', use '>' to terminate a template argument list
  203 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1553.cpp:205:37: error: 'traits' was not declared in this scope
  205 |       : public basic_ostream<charT, traits> {
      |                                     ^~~~~~
p1553.cpp:205:43: error: template argument 2 is invalid
  205 |       : public basic_ostream<charT, traits> {
      |                                           ^
p1553.cpp:205:45: error: definition of 'class std::basic_ospanstream' inside template parameter list
  205 |       : public basic_ostream<charT, traits> {
      |                                             ^
p1553.cpp:203:42: error: two or more data types in declaration of 'type name'
  203 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1553.cpp:229:2: error: expected '>' before ';' token
  229 | };
      |  ^
p1553.cpp:229:2: error: expected unqualified-id before ';' token
p1553.cpp:232:10: error: ISO C++ forbids declaration of 'basic_ospanstream' with no type [-fpermissive]
  232 | explicit basic_ospanstream(std::span<charT> s,
      |          ^~~~~~~~~~~~~~~~~
p1553.cpp:232:1: error: 'explicit' outside class declaration
  232 | explicit basic_ospanstream(std::span<charT> s,
      | ^~~~~~~~
p1553.cpp:232:33: error: 'span' is not a member of 'std'
  232 | explicit basic_ospanstream(std::span<charT> s,
      |                                 ^~~~
p1553.cpp:232:38: error: 'charT' was not declared in this scope; did you mean 'char'?
  232 | explicit basic_ospanstream(std::span<charT> s,
      |                                      ^~~~~
      |                                      char
p1553.cpp:232:45: error: 's' was not declared in this scope
  232 | explicit basic_ospanstream(std::span<charT> s,
      |                                             ^
p1553.cpp:233:47: error: expected primary-expression before 'which'
  233 |                            ios_base::openmode which = ios_base::out);
      |                                               ^~~~~
p1553.cpp:233:68: error: expression list treated as compound expression in initializer [-fpermissive]
  233 |                            ios_base::openmode which = ios_base::out);
      |                                                                    ^
p1553.cpp:234:18: error: expected constructor, destructor, or type conversion before '(' token
  234 | basic_ospanstream(basic_ospanstream&& rhs) noexcept;
      |                  ^
p1553.cpp:237:9: error: variable or field 'swap' declared void
  237 |    void swap(basic_ospanstream& rhs);
      |         ^~~~
p1553.cpp:237:33: error: 'rhs' was not declared in this scope
  237 |    void swap(basic_ospanstream& rhs);
      |                                 ^~~
p1553.cpp:239:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  239 | basic_ostream<charT, traits>::swap(rhs);
      |               ^~~~~
      |               char
p1553.cpp:239:22: error: 'traits' was not declared in this scope
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                      ^~~~~~
p1553.cpp:239:28: error: template argument 1 is invalid
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                            ^
p1553.cpp:239:28: error: template argument 2 is invalid
p1553.cpp:239:31: error: redefinition of 'int swap'
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                               ^~~~
p1553.cpp:96:33: note: 'int swap' previously defined here
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                                 ^~~~
p1553.cpp:239:36: error: 'rhs' was not declared in this scope
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                                    ^~~
p1553.cpp:240:3: error: 'sb' does not name a type
  240 |   sb.swap(rhs.sb);
      |   ^~
p1553.cpp:242:8: error: variable or field 'swap' declared void
  242 |   void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
      |        ^~~~
p1553.cpp:242:36: error: expected primary-expression before ',' token
  242 |   void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
      |                                    ^
p1553.cpp:242:44: error: expected primary-expression before '>' token
  242 |   void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
      |                                            ^
p1553.cpp:242:47: error: 'x' was not declared in this scope
  242 |   void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
      |                                               ^
p1553.cpp:242:73: error: expected primary-expression before ',' token
  242 |   void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
      |                                                                         ^
p1553.cpp:242:81: error: expected primary-expression before '>' token
  242 |   void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
      |                                                                                 ^
p1553.cpp:242:84: error: 'y' was not declared in this scope; did you mean 'yn'?
  242 |   void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
      |                                                                                    ^
      |                                                                                    yn
p1553.cpp:245:1: error: 'basic_spanbuf' does not name a type
  245 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      | ^~~~~~~~~~~~~
p1553.cpp:247:1: error: expected unqualified-id before 'return'
  247 | return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
      | ^~~~~~
p1553.cpp:248:6: error: 'span' in namespace 'std' does not name a template type
  248 | std::span<charT> span() const noexcept;
      |      ^~~~
p1553.cpp:254:59: error: spurious '>>', use '>' to terminate a template argument list
  254 |     template<class charT, class traits = char_traits<charT>>
      |                                                           ^~
p1553.cpp:256:38: error: 'traits' was not declared in this scope
  256 |       : public basic_iostream<charT, traits> {
      |                                      ^~~~~~
p1553.cpp:256:44: error: template argument 2 is invalid
  256 |       : public basic_iostream<charT, traits> {
      |                                            ^
p1553.cpp:256:46: error: definition of 'class std::basic_spanstream' inside template parameter list
  256 |       : public basic_iostream<charT, traits> {
      |                                              ^
p1553.cpp:254:42: error: two or more data types in declaration of 'type name'
  254 |     template<class charT, class traits = char_traits<charT>>
      |                                          ^~~~~~~~~~~~~~~~~~~
p1553.cpp:258:2: error: expected '>' before ';' token
  258 | };
      |  ^
p1553.cpp:258:2: error: expected unqualified-id before ';' token
p1553.cpp:259:7: error: expected nested-name-specifier before 'char_type'
  259 | using char_type = charT;
      |       ^~~~~~~~~
p1553.cpp:260:7: error: expected nested-name-specifier before 'int_type'
  260 | using int_type = typename traits::int_type;
      |       ^~~~~~~~
p1553.cpp:261:7: error: expected nested-name-specifier before 'pos_type'
  261 | using pos_type = typename traits::pos_type;
      |       ^~~~~~~~
p1553.cpp:262:7: error: expected nested-name-specifier before 'off_type'
  262 | using off_type = typename traits::off_type;
      |       ^~~~~~~~
p1553.cpp:263:7: error: expected nested-name-specifier before 'traits_type'
  263 | using traits_type = traits;
      |       ^~~~~~~~~~~
p1553.cpp:265:10: error: ISO C++ forbids declaration of 'basic_spanstream' with no type [-fpermissive]
  265 | explicit basic_spanstream(std::span<charT> s,
      |          ^~~~~~~~~~~~~~~~
p1553.cpp:265:1: error: 'explicit' outside class declaration
  265 | explicit basic_spanstream(std::span<charT> s,
      | ^~~~~~~~
p1553.cpp:265:32: error: 'span' is not a member of 'std'
  265 | explicit basic_spanstream(std::span<charT> s,
      |                                ^~~~
p1553.cpp:265:37: error: 'charT' was not declared in this scope; did you mean 'char'?
  265 | explicit basic_spanstream(std::span<charT> s,
      |                                     ^~~~~
      |                                     char
p1553.cpp:265:44: error: 's' was not declared in this scope; did you mean 'ws'?
  265 | explicit basic_spanstream(std::span<charT> s,
      |                                            ^
      |                                            ws
p1553.cpp:266:48: error: expected primary-expression before 'which'
  266 |                             ios_base::openmode which = ios_base::out | ios_base::in);
      |                                                ^~~~~
p1553.cpp:266:84: error: expression list treated as compound expression in initializer [-fpermissive]
  266 |                             ios_base::openmode which = ios_base::out | ios_base::in);
      |                                                                                    ^
p1553.cpp:267:26: error: 'basic_spanstream' does not name a type; did you mean 'basic_ostream'?
  267 |   basic_spanstream(const basic_spanstream&) = delete;
      |                          ^~~~~~~~~~~~~~~~
      |                          basic_ostream
p1553.cpp:267:45: error: expected constructor, destructor, or type conversion before '=' token
  267 |   basic_spanstream(const basic_spanstream&) = delete;
      |                                             ^
p1553.cpp:268:19: error: expected constructor, destructor, or type conversion before '(' token
  268 |   basic_spanstream(basic_spanstream&& rhs);
      |                   ^
p1553.cpp:269:3: error: 'basic_spanstream' does not name a type; did you mean 'basic_ostream'?
  269 |   basic_spanstream& operator=(const basic_spanstream&) = delete;
      |   ^~~~~~~~~~~~~~~~
      |   basic_ostream
p1553.cpp:270:3: error: 'basic_spanstream' does not name a type; did you mean 'basic_ostream'?
  270 |   basic_spanstream& operator=(basic_spanstream&& rhs);
      |   ^~~~~~~~~~~~~~~~
      |   basic_ostream
p1553.cpp:272:6: error: variable or field 'swap' declared void
  272 | void swap(basic_spanstream& rhs);
      |      ^~~~
p1553.cpp:272:29: error: 'rhs' was not declared in this scope
  272 | void swap(basic_spanstream& rhs);
      |                             ^~~
p1553.cpp:274:1: error: 'basic_spanbuf' does not name a type; did you mean 'basic_streambuf'?
  274 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      | ^~~~~~~~~~~~~
      | basic_streambuf
p1553.cpp:275:8: error: 'span' in namespace 'std' does not name a template type
  275 |   std::span<charT> span() const noexcept;
      |        ^~~~
p1553.cpp:276:8: error: variable or field 'span' declared void
  276 |   void span(std::span<charT> s) noexcept;
      |        ^~~~
p1553.cpp:276:18: error: 'span' is not a member of 'std'
  276 |   void span(std::span<charT> s) noexcept;
      |                  ^~~~
p1553.cpp:276:23: error: 'charT' was not declared in this scope; did you mean 'char'?
  276 |   void span(std::span<charT> s) noexcept;
      |                       ^~~~~
      |                       char
p1553.cpp:276:30: error: 's' was not declared in this scope; did you mean 'ws'?
  276 |   void span(std::span<charT> s) noexcept;
      |                              ^
      |                              ws
p1553.cpp:277:1: error: expected unqualified-id before 'private'
  277 | private:
      | ^~~~~~~
p1553.cpp:280:8: error: variable or field 'swap' declared void
  280 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |        ^~~~
p1553.cpp:280:35: error: expected primary-expression before ',' token
  280 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                   ^
p1553.cpp:280:43: error: expected primary-expression before '>' token
  280 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                           ^
p1553.cpp:280:46: error: 'x' was not declared in this scope
  280 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                              ^
p1553.cpp:280:71: error: expected primary-expression before ',' token
  280 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                                                       ^
p1553.cpp:280:79: error: expected primary-expression before '>' token
  280 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                                                               ^
p1553.cpp:280:82: error: 'y' was not declared in this scope; did you mean 'yn'?
  280 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                                                                  ^
      |                                                                                  yn
p1553.cpp:282:10: error: ISO C++ forbids declaration of 'basic_spanstream' with no type [-fpermissive]
  282 | explicit basic_spanstream(std::span<charT> s,
      |          ^~~~~~~~~~~~~~~~
p1553.cpp:282:1: error: 'explicit' outside class declaration
  282 | explicit basic_spanstream(std::span<charT> s,
      | ^~~~~~~~
p1553.cpp:282:10: error: redefinition of 'int std::basic_spanstream'
  282 | explicit basic_spanstream(std::span<charT> s,
      |          ^~~~~~~~~~~~~~~~
p1553.cpp:265:10: note: 'int std::basic_spanstream' previously defined here
  265 | explicit basic_spanstream(std::span<charT> s,
      |          ^~~~~~~~~~~~~~~~
p1553.cpp:282:32: error: 'span' is not a member of 'std'
  282 | explicit basic_spanstream(std::span<charT> s,
      |                                ^~~~
p1553.cpp:282:37: error: 'charT' was not declared in this scope; did you mean 'char'?
  282 | explicit basic_spanstream(std::span<charT> s,
      |                                     ^~~~~
      |                                     char
p1553.cpp:282:44: error: 's' was not declared in this scope; did you mean 'ws'?
  282 | explicit basic_spanstream(std::span<charT> s,
      |                                            ^
      |                                            ws
p1553.cpp:283:46: error: expected primary-expression before 'which'
  283 |                           ios_base::openmode which = ios_base::out | ios_bas::in);
      |                                              ^~~~~
p1553.cpp:285:17: error: expected constructor, destructor, or type conversion before '(' token
  285 | basic_spanstream(basic_spanstream&& rhs);
      |                 ^
p1553.cpp:288:6: error: variable or field 'swap' declared void
  288 | void swap(basic_spanstream& rhs);
      |      ^~~~
p1553.cpp:288:29: error: 'rhs' was not declared in this scope
  288 | void swap(basic_spanstream& rhs);
      |                             ^~~
p1553.cpp:290:16: error: 'charT' was not declared in this scope; did you mean 'char'?
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                ^~~~~
      |                char
p1553.cpp:290:23: error: 'traits' was not declared in this scope
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                       ^~~~~~
p1553.cpp:290:29: error: template argument 1 is invalid
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                             ^
p1553.cpp:290:29: error: template argument 2 is invalid
p1553.cpp:290:40: error: 'int std::swap' redeclared as different kind of entity
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                                        ^
In file included from /usr/local/include/c++/12.1.0/map:62,
                 from N4910.h:10:
/usr/local/include/c++/12.1.0/bits/stl_multimap.h:1206:5: note: previous declaration 'template<class _Key, class _Tp, class _Compare, class _Alloc> void std::swap(multimap<_Key, _Tp, _Compare, _Alloc>&, multimap<_Key, _Tp, _Compare, _Alloc>&)'
 1206 |     swap(multimap<_Key, _Tp, _Compare, _Alloc>& __x,
      |     ^~~~
p1553.cpp:290:37: error: 'rhs' was not declared in this scope
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                                     ^~~
p1553.cpp:291:3: error: 'sb' does not name a type
  291 |   sb.swap(rhs.sb);
      |   ^~
p1553.cpp:293:8: error: variable or field 'swap' declared void
  293 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |        ^~~~
p1553.cpp:293:35: error: expected primary-expression before ',' token
  293 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                   ^
p1553.cpp:293:43: error: expected primary-expression before '>' token
  293 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                           ^
p1553.cpp:293:46: error: 'x' was not declared in this scope
  293 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                              ^
p1553.cpp:293:71: error: expected primary-expression before ',' token
  293 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                                                       ^
p1553.cpp:293:79: error: expected primary-expression before '>' token
  293 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                                                               ^
p1553.cpp:293:82: error: 'y' was not declared in this scope; did you mean 'yn'?
  293 |   void swap(basic_spanstream<charT, traits>& x, basic_spanstream<charT, traits>& y);
      |                                                                                  ^
      |                                                                                  yn
p1553.cpp:296:1: error: 'basic_spanbuf' does not name a type; did you mean 'basic_streambuf'?
  296 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      | ^~~~~~~~~~~~~
      | basic_streambuf
p1553.cpp:298:1: error: expected unqualified-id before 'return'
  298 | return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
      | ^~~~~~
p1553.cpp:299:6: error: 'span' in namespace 'std' does not name a template type
  299 | std::span<charT> span() const noexcept;
      |      ^~~~

$ g++ p1553.cpp -std=2b -o p1553g -I. -Wall
p1553.cpp:16:51: error: too many decimal points in number
   16 | types are specializations of span as described in 24.7.3.
      |                                                   ^~~~~~~
p1553.cpp:16:1: error: 'types' does not name a type
   16 | types are specializations of span as described in 24.7.3.
      | ^~~~~
p1553.cpp:53:33: error: expected ')' before '<' token
   53 | explicit basic_spanbuf(std::span<charT> s,
      |                       ~         ^
      |                                 )
p1553.cpp: In constructor 'std::basic_spanbuf<charT, traits>::basic_spanbuf(std::ios_base::openmode)':
p1553.cpp:52:24: error: 'span' is not a member of 'std'
   52 |   : basic_spanbuf(std::span<charT>(), which) {}
      |                        ^~~~
p1553.cpp:52:34: error: expected primary-expression before '>' token
   52 |   : basic_spanbuf(std::span<charT>(), which) {}
      |                                  ^
p1553.cpp:52:36: error: expected primary-expression before ')' token
   52 |   : basic_spanbuf(std::span<charT>(), which) {}
      |                                    ^
p1553.cpp: At global scope:
p1553.cpp:77:33: error: expected ')' before '<' token
   77 | explicit basic_spanbuf(std::span<charT> s,
      |                       ~         ^
      |                                 )
p1553.cpp:80:21: error: template placeholder type 'basic_spanbuf<...auto...>' must be followed by a simple declarator-id
   80 |       basic_spanbuf(basic_spanbuf&& rhs);
      |                     ^~~~~~~~~~~~~
p1553.cpp:42:11: note: 'template<class charT, class traits> class std::basic_spanbuf' declared here
   42 |     class basic_spanbuf
      |           ^~~~~~~~~~~~~
p1553.cpp:80:7: error: deduction guide for 'std::basic_spanbuf<charT, traits>' must have trailing return type
   80 |       basic_spanbuf(basic_spanbuf&& rhs);
      |       ^~~~~~~~~~~~~
p1553.cpp:42:11: note: 'template<class charT, class traits> class std::basic_spanbuf' declared here
   42 |     class basic_spanbuf
      |           ^~~~~~~~~~~~~
p1553.cpp:89:26: error: template placeholder type 'basic_spanbuf<...auto...>' must be followed by a simple declarator-id
   89 | basic_spanbuf& operator=(basic_spanbuf&& rhs);
      |                          ^~~~~~~~~~~~~
p1553.cpp:42:11: note: 'template<class charT, class traits> class std::basic_spanbuf' declared here
   42 |     class basic_spanbuf
      |           ^~~~~~~~~~~~~
p1553.cpp:89:1: error: deduced class type 'basic_spanbuf' in function return type
   89 | basic_spanbuf& operator=(basic_spanbuf&& rhs);
      | ^~~~~~~~~~~~~
p1553.cpp:42:11: note: 'template<class charT, class traits> class std::basic_spanbuf' declared here
   42 |     class basic_spanbuf
      |           ^~~~~~~~~~~~~
p1553.cpp:91:31: error: 'rhs' was not declared in this scope
   91 |   basic_spanbuf tmp{std::move(rhs)};
      |                               ^~~
p1553.cpp:92:3: error: expected unqualified-id before 'this'
   92 |   this->swap(tmp);
      |   ^~~~
p1553.cpp:93:3: error: expected unqualified-id before 'return'
   93 |   return *this;
      |   ^~~~~~
p1553.cpp:94:11: error: template placeholder type 'basic_spanbuf<...auto...>' must be followed by a simple declarator-id
   94 | void swap(basic_spanbuf& rhs);
      |           ^~~~~~~~~~~~~
p1553.cpp:42:11: note: 'template<class charT, class traits> class std::basic_spanbuf' declared here
   42 |     class basic_spanbuf
      |           ^~~~~~~~~~~~~
p1553.cpp:96:17: error: 'charT' was not declared in this scope; did you mean 'char'?
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                 ^~~~~
      |                 char
p1553.cpp:96:24: error: 'traits' was not declared in this scope
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                        ^~~~~~
p1553.cpp:96:30: error: template argument 1 is invalid
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                              ^
p1553.cpp:96:30: error: template argument 2 is invalid
p1553.cpp:96:41: error: 'int swap' redeclared as different kind of entity
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                                         ^
p1553.cpp:94:6: note: previous declaration 'void swap(...)'
   94 | void swap(basic_spanbuf& rhs);
      |      ^~~~
p1553.cpp:96:38: error: 'rhs' was not declared in this scope
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                                      ^~~
p1553.cpp:96:53: error: expected constructor, destructor, or type conversion before '(' token
   96 | basic_streambuf<charT, traits>::swap(rhs); std::swap(mode, rhs.mode);
      |                                                     ^
p1553.cpp:97:10: error: expected constructor, destructor, or type conversion before '(' token
   97 | std::swap(buf, rhs.buf);
      |          ^
p1553.cpp:102:6: error: 'span' in namespace 'std' does not name a template type
  102 | std::span<charT> span() const noexcept;
      |      ^~~~
p1553.cpp:105:6: error: variable or field 'span' declared void
  105 | void span(std::span<charT> s) noexcept;
      |      ^~~~
p1553.cpp:105:16: error: 'span' is not a member of 'std'
  105 | void span(std::span<charT> s) noexcept;
      |                ^~~~
p1553.cpp:105:21: error: 'charT' was not declared in this scope; did you mean 'char'?
  105 | void span(std::span<charT> s) noexcept;
      |                     ^~~~~
      |                     char
p1553.cpp:105:28: error: 's' was not declared in this scope
  105 | void span(std::span<charT> s) noexcept;
      |                            ^
p1553.cpp:108:9: error: expected constructor, destructor, or type conversion before '==' token
  108 | pbase() == s.data() && epptr() == pbase() + s.size() is true;
      |         ^~
p1553.cpp:122:1: error: 'off_type' does not name a type; did you mean 'off_t'?
  122 | off_type newoff = baseoff + off;
      | ^~~~~~~~
      | off_t
p1553.cpp:127:4: error: 'pos_type' does not name a type
  127 |    pos_type seekoff(off_type off, ios_base::seekdir way,
      |    ^~~~~~~~
p1553.cpp:129:1: error: 'pos_type' does not name a type
  129 | pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override;
      | ^~~~~~~~
p1553.cpp:131:1: error: expected unqualified-id before 'return'
  131 | return seekoff(off_type(sp), ios_base::beg, which);
      | ^~~~~~
p1553.cpp:132:17: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                 ^~~~~
      |                 char
p1553.cpp:132:24: error: 'traits' was not declared in this scope
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                        ^~~~~~
p1553.cpp:132:30: error: template argument 1 is invalid
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                              ^
p1553.cpp:132:30: error: template argument 2 is invalid
p1553.cpp:132:40: error: 'int* setbuf' redeclared as different kind of entity
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                        ^~~~~
In file included from /usr/local/include/c++/12.1.0/cstdio:42,
                 from /usr/local/include/c++/12.1.0/ext/string_conversions.h:43,
                 from /usr/local/include/c++/12.1.0/bits/basic_string.h:3960,
                 from /usr/local/include/c++/12.1.0/string:53,
                 from /usr/local/include/c++/12.1.0/bits/locale_classes.h:40,
                 from /usr/local/include/c++/12.1.0/bits/ios_base.h:41,
                 from /usr/local/include/c++/12.1.0/ios:42,
                 from /usr/local/include/c++/12.1.0/ostream:38,
                 from /usr/local/include/c++/12.1.0/iostream:39,
                 from N4910.h:2,
                 from p1553.cpp:10:
/usr/include/stdio.h:304:13: note: previous declaration 'void setbuf(FILE*, char*)'
  304 | extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW;
      |             ^~~~~~
p1553.cpp:132:40: error: 'charT' was not declared in this scope; did you mean 'char'?
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                        ^~~~~
      |                                        char
p1553.cpp:132:47: error: 's' was not declared in this scope
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                               ^
p1553.cpp:132:61: error: expected primary-expression before 'n'
  132 | basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n) override;
      |                                                             ^
p1553.cpp:134:1: error: expected unqualified-id before 'this'
  134 | this->span(std::span<charT>(s, n));
      | ^~~~
p1553.cpp:135:1: error: expected unqualified-id before 'return'
  135 | return this;
      | ^~~~~~
p1553.cpp:149:37: error: expected ')' before '<' token
  149 | explicit basic_ispanstream(std::span<charT> s,
      |                           ~         ^
      |                                     )
p1553.cpp:154:1: error: 'Effects' does not name a type
  154 | Effects: Initializes the base class with basic_istream<charT, traits>(addressof(sb)) and sb with basic_spanbuf<charT, traits>(s, which | ios_base::in)
      | ^~~~~~~
p1553.cpp:161:15: error: 'span' in namespace 'std' does not name a template type
  161 |          std::span<const charT> span() const noexcept;
      |               ^~~~
p1553.cpp:162:20: error: 'std::span' has not been declared
  162 |          void span(std::span<charT> s) noexcept;
      |                    ^~~
p1553.cpp:162:29: error: expected ',' or '...' before '<' token
  162 |          void span(std::span<charT> s) noexcept;
      |                             ^
p1553.cpp:171:1: error: 'spanbuf' does not name a type
  171 | spanbuf.
      | ^~~~~~~
p1553.cpp:174:19: error: template placeholder type 'basic_ispanstream<...auto...>' must be followed by a simple declarator-id
  174 | basic_ispanstream(basic_ispanstream&& rhs);
      |                   ^~~~~~~~~~~~~~~~~
p1553.cpp:140:11: note: 'template<class charT, class traits> class std::basic_ispanstream' declared here
  140 |     class basic_ispanstream
      |           ^~~~~~~~~~~~~~~~~
p1553.cpp:174:1: error: deduction guide for 'std::basic_ispanstream<charT, traits>' must have trailing return type
  174 | basic_ispanstream(basic_ispanstream&& rhs);
      | ^~~~~~~~~~~~~~~~~
p1553.cpp:140:11: note: 'template<class charT, class traits> class std::basic_ispanstream' declared here
  140 |     class basic_ispanstream
      |           ^~~~~~~~~~~~~~~~~
p1553.cpp:180:1: error: expected initializer before 'void'
  180 | void swap(basic_ispanstream& rhs);
      | ^~~~
p1553.cpp:182:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  182 | basic_istream<charT, traits>::swap(rhs);
      |               ^~~~~
      |               char
p1553.cpp:182:22: error: 'traits' was not declared in this scope
  182 | basic_istream<charT, traits>::swap(rhs);
      |                      ^~~~~~
p1553.cpp:182:28: error: template argument 1 is invalid
  182 | basic_istream<charT, traits>::swap(rhs);
      |                            ^
p1553.cpp:182:28: error: template argument 2 is invalid
p1553.cpp:182:39: error: 'int swap' redeclared as different kind of entity
  182 | basic_istream<charT, traits>::swap(rhs);
      |                                       ^
p1553.cpp:99:8: note: previous declaration 'template<class charT, class traits> void swap(std::basic_spanbuf<charT, traits>&, std::basic_spanbuf<charT, traits>&)'
   99 |   void swap(basic_spanbuf<charT, traits>& x, basic_spanbuf<charT, traits>& y);
      |        ^~~~
p1553.cpp:182:36: error: 'rhs' was not declared in this scope
  182 | basic_istream<charT, traits>::swap(rhs);
      |                                    ^~~
p1553.cpp:183:3: error: 'sb' does not name a type
  183 |   sb.swap(rhs.sb);
      |   ^~
p1553.cpp:188:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  188 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |               ^~~~~
      |               char
p1553.cpp:188:22: error: 'traits' was not declared in this scope
  188 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                      ^~~~~~
p1553.cpp:188:28: error: template argument 1 is invalid
  188 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                            ^
p1553.cpp:188:28: error: template argument 2 is invalid
p1553.cpp:188:45: error: non-member function 'int* rdbuf()' cannot have cv-qualifier
  188 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                                             ^~~~~~~~
p1553.cpp:190:1: error: expected unqualified-id before 'return'
  190 | return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
      | ^~~~~~
p1553.cpp:191:6: error: 'span' in namespace 'std' does not name a template type
  191 | std::span<const charT> span() const noexcept;
      |      ^~~~
p1553.cpp:193:1: error: expected unqualified-id before 'return'
  193 | return rdbuf()->span();
      | ^~~~~~
p1553.cpp:194:6: error: variable or field 'span' declared void
  194 | void span(std::span<charT> s) noexcept;
      |      ^~~~
p1553.cpp:194:16: error: 'span' is not a member of 'std'
  194 | void span(std::span<charT> s) noexcept;
      |                ^~~~
p1553.cpp:194:21: error: 'charT' was not declared in this scope; did you mean 'char'?
  194 | void span(std::span<charT> s) noexcept;
      |                     ^~~~~
      |                     char
p1553.cpp:194:28: error: 's' was not declared in this scope
  194 | void span(std::span<charT> s) noexcept;
      |                            ^
p1553.cpp:213:37: error: expected ')' before '<' token
  213 | explicit basic_ospanstream(std::span<charT> s,
      |                           ~         ^
      |                                     )
p1553.cpp:223:8: error: 'span' in namespace 'std' does not name a template type
  223 |   std::span<charT> span() const noexcept;
      |        ^~~~
p1553.cpp:224:13: error: 'std::span' has not been declared
  224 |   void span(std::span<charT> s) noexcept;
      |             ^~~
p1553.cpp:224:22: error: expected ',' or '...' before '<' token
  224 |   void span(std::span<charT> s) noexcept;
      |                      ^
p1553.cpp:227:10: error: declaration of template parameter 'charT' shadows template parameter
  227 | template<class charT, class traits>
      |          ^~~~~
p1553.cpp:203:14: note: template parameter 'charT' declared here
  203 |     template<class charT, class traits = char_traits<charT>>
      |              ^~~~~
p1553.cpp:227:23: error: declaration of template parameter 'traits' shadows template parameter
  227 | template<class charT, class traits>
      |                       ^~~~~
p1553.cpp:203:27: note: template parameter 'traits' declared here
  203 |     template<class charT, class traits = char_traits<charT>>
      |                           ^~~~~
p1553.cpp:232:37: error: expected ')' before '<' token
  232 | explicit basic_ospanstream(std::span<charT> s,
      |                           ~         ^
      |                                     )
p1553.cpp:234:19: error: template placeholder type 'basic_ospanstream<...auto...>' must be followed by a simple declarator-id
  234 | basic_ospanstream(basic_ospanstream&& rhs) noexcept;
      |                   ^~~~~~~~~~~~~~~~~
p1553.cpp:204:11: note: 'template<class charT, class traits> class std::basic_ospanstream' declared here
  204 |     class basic_ospanstream
      |           ^~~~~~~~~~~~~~~~~
p1553.cpp:234:1: error: deduction guide for 'std::basic_ospanstream<charT, traits>' must have trailing return type
  234 | basic_ospanstream(basic_ospanstream&& rhs) noexcept;
      | ^~~~~~~~~~~~~~~~~
p1553.cpp:204:11: note: 'template<class charT, class traits> class std::basic_ospanstream' declared here
  204 |     class basic_ospanstream
      |           ^~~~~~~~~~~~~~~~~
p1553.cpp:237:14: error: template placeholder type 'basic_ospanstream<...auto...>' must be followed by a simple declarator-id
  237 |    void swap(basic_ospanstream& rhs);
      |              ^~~~~~~~~~~~~~~~~
p1553.cpp:204:11: note: 'template<class charT, class traits> class std::basic_ospanstream' declared here
  204 |     class basic_ospanstream
      |           ^~~~~~~~~~~~~~~~~
p1553.cpp:239:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  239 | basic_ostream<charT, traits>::swap(rhs);
      |               ^~~~~
      |               char
p1553.cpp:239:22: error: 'traits' was not declared in this scope
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                      ^~~~~~
p1553.cpp:239:28: error: template argument 1 is invalid
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                            ^
p1553.cpp:239:28: error: template argument 2 is invalid
p1553.cpp:239:39: error: 'int swap' redeclared as different kind of entity
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                                       ^
p1553.cpp:185:8: note: previous declaration 'template<class charT, class traits> void swap(std::basic_ispanstream<charT, traits>&, std::basic_ispanstream<charT, traits>&)'
  185 |   void swap(basic_ispanstream<charT, traits>& x, basic_ispanstream<charT, traits>& y);
      |        ^~~~
p1553.cpp:239:36: error: 'rhs' was not declared in this scope
  239 | basic_ostream<charT, traits>::swap(rhs);
      |                                    ^~~
p1553.cpp:240:3: error: 'sb' does not name a type
  240 |   sb.swap(rhs.sb);
      |   ^~
p1553.cpp:245:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  245 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |               ^~~~~
      |               char
p1553.cpp:245:22: error: 'traits' was not declared in this scope
  245 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                      ^~~~~~
p1553.cpp:245:28: error: template argument 1 is invalid
  245 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                            ^
p1553.cpp:245:28: error: template argument 2 is invalid
p1553.cpp:245:45: error: non-member function 'int* rdbuf()' cannot have cv-qualifier
  245 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                                             ^~~~~~~~
p1553.cpp:247:1: error: expected unqualified-id before 'return'
  247 | return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
      | ^~~~~~
p1553.cpp:248:6: error: 'span' in namespace 'std' does not name a template type
  248 | std::span<charT> span() const noexcept;
      |      ^~~~
p1553.cpp:259:19: error: 'charT' does not name a type; did you mean 'char'?
  259 | using char_type = charT;
      |                   ^~~~~
      |                   char
p1553.cpp:260:27: error: 'traits' has not been declared
  260 | using int_type = typename traits::int_type;
      |                           ^~~~~~
p1553.cpp:261:27: error: 'traits' has not been declared
  261 | using pos_type = typename traits::pos_type;
      |                           ^~~~~~
p1553.cpp:262:27: error: 'traits' has not been declared
  262 | using off_type = typename traits::off_type;
      |                           ^~~~~~
p1553.cpp:263:21: error: 'traits' does not name a type
  263 | using traits_type = traits;
      |                     ^~~~~~
p1553.cpp:265:36: error: expected ')' before '<' token
  265 | explicit basic_spanstream(std::span<charT> s,
      |                          ~         ^
      |                                    )
p1553.cpp:267:20: error: class template placeholder 'std::basic_spanstream' not permitted in this context
  267 |   basic_spanstream(const basic_spanstream&) = delete;
      |                    ^~~~~
p1553.cpp:267:20: note: use 'auto' for an abbreviated function template
p1553.cpp:267:3: error: deduction guide for 'std::basic_spanstream<charT, traits>' must have trailing return type
  267 |   basic_spanstream(const basic_spanstream&) = delete;
      |   ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:268:20: error: template placeholder type 'basic_spanstream<...auto...>' must be followed by a simple declarator-id
  268 |   basic_spanstream(basic_spanstream&& rhs);
      |                    ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:268:3: error: deduction guide for 'std::basic_spanstream<charT, traits>' must have trailing return type
  268 |   basic_spanstream(basic_spanstream&& rhs);
      |   ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:269:31: error: class template placeholder 'std::basic_spanstream' not permitted in this context
  269 |   basic_spanstream& operator=(const basic_spanstream&) = delete;
      |                               ^~~~~
p1553.cpp:269:31: note: use 'auto' for an abbreviated function template
p1553.cpp:269:3: error: deduced class type 'basic_spanstream' in function return type
  269 |   basic_spanstream& operator=(const basic_spanstream&) = delete;
      |   ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:270:31: error: template placeholder type 'basic_spanstream<...auto...>' must be followed by a simple declarator-id
  270 |   basic_spanstream& operator=(basic_spanstream&& rhs);
      |                               ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:270:3: error: deduced class type 'basic_spanstream' in function return type
  270 |   basic_spanstream& operator=(basic_spanstream&& rhs);
      |   ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:272:11: error: template placeholder type 'basic_spanstream<...auto...>' must be followed by a simple declarator-id
  272 | void swap(basic_spanstream& rhs);
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:274:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  274 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |               ^~~~~
      |               char
p1553.cpp:274:22: error: 'traits' was not declared in this scope
  274 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                      ^~~~~~
p1553.cpp:274:28: error: template argument 1 is invalid
  274 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                            ^
p1553.cpp:274:28: error: template argument 2 is invalid
p1553.cpp:274:45: error: non-member function 'int* std::rdbuf()' cannot have cv-qualifier
  274 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                                             ^~~~~~~~
p1553.cpp:275:8: error: 'span' in namespace 'std' does not name a template type
  275 |   std::span<charT> span() const noexcept;
      |        ^~~~
p1553.cpp:276:8: error: variable or field 'span' declared void
  276 |   void span(std::span<charT> s) noexcept;
      |        ^~~~
p1553.cpp:276:18: error: 'span' is not a member of 'std'; did you mean 'span'?
  276 |   void span(std::span<charT> s) noexcept;
      |                  ^~~~
p1553.cpp:196:26: note: 'span' declared here
  196 | template<class ROS> void span(ROS&& s) noexcept;
      |                          ^~~~
p1553.cpp:276:23: error: 'charT' was not declared in this scope; did you mean 'char'?
  276 |   void span(std::span<charT> s) noexcept;
      |                       ^~~~~
      |                       char
p1553.cpp:276:30: error: 's' was not declared in this scope; did you mean 'ws'?
  276 |   void span(std::span<charT> s) noexcept;
      |                              ^
      |                              ws
p1553.cpp:277:1: error: expected unqualified-id before 'private'
  277 | private:
      | ^~~~~~~
p1553.cpp:282:36: error: expected ')' before '<' token
  282 | explicit basic_spanstream(std::span<charT> s,
      |                          ~         ^
      |                                    )
p1553.cpp:285:18: error: template placeholder type 'basic_spanstream<...auto...>' must be followed by a simple declarator-id
  285 | basic_spanstream(basic_spanstream&& rhs);
      |                  ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:285:1: error: deduction guide for 'std::basic_spanstream<charT, traits>' must have trailing return type
  285 | basic_spanstream(basic_spanstream&& rhs);
      | ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:288:11: error: template placeholder type 'basic_spanstream<...auto...>' must be followed by a simple declarator-id
  288 | void swap(basic_spanstream& rhs);
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:255:11: note: 'template<class charT, class traits> class std::basic_spanstream' declared here
  255 |     class basic_spanstream
      |           ^~~~~~~~~~~~~~~~
p1553.cpp:290:16: error: 'charT' was not declared in this scope; did you mean 'char'?
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                ^~~~~
      |                char
p1553.cpp:290:23: error: 'traits' was not declared in this scope
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                       ^~~~~~
p1553.cpp:290:29: error: template argument 1 is invalid
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                             ^
p1553.cpp:290:29: error: template argument 2 is invalid
p1553.cpp:290:40: error: 'int std::swap' redeclared as different kind of entity
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                                        ^
In file included from /usr/local/include/c++/12.1.0/vector:65,
                 from N4910.h:8:
/usr/local/include/c++/12.1.0/bits/stl_bvector.h:132:5: note: previous declaration 'constexpr void std::swap(_Bit_reference, _Bit_reference)'
  132 |     swap(_Bit_reference __x, _Bit_reference __y) noexcept
      |     ^~~~
p1553.cpp:290:37: error: 'rhs' was not declared in this scope
  290 | basic_iostream<charT, traits>::swap(rhs);
      |                                     ^~~
p1553.cpp:291:3: error: 'sb' does not name a type
  291 |   sb.swap(rhs.sb);
      |   ^~
p1553.cpp:296:15: error: 'charT' was not declared in this scope; did you mean 'char'?
  296 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |               ^~~~~
      |               char
p1553.cpp:296:22: error: 'traits' was not declared in this scope
  296 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                      ^~~~~~
p1553.cpp:296:28: error: template argument 1 is invalid
  296 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                            ^
p1553.cpp:296:28: error: template argument 2 is invalid
p1553.cpp:296:45: error: non-member function 'int* std::rdbuf()' cannot have cv-qualifier
  296 | basic_spanbuf<charT, traits>* rdbuf() const noexcept;
      |                                             ^~~~~~~~
p1553.cpp:298:1: error: expected unqualified-id before 'return'
  298 | return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
      | ^~~~~~
p1553.cpp:299:6: error: 'span' in namespace 'std' does not name a template type
  299 | std::span<charT> span() const noexcept;
      |      ^~~~

```

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

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

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

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

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





## 自己参考資料(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

<この項は書きかけです。順次追記します。>
This article is not completed. I will add some words and/or centences in order.
Este artículo no está completo. Agregaré algunas palabras en orden.

## 知人資料
' @kazuo_reve 私が効果を確認した「小川メソッド」
https://qiita.com/kazuo_reve/items/a3ea1d9171deeccc04da

' @kazuo_reve 新人の方によく展開している有益な情報
https://qiita.com/kazuo_reve/items/d1a3f0ee48e24bba38f1

' @kazuo_reve Vモデルについて勘違いしていたと思ったこと
https://qiita.com/kazuo_reve/items/46fddb094563bd9b2e1e

## 自己記事一覧
Qiitaで逆リンクを表示しなくなったような気がする。時々、スマフォで表示するとあらわっることがあり、完全に削除したのではなさそう。

４月以降、せっせとリンクリストを作り、統計を取って確率を説明しようとしている。
2025年２月末を目標にしている。

一覧の一覧( The directory of directories of mine.) Qiita(100)
https://qiita.com/kaizen_nagoya/items/7eb0e006543886138f39

仮説（0）一覧（目標100現在40）
https://qiita.com/kaizen_nagoya/items/f000506fe1837b3590df

Qiita(0)Qiita関連記事一覧（自分）
https://qiita.com/kaizen_nagoya/items/58db5fbf036b28e9dfa6

Error一覧 error(0)
https://qiita.com/kaizen_nagoya/items/48b6cbc8d68eae2c42b8

C++ Support(0)　
https://qiita.com/kaizen_nagoya/items/8720d26f762369a80514

Coding(0) Rules, C, Secure, MISRA and so on
https://qiita.com/kaizen_nagoya/items/400725644a8a0e90fbb0

Ethernet 記事一覧　Ethernet(0)
https://qiita.com/kaizen_nagoya/items/88d35e99f74aefc98794

Wireshark 一覧 wireshark(0)、Ethernet(48) 
https://qiita.com/kaizen_nagoya/items/fbed841f61875c4731d0

線網（Wi-Fi）空中線(antenna)(0) 記事一覧(118/300目標)
https://qiita.com/kaizen_nagoya/items/5e5464ac2b24bd4cd001

なぜdockerで機械学習するか 書籍・ソース一覧作成中 (目標100)
https://qiita.com/kaizen_nagoya/items/ddd12477544bf5ba85e2

プログラムちょい替え（0）一覧:4件
https://qiita.com/kaizen_nagoya/items/296d87ef4bfd516bc394

言語処理100本ノックをdockerで。python覚えるのに最適。:10+12
https://qiita.com/kaizen_nagoya/items/7e7eb7c543e0c18438c4

Python(0)記事をまとめたい。
https://qiita.com/kaizen_nagoya/items/088c57d70ab6904ebb53

安全（0）安全工学シンポジウムに向けて: 21
https://qiita.com/kaizen_nagoya/items/c5d78f3def8195cb2409

プログラマによる、プログラマのための、統計(0)と確率のプログラミングとその後
https://qiita.com/kaizen_nagoya/items/6e9897eb641268766909

転職(0)一覧
https://qiita.com/kaizen_nagoya/items/f77520d378d33451d6fe

技術士(0)一覧
https://qiita.com/kaizen_nagoya/items/ce4ccf4eb9c5600b89ea

Reserchmap(0) 一覧
https://qiita.com/kaizen_nagoya/items/506c79e562f406c4257e

物理記事　上位100
https://qiita.com/kaizen_nagoya/items/66e90fe31fbe3facc6ff

量子(0) 計算機, 量子力学 
https://qiita.com/kaizen_nagoya/items/1cd954cb0eed92879fd4

数学関連記事１００
https://qiita.com/kaizen_nagoya/items/d8dadb49a6397e854c6d

coq(0) 一覧
https://qiita.com/kaizen_nagoya/items/d22f9995cf2173bc3b13

統計(0)一覧
https://qiita.com/kaizen_nagoya/items/80d3b221807e53e88aba

図(0) state, sequence and timing. UML and お絵描き 
https://qiita.com/kaizen_nagoya/items/60440a882146aeee9e8f

色(0) 記事100書く切り口 
https://qiita.com/kaizen_nagoya/items/22331c0335ed34326b9b

品質一覧 
https://qiita.com/kaizen_nagoya/items/2b99b8e9db6d94b2e971

言語・文学記事　１００
https://qiita.com/kaizen_nagoya/items/42d58d5ef7fb53c407d6

医工連携関連記事一覧
https://qiita.com/kaizen_nagoya/items/6ab51c12ba51bc260a82

水の資料集(0)　方針と成果
https://qiita.com/kaizen_nagoya/items/f5dbb30087ea732b52aa

自動車　記事　１００
https://qiita.com/kaizen_nagoya/items/f7f0b9ab36569ad409c5

通信記事１００
https://qiita.com/kaizen_nagoya/items/1d67de5e1cd207b05ef7

日本語（０）一欄
https://qiita.com/kaizen_nagoya/items/7498dcfa3a9ba7fd1e68

英語(0) 一覧
https://qiita.com/kaizen_nagoya/items/680e3f5cbf9430486c7d

音楽　一覧(0) 
https://qiita.com/kaizen_nagoya/items/b6e5f42bbfe3bbe40f5d

「@kazuo_reve 新人の方によく展開している有益な情報」確認一覧 
https://qiita.com/kaizen_nagoya/items/b9380888d1e5a042646b

鉄道（０）鉄道のシステム考察はてっちゃんがてつだってくれる
https://qiita.com/kaizen_nagoya/items/faa4ea03d91d901a618a

OSEK OS設計の基礎　OSEK(100)
https://qiita.com/kaizen_nagoya/items/7528a22a14242d2d58a3

coding (101) 一覧を作成し始めた。omake:最近のQiitaで表示しない5つの事象
https://qiita.com/kaizen_nagoya/items/20667f09f19598aedb68

官公庁・学校・公的団体（NPOを含む）システムの課題、官（０）
https://qiita.com/kaizen_nagoya/items/04ee6eaf7ec13d3af4c3

「はじめての」シリーズ　 ベクタージャパン　
https://qiita.com/kaizen_nagoya/items/2e41634f6e21a3cf74eb

AUTOSAR(0)Qiita記事一覧, OSEK(75)
https://qiita.com/kaizen_nagoya/items/89c07961b59a8754c869

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

LaTeX(0) 一覧　
https://qiita.com/kaizen_nagoya/items/e3f7dafacab58c499792

自動制御、制御工学一覧（０）
https://qiita.com/kaizen_nagoya/items/7767a4e19a6ae1479e6b

Rust(0) 一覧　
https://qiita.com/kaizen_nagoya/items/5e8bb080ba6ca0281927

programの本質は計画だ。programは設計だ。
https://qiita.com/kaizen_nagoya/items/c8545a769c246a458c27

登壇直後版 色使い(JIS安全色) Qiita Engineer Festa 2023〜私しか得しないニッチな技術でLT〜 スライド編 0.15
https://qiita.com/kaizen_nagoya/items/f0d3070d839f4f735b2b

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

逆も真：社会人が最初に確かめるとよいこと。OSEK(69)、Ethernet(59)
https://qiita.com/kaizen_nagoya/items/39afe4a728a31b903ddc

統計の嘘。仮説（127）
https://qiita.com/kaizen_nagoya/items/63b48ecf258a3471c51b

自分の言葉だけで論理展開できるのが天才なら、文章の引用だけで論理展開できるのが秀才だ。仮説（136）
https://qiita.com/kaizen_nagoya/items/97cf07b9e24f860624dd

参考文献駆動執筆(references driven writing)・デンソークリエイト編
https://qiita.com/kaizen_nagoya/items/b27b3f58b8bf265a5cd1

「何を」よりも「誰を」。１０年後のために今見習いたい人たち
https://qiita.com/kaizen_nagoya/items/8045978b16eb49d572b2

Qiitaの記事に３段階または５段階で到達するための方法
https://qiita.com/kaizen_nagoya/items/6e9298296852325adc5e

出力(output)と呼ばないで。これは状態(state)です。
https://qiita.com/kaizen_nagoya/items/80b8b5913b2748867840

祝休日・謹賀新年 2025年の目標
https://qiita.com/kaizen_nagoya/items/dfa34827932f99c59bbc

Qiita 1年間をまとめた「振り返りページ」＠2024
https://qiita.com/kaizen_nagoya/items/ed6be239119c99b15828

2024 参加・主催Calendarと投稿記事一覧 Qiita(248)
https://qiita.com/kaizen_nagoya/items/d80b8fbac2496df7827f

主催Calendar2024分析 Qiita(254)
https://qiita.com/kaizen_nagoya/items/15807336d583076f70bc

Calendar 統計
https://qiita.com/kaizen_nagoya/items/e315558dcea8ee3fe43e

LLM 関連 Calendar 2024 
https://qiita.com/kaizen_nagoya/items/c36033cf66862d5496fa

Large Language Model Related Calendar 
https://qiita.com/kaizen_nagoya/items/3beb0bc3fb71e3ae6d66

博士論文 Calendar 2024 を開催します。 
https://qiita.com/kaizen_nagoya/items/51601357efbcaf1057d0

博士論文(0)関連記事一覧
https://qiita.com/kaizen_nagoya/items/8f223a760e607b705e78

coding (101) 一覧を作成し始めた。omake:最近のQiitaで表示しない5つの事象
https://qiita.com/kaizen_nagoya/items/20667f09f19598aedb68

あなたは「勘違いまとめ」から、勘違いだと言っていることが勘違いだといくつ見つけられますか。人間の間違い(human error(125))の種類と対策
https://qiita.com/kaizen_nagoya/items/ae391b77fffb098b8fb4

プログラマの「プログラムが書ける」思い込みは強みだ。３つの理由。仮説（168）統計と確率(17) , OSEK(79)
https://qiita.com/kaizen_nagoya/items/bc5dd86e414de402ec29

出力(output)と呼ばないで。これは状態(state)です。
https://qiita.com/kaizen_nagoya/items/80b8b5913b2748867840

これからの情報伝達手段の在り方について考えてみよう。炎上と便乗。
https://qiita.com/kaizen_nagoya/items/71a09077ac195214f0db

ISO/IEC JTC1 SC7 Software and System Engineering
https://qiita.com/kaizen_nagoya/items/48b43f0f6976a078d907

アクセシビリティの知見を発信しよう！（再び）
https://qiita.com/kaizen_nagoya/items/03457eb9ee74105ee618

統計論及確率論輪講（再び）
https://qiita.com/kaizen_nagoya/items/590874ccfca988e85ea3

読者の心をグッと惹き寄せる7つの魔法
https://qiita.com/kaizen_nagoya/items/b1b5e89bd5c0a211d862

「@kazuo_reve 新人の方によく展開している有益な情報」確認一覧
https://qiita.com/kaizen_nagoya/items/b9380888d1e5a042646b

ソースコードで議論しよう。日本語で議論するの止めましょう（あるプログラミング技術の議論報告）
https://qiita.com/kaizen_nagoya/items/8b9811c80f3338c6c0b0

脳内コンパイラの3つの危険
https://qiita.com/kaizen_nagoya/items/7025cf2d7bd9f276e382

心理学の本を読むよりはコンパイラ書いた方がよくね。仮説（34）
https://qiita.com/kaizen_nagoya/items/fa715732cc148e48880e

NASAを超えるつもりがあれば読んでください。
https://qiita.com/kaizen_nagoya/items/e81669f9cb53109157f6

データサイエンティストの気づき!「勉強して仕事に役立てない人。大嫌い!!」『それ自分かも?』ってなった!!! 
https://qiita.com/kaizen_nagoya/items/d85830d58d8dd7f71d07

「ぼくの好きな先生」「人がやらないことをやれ」プログラマになるまで。仮説（37）　
https://qiita.com/kaizen_nagoya/items/53e4bded9fe5f724b3c4

なぜ経済学徒を辞め、計算機屋になったか（経済学部入学前・入学後・卒業後対応） 転職(1)  
https://qiita.com/kaizen_nagoya/items/06335a1d24c099733f64    

プログラミング言語教育のXYZ。 仮説（52） 
https://qiita.com/kaizen_nagoya/items/1950c5810fb5c0b07be4

【24卒向け】9ヶ月後に年収１０００万円を目指す。二つの関門と三つの道。
https://qiita.com/kaizen_nagoya/items/fb5bff147193f726ad25

「【25卒向け】Qiita Career Meetup for STUDENT」予習の勧め
https://qiita.com/kaizen_nagoya/items/00eadb8a6e738cb6336f

大学入試不合格でも筆記試験のない大学に入って卒業できる。卒業しなくても博士になれる。
https://qiita.com/kaizen_nagoya/items/74adec99f396d64b5fd5

全世界の不登校の子供たち「博士論文」を書こう。世界子供博士論文遠隔実践中心 安全(99)
https://qiita.com/kaizen_nagoya/items/912d69032c012bcc84f2

日本のプログラマが世界で戦える16分野。仮説(53),統計と確率(25) 転職(32)、Ethernet(58)
https://qiita.com/kaizen_nagoya/items/a7e634a996cdd02bc53b

小川メソッド　覚え（書きかけ）
https://qiita.com/kaizen_nagoya/items/3593d72eca551742df68

DoCAP（ドゥーキャップ）って何ですか？
https://qiita.com/kaizen_nagoya/items/47e0e6509ab792c43327

views 20,000越え自己記事一覧
https://qiita.com/kaizen_nagoya/items/58e8bd6450957cdecd81

Views１万越え、もうすぐ１万記事一覧 最近いいねをいただいた213記事
https://qiita.com/kaizen_nagoya/items/d2b805717a92459ce853

amazon 殿堂入りNo1レビュアになるまで。仮説(102)
https://qiita.com/kaizen_nagoya/items/83259d18921ce75a91f4

100以上いいねをいただいた記事16選
https://qiita.com/kaizen_nagoya/items/f8d958d9084ffbd15d2a

水道局10年(1976,4-1986,3)を振り返る
https://qiita.com/kaizen_nagoya/items/707fcf6fae230dd349bf

小川清最終講義、最終講義（再）計画, Ethernet(100) 英語(100) 安全(100)
https://qiita.com/kaizen_nagoya/items/e2df642e3951e35e6a53

＜この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。＞
This article is an individual impression based on my individual experience. It has nothing to do with the organization or business to which I currently belong.
Este artículo es una impresión personal basada en mi experiencia personal. No tiene nada que ver con la organización o empresa a la que pertenezco actualmente.
### 文書履歴(document history)
ver. 0.01 初稿 　20220827
### 最後までおよみいただきありがとうございました。
いいね　💚、フォローをお願いします。
#### Thank you very much for reading to the last sentence.
Please press the like icon 💚　and follow me for your happy life.
#### Muchas gracias por leer hasta la última oración.
Por favor, haz clic en el ícono Me gusta 💚 y sígueme para tener una vida feliz.