Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_spanbuf<CharT,Traits>::basic_spanbuf

      From cppreference.com
      <cpp‎ |io‎ |basic spanbuf
       
       
       
      std::basic_spanbuf
      Public member functions
      basic_spanbuf::basic_spanbuf
      (C++23)
      Protected member functions
      Non-member functions
       
      basic_spanbuf(): basic_spanbuf(std::ios_base::in|std::ios_base::out){}
      (1)(since C++23)
      explicit basic_spanbuf(std::ios_base::openmode which)
         : basic_spanbuf(std::span<CharT>{}, which){}
      (2)(since C++23)
      explicit basic_spanbuf(std::span<CharT> buf,std::ios_base::openmode which=
                                 std::ios_base::in|std::ios_base::out);
      (3)(since C++23)
      basic_spanbuf(const basic_spanbuf&)= delete;
      (4)(since C++23)
      basic_spanbuf( basic_spanbuf&& rhs);
      (5)(since C++23)
      1) Default constructor. Creates abasic_spanbuf that has no underlying buffer and is opened for both input and output. The pointers to get and put area are set to the null pointer value.
      2) Same as(1), except that thebasic_spanbuf is opened in mode specified bywhich.
      3) Creates abasic_spanbuf that manages the underlying buffer referenced bybuf (or has no underlying buffer ifbuf is empty) and is opened in mode specified bywhich. The pointers to get and put area are set as following, or to the null pointer value if not mentioned in the table:
      Set bits in open mode
      (affecting pointers to get area)
      Return value after setting
      eback()gptr()egptr()
      std::ios_base::ins.data()s.data()s.data()+ s.size()
      Set bits in open mode
      (affecting pointers to put area)
      Return value after setting
      pbase()pptr()epptr()
      std::ios_base::out&&!std::ios_base::ates.data()s.data()s.data()+ s.size()
      std::ios_base::out&&std::ios_base::ates.data()s.data()+ s.size()s.data()+ s.size()
      4) Copy constructor is deleted.basic_spanbuf is not copyable.
      5) Move constructor. Move-constructs thestd::basic_streambuf base subobject from that ofrhs. The pointers to get and put area, the open mode, and the underlying buffer (if any) are identical to those inrhs before construction.
      It is implementation-defined whetherrhs still holds the underlying buffer after the move-construction.

      Contents

      [edit]Parameters

      buf - astd::span referencing the underlying buffer
      rhs - anotherbasic_spanbuf
      which - specifies stream open mode. It is bitmask type, the following constants are defined:
      Constant Explanation
      app seek to the end of stream before each write
      binary open inbinary mode
      in open for reading
      out open for writing
      trunc discard the contents of the stream when opening
      ate seek to the end of stream immediately after open
      noreplace(C++23) open in exclusive mode

      [edit]Notes

      These constructors are typically called by the constructors ofstd::basic_ispanstream,std::basic_ospanstream, andstd::basic_spanstream.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      constructs thebasic_ispanstream
      (public member function ofstd::basic_ispanstream<CharT,Traits>)[edit]
      constructs thebasic_ospanstream
      (public member function ofstd::basic_ospanstream<CharT,Traits>)[edit]
      constructs thebasic_spanstream
      (public member function ofstd::basic_spanstream<CharT,Traits>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_spanbuf/basic_spanbuf&oldid=160639"

      [8]ページ先頭

      ©2009-2025 Movatter.jp