Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

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

      From cppreference.com
      <cpp‎ |io‎ |basic stringbuf
       
       
       
       
      void init_buf_ptrs();
      (exposition only*)

      Initializes the input and output sequences frombuf according tomode.buf andmode areexposition-only data members of*this.

      Immediately after this function returns:

      • Ifstd::ios_base::out is set inmode,pbase() points tobuf.front() andepptr()>= pbase()+ buf.size() istrue;
        • in addition, ifstd::ios_base::ate is set inmode,pptr()== pbase()+ buf.size() istrue,
        • otherwisepptr()== pbase() istrue.
      • Ifstd::ios_base::in is set inmode,eback() points tobuf.front(), andgptr()== eback()&& egptr()== eback()+ buf.size() istrue.

      [edit]Notes

      For efficiency reasons, stream buffer operations can violate invariants ofbuf while it is held encapsulated in thestd::basic_stringbuf, e.g., by writing to characters in the range[buf.data()+ buf.size()buf.data()+ buf.capacity()).

      All operations retrieving astd::basic_string frombuf ensure that thestd::basic_string invariants hold on the returned value.

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 1448C++98callinginit_buf_ptrs() made
      pptr()== pbase()+ buf.data()
      for streams that are both input and output streams
      makes
      pptr()== pbase()+ buf.size()
      for append streams
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_stringbuf/init_buf_ptrs&oldid=158134"

      [8]ページ先頭

      ©2009-2025 Movatter.jp