Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_iostream<CharT,Traits>::basic_iostream

      From cppreference.com
      <cpp‎ |io‎ |basic iostream
       
       
       
      std::basic_iostream
      Member functions
      basic_iostream::basic_iostream
      Protected member functions
       
      explicit basic_iostream(std::basic_streambuf<CharT,Traits>* sb);
      (1)
      basic_iostream(const basic_iostream& other)= delete;
      (2)(since C++11)
      protected:
      basic_iostream( basic_iostream&& other);
      (3)(since C++11)

      Constructs new stream object.

      1) Initializes with streambufsb. The base classes are initialized asbasic_istream<CharT,Traits>(sb) andbasic_ostream<CharT,Traits>(sb). After the callrdbuf()== sb andgcount()==0.
      2) Copy construction is not allowed.
      3) Move constructor: move-constructs the first base classbasic_istream asbasic_istream<CharT,Traits>(std::move(rhs));, which in turn move-constructs and initializes the virtual basestd::basic_ios. The initialization of the other base,basic_ostream, is implementation-defined (e.g., a protected default constructor may be added tostd::basic_ostream, which does nothing) because move-construction cannot userhs twice. This move constructor is protected: it is called by the move constructors of the derived stream classesstd::basic_fstream andstd::basic_stringstream before they move-construct and associate the stream buffer.

      [edit]Parameters

      sb - streambuf to initialize with
      other - another stream to initialize with

      [edit]See also

      (C++11)
      move-assigns anotherbasic_iostream
      (protected member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_iostream/basic_iostream&oldid=160636"

      [8]ページ先頭

      ©2009-2025 Movatter.jp