std::basic_stringbuf<CharT,Traits,Allocator>::basic_stringbuf

来自cppreference.com
 
 
 
 
(1)
explicit basic_stringbuf( std::ios_base::openmode which =
                              std::ios_base::in | std::ios_base::out );
(C++11 前)
explicit basic_stringbuf( std::ios_base::openmode which );
(C++11 起)
basic_stringbuf()
    : basic_stringbuf( std::ios_base::in | std::ios_base::out ) {}
(2) (C++11 起)
explicit
    basic_stringbuf( const std::basic_string<CharT, Traits, Allocator>& s,
                     std::ios_base::openmode which =
                         std::ios_base::in | std::ios_base::out );
(3)
explicit basic_stringbuf( std::basic_string<CharT, Traits, Allocator>&& s,
                          std::ios_base::openmode which =
                              std::ios_base::in | std::ios_base::out );
(4) (C++20 起)
basic_stringbuf( std::ios_base::openmode which, const Allocator& a );
(5) (C++20 起)
explicit basic_stringbuf( const Allocator& a )
    : basic_stringbuf( std::ios_base::in | std::ios_base::out, a ) {}
(6) (C++20 起)
template< class SAlloc >
explicit basic_stringbuf( const std::basic_string<CharT, Traits, SAlloc>& s,
                          std::ios_base::openmode which =
                              std::ios_base::in | std::ios_base::out );
(7) (C++20 起)
template< class SAlloc >
basic_stringbuf( const std::basic_string<CharT, Traits, SAlloc>& s,
                 std::ios_base::openmode which, const Allocator& a );
(8) (C++20 起)
template< class SAlloc >
basic_stringbuf( const std::basic_string<CharT, Traits, SAlloc>& s,
                 const Allocator& a )
    : basic_stringbuf( s, std::ios_base::in | std::ios_base::out, a ) {}
(9) (C++20 起)
template< class StringViewLike >
explicit basic_stringbuf( const StringViewLike& t,
                          std::ios_base::openmode which =
                              std::ios_base::in | std::ios_base::out );
(10) (C++26 起)
template< class StringViewLike >
basic_stringbuf( const StringViewLike& t,
                 std::ios_base::openmode which, const Allocator& a );
(11) (C++26 起)
template< class StringViewLike >
basic_stringbuf( const StringViewLike& t, const Allocator& a );
(12) (C++26 起)
basic_stringbuf( basic_stringbuf&& rhs );
(13) (C++11 起)
basic_stringbuf( basic_stringbuf&& rhs, const Allocator& a );
(14) (C++20 起)
basic_stringbuf( const basic_stringbuf& rhs ) = delete;
(15) (C++11 起)

std::basic_streambuf 基以及仅用于阐述的数据成员 bufmode 会按以下方式初始化。

在初始化这些子对象后,重载 (3-12) 如同以调用 init_buf_ptrs() 来初始化输入和输出序列。

 重载   std::basic_streambuf 基  buf mode
(1) 默认初始化 由实现定义
(见下文)
which
(2)  std::ios_base::in |