std::basic_...:pubseekpos,(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ NAME ✨

okay so this is the C++ Standard Libary manual's std::basic_...:pubseekpos,(3) page β€” yes, the header spells it Libary, not me 😭 β€” and the actual NAME line is:

  • std::basic_streambuf::pubseekpos, β€” std::basic_streambuf::pubseekpos, (commas included, bestie, because that's what the page says).

🌸 Synopsis 🌸

the signature is giving "line wraps went to therapy" but every token is here, no cap:

          pos_type pubseekpos( pos_type pos,
                               std::ios_base::openmode which =
       std::ios_base::in |        (1)
          std::ios_base::out );
          protected:

          virtual pos_type seekpos( pos_type pos,
       (2)

                                    std::ios_base::openmode which =
       std::ios_base::in |
          std::ios_base::out );

It sets the position indicator of the input and/or output sequence to an absolute position. Lowkey the whole plot:

  1. Calls seekpos(pos, which) of the most derived class.
  2. The base class version of this function has no effect. The derived classes may override this function to allow absolute positioning of the position indicator.

πŸŽ€ Parameters πŸŽ€

  • pos β€” absolute position to set the position indicator to
  • which β€” defines which of the input and/or output sequences to affect. It can be one or a combination of the following constants:
    • in β€” affect the input sequence
    • out β€” affect the output sequence

πŸ’– Return value πŸ’–

  1. The return value of seekpos(pos, which).
  2. The resulting absolute position as defined by the position indicator. The base class version returns pos_type(off_type(-1)).

πŸ¦‹ Example πŸ¦‹

okay so the Example section is literally telling on itself:

This section is incomplete Reason: no example

🌈 Defect reports 🌈

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

  • DR: LWG 55
    • Applied to: C++98
    • Behavior as published: the base class version of seekpos returned an undefined invalid stream position.
    • Correct behavior: returns pos_type(off_type(-1)).

⭐ See also ⭐

  • pubseekoff β€” invokes seekoff() (public member function)
  • seekpos [virtual] β€” repositions the file position, using absolute addressing (virtual protected member function of std::basic_filebuf<CharT,Traits>)
  • seekpos [virtual] β€” repositions the next pointer in the input sequence, output sequence, or both using absolute addressing (virtual protected member function of std::basic_stringbuf<CharT,Traits,Allocator>)
  • seekpos [virtual] β€” repositions the next pointer in the input sequence, output sequence, or both using absolute addressing (virtual protected member function of std::strstreambuf)

πŸ’… Category πŸ’…

  • Category: Todo no example

source/version: http://cppreference.com Β· date: 2024.06.10 Β· footer title: std::basic_...:pubseekpos,(3) β€” bye bestie, go set an absolute position and slay πŸ’…βœ¨

πŸ“¦ where this page comes from