Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

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

      From cppreference.com
      <cpp‎ |io‎ |basic syncbuf
       
       
       
      std::basic_syncbuf
      Public member functions
      basic_syncbuf::basic_syncbuf
      (C++20)
      Protected member functions
      Non-member functions
       
      basic_syncbuf()
         : basic_syncbuf( nullptr)
      (1)
      explicit basic_syncbuf( streambuf_type* obuf)
         : basic_syncbuf( obuf, Allocator()){}
      (2)
      basic_syncbuf( streambuf_type* obuf,const Allocator& a);
      (3)
      basic_syncbuf( basic_syncbuf&& rhs);
      (4)
      1) Default constructor: creates an instance ofstd::basic_syncbuf with emit-on-sync policy set tofalse, wrapped streambuffer set tonullptr, and using default-constructedAllocator as the allocator for temporary storage.
      2,3) Creates an instance ofstd::basic_syncbuf with emit-on-sync policy set tofalse, wrapped streambuffer set toobuf, and usinga as the allocator for temporary storage.
      4) Move constructor: move-constructs astd::basic_syncbuf object by moving all contents from anotherstd::basic_syncbuf objectrhs, including the temporary storage, the wrapped stream pointer, policy, and all other state (such as the mutex pointer). After move,rhs is not associated with a stream, andrhs.get_wrapped()== nullptr. The put area member pointers of the base classstd::basic_streambuf ofrhs are guaranteed to be null. Destroying a moved-fromrhs will not produce any output.

      Contents

      [edit]Parameters

      obuf - pointer to thestd::basic_streambuf to wrap
      a - the allocator to use for temporary storage
      rhs - anotherstd::basic_syncbuf to move from

      [edit]Exceptions

      2,3) May throwstd::bad_alloc from the constructor of the internal temporary storage orstd::system_error from the mutex construction.

      [edit]Notes

      Typically called by the appropriate constructors ofstd::basic_osyncstream.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      [virtual]
      synchronizes the buffers with the associated character sequence
      (virtual protected member function ofstd::basic_streambuf<CharT,Traits>)[edit]
      atomically transmits the entire internal buffer to the wrapped streambuf
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_syncbuf/basic_syncbuf&oldid=144217"

      [8]ページ先頭

      ©2009-2025 Movatter.jp