STD::BASIC_STRINGSTREAM(3)

πŸ’– std::basic_stringstream< _CharT, _Traits, _Alloc > πŸ’–

okay bestie, real talk β€” this page lives in the Library Functions Manual (section 3, the C++ library shelf), and the main character today is std::basic_stringstream< _CharT, _Traits, _Alloc >. yes, the whole name. she's long, she's iconic, she contains multitudes. πŸŽ€


✨ NAME ✨

std::basic_stringstream< _CharT, _Traits, _Alloc > β€” controlling input and output for std::string. that's it, that's the whole job description, and she ate. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <sstream>

Inherits std::basic_iostream< _CharT, _Traits >. so yeah, she's a whole iostream girlie, with a string buffer underneath. no cap. ✨


🌸 Public Types 🌸

here's the whole entourage, all the typedefs she brings to the function:

  • typedef ctype< _CharT > __ctype_type
  • typedef ctype< _CharT > __ctype_type β€” yes bestie, she's listed twice. the original said it twice, so we say it twice. iconic of her honestly πŸ’€
  • typedef basic_ios< _CharT, _Traits > __ios_type
  • typedef basic_ios< _CharT, _Traits > __ios_type β€” also doubled. she's just like that. 🫢
  • typedef basic_iostream< char_type, traits_type > __iostream_type
  • typedef basic_istream< _CharT, _Traits > __istream_type
  • typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
  • typedef basic_ostream< _CharT, _Traits > __ostream_type
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type
  • typedef basic_streambuf< _CharT, _Traits > __streambuf_type β€” twice again. we love a consistent queen. πŸ‘‘
  • typedef basic_string< _CharT, _Traits, _Alloc > __string_type
  • typedef basic_stringbuf< _CharT, _Traits, _Alloc > __stringbuf_type
  • typedef _Alloc allocator_type
  • typedef _CharT char_type
  • enum event { erase_event, imbue_event, copyfmt_event } β€” the set of events that may be passed to an event callback. little event girlies, all dressed up for the callback party πŸŽ‰
  • typedef void(* event_callback) (event __e, ios_base &__b, int __i) β€” the type of an event callback function. that's the shape of the function you hand over. πŸ’Œ
  • typedef _Ios_Fmtflags fmtflags β€” heads up: this is a bitmask type. so it's flags-you-can-mash-together, not just one lonely flag. πŸ”₯
  • typedef traits_type::int_type int_type
  • typedef _Ios_Iostate iostate β€” also a bitmask type, bestie. flags again. ✨
  • typedef traits_type::off_type off_type
  • typedef _Ios_Openmode openmode β€” yep, bitmask type. she's a flags girl through and through. πŸ’…
  • typedef traits_type::pos_type pos_type
  • typedef _Ios_Seekdir seekdir β€” this one's an enumerated type, not a bitmask. different energy entirely. 🌈
  • typedef _Traits traits_type

πŸ’… Public Member Functions πŸ’…

okay this is the big one, the whole roster, and she has range:

  • basic_stringstream () β€” the default constructor. starts you off with an empty string buffer, a blank canvas, main character energy from day one. πŸŽ€
  • basic_stringstream (__string_type &&__str, ios_base::openmode __mode=ios_base::in|ios_base::out)
  • basic_stringstream (basic_stringstream &&__rhs)
  • basic_stringstream (const __string_type &__str, ios_base::openmode __m=ios_base::out|ios_base::in) β€” starts with an existing string buffer. you come with baggage, and she welcomes it. πŸ’–
  • template<typename _SAlloc> basic_stringstream (const basic_string< _CharT, _Traits, _SAlloc > &__str, const allocator_type &__a)
  • template<typename _SAlloc> basic_stringstream (const basic_string< _CharT, _Traits, _SAlloc > &__str, ios_base::openmode __mode, const allocator_type &__a)
  • template<typename _SAlloc> basic_stringstream (const basic_string< _CharT, _Traits, _SAlloc > &__str, ios_base::openmode __mode=ios_base::in|ios_base::out)
  • basic_stringstream (const basic_stringstream &)=delete β€” nope, copy constructor is deleted. she does not do copies. πŸ™ˆ
  • basic_stringstream (ios_base::openmode __m) β€” starts with an empty string buffer. again, blank canvas. πŸ¦‹
  • basic_stringstream (ios_base::openmode __mode, const allocator_type &__a)
  • ~basic_stringstream () β€” the destructor does nothing. literally nothing. she leaves without drama. 😌
  • template<typename _ValueT> basic_istream< _CharT, _Traits > & _M_extract (_ValueT &__v)
  • const locale & _M_getloc () const β€” locale access.
  • template<typename _ValueT> basic_ostream< _CharT, _Traits > & _M_insert (_ValueT __v)
  • void _M_setstate (iostate __state)
  • bool bad () const β€” fast error checking.
  • void clear (iostate __state=goodbit) β€” [re]sets the error state. bracket-and-all, that's how the original says it. πŸ’…
  • basic_ios & copyfmt (const basic_ios &__rhs) β€” copies fields of __rhs into this.
  • bool eof () const β€” fast error checking.
  • iostate exceptions () const β€” throwing exceptions on errors.
  • void exceptions (iostate __except) β€” throwing exceptions on errors. same deal, different direction.
  • bool fail () const β€” fast error checking.
  • char_type fill () const β€” retrieves the empty character.
  • char_type fill (char_type __ch) β€” sets a new empty character.
  • fmtflags flags () const β€” access to format flags.
  • fmtflags flags (fmtflags __fmtfl) β€” setting new format flags all at once. go big. πŸ”₯
  • __ostream_type & flush () β€” synchronizing the stream buffer.
  • streamsize gcount () const β€” character counting.
  • basic_istream< wchar_t > & getline (char_type *__s, streamsize __n, char_type __delim)
  • basic_istream< char > & getline (char_type *__s, streamsize __n, char_type __delim) β€” explicit specialization declarations, defined in src/istream.cc. πŸ“ that's the file, bestie, don't lose it.
  • locale getloc () const β€” locale access.
  • bool good () const β€” fast error checking.
  • basic_istream< wchar_t > & ignore (streamsize __n)
  • basic_istream< char > & ignore (streamsize __n)
  • basic_istream< wchar_t > & ignore (streamsize __n, int_type __delim)
  • basic_istream< char > & ignore (streamsize __n, int_type __delim)
  • locale imbue (const locale &__loc) β€” moves to a new locale.
  • long & iword (int __ix) β€” access to integer array.
  • char narrow (char_type __c, char __dfault) const β€” squeezes characters. as in, wide to narrow. she's compacting. 🧚
  • __ostream_type & operator<< (__streambuf_type *__sb) β€” extracting from another streambuf.
  • __ostream_type & operator<< (const void *__p) β€” pointer arithmetic inserters.
  • __ostream_type & operator<< (const volatile void *__p)
  • __ostream_type & operator<< (nullptr_t)
  • basic_stringstream & operator= (basic_stringstream &&__rhs)
  • basic_stringstream & operator= (const basic_stringstream &)=delete β€” again with the deleted copy assignment. she said NO. πŸ’€
  • __istream_type & operator>> (__streambuf_type *__sb) β€” extracting into another streambuf.
  • __istream_type & operator>> (void *&__p) β€” basic arithmetic extractors.
  • streamsize precision () const β€” flags access.
  • streamsize precision (streamsize __prec) β€” changing flags.
  • void *& pword (int __ix) β€” access to void pointer array.
  • basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb) β€” changing the underlying buffer. swapping the whole foundation, nbd. πŸ‘‘
  • __stringbuf_type * rdbuf () const β€” accessing the underlying buffer.
  • iostate rdstate () const β€” returns the error state of the stream buffer.
  • void register_callback (event_callback __fn, int __index) β€” add the callback __fn with parameter __index.
  • __ostream_type & seekp (off_type, ios_base::seekdir) β€” changing the current write position.
  • __ostream_type & seekp (pos_type) β€” changing the current write position.
  • fmtflags setf (fmtflags __fmtfl) β€” setting new format flags.
  • fmtflags setf (fmtflags __fmtfl, fmtflags __mask) β€” setting new format flags.
  • void setstate (iostate __state) β€” sets additional flags in the error state.
  • __string_type str () &&
  • __string_type str () const & β€” copying out the string buffer. the classic move. πŸ’–
  • void str (__string_type &&__s)
  • void str (const __string_type &__s) β€” setting a new buffer.
  • template<__allocator_like _SAlloc> basic_string< _CharT, _Traits, _SAlloc > str (const _SAlloc &__sa) const
  • template<__allocator_like _SAlloc> void str (const basic_string< _CharT, _Traits, _SAlloc > &__s)
  • void swap (basic_stringstream &__rhs)
  • pos_type tellp () β€” getting the current write position.
  • basic_ostream< _CharT, _Traits > * tie () const β€” fetches the current tied stream.
  • basic_ostream< _CharT, _Traits > * tie (basic_ostream< _CharT, _Traits > *__tiestr) β€” ties this stream to an output stream. besties, linked. 🫢
  • void unsetf (fmtflags __mask) β€” clearing format flags.
  • basic_string_view< char_type, traits_type > view () const noexcept
  • char_type widen (char __c) const β€” widens characters.
  • streamsize width () const β€” flags access.
  • streamsize width (streamsize __wide) β€” changing flags.

and then, tucked in right after, these little manipulator-handlers:

  • __istream_type & operator>> (__istream_type &(*__pf)(__istream_type &)) β€” interface for manipulators.
  • __istream_type & operator>> (__ios_type &(*__pf)(__ios_type &)) β€” interface for manipulators.
  • __istream_type & operator>> (ios_base &(*__pf)(ios_base &)) β€” interface for manipulators.

🌈 Extractors 🌈

so, all the operator>> functions β€” aka the formatted input functions β€” share some common behavior, and here's the tea: β˜•

Each one starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. That has several effects, and it wraps up by setting a status flag β€” check the sentry documentation for the full rundown. πŸ“–

If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument. πŸ“

If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown), and the original exception will be rethrown if badbit is set in the exceptions mask. ⚠️ big deal, read that twice.

  • __istream_type & operator>> (bool &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (short &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned short &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (int &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned int &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (long &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned long &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (long long &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (unsigned long long &__n) β€” integer arithmetic extractors.
  • __istream_type & operator>> (float &__f) β€” floating point arithmetic extractors.
  • __istream_type & operator>> (double &__f) β€” floating point arithmetic extractors.
  • __istream_type & operator>> (long double &__f) β€” floating point arithmetic extractors.

🧚 Unformatted Input Functions 🧚

these ones play by slightly different rules, and you need to know them:

Every unformatted input function starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true β€” note that, it's the opposite of the extractors above. That has several effects, and it finishes by setting a status flag; the sentry docs have the whole story. πŸ“–

If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument. ✨

The number of characters extracted is stored for later retrieval by gcount(). πŸ”’

And β€” same warning as before β€” if an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown), and the original exception will be rethrown if badbit is set in the exceptions mask. ⚠️


okay that's the types, the constructors, the entire member function roster, the extractors and the unformatted input tea β€” and we're literally just getting started bestie, there is so much more coming πŸ‘€
  • int_type get () β€” simple extraction, bestie. Just one character, no biggie. πŸ’…
  • __istream_type & get (char_type &__c) β€” simple extraction, but now you're passing a char_type&. Still simple, still extraction. ✨
  • __istream_type & get (char_type *__s, streamsize __n, char_type __delim) β€” simple multiple-character extraction, delimiter included. It's giving "read multiple characters, but stop at __delim." πŸŽ€
  • __istream_type & get (char_type *__s, streamsize __n) β€” simple multiple-character extraction, no delimiter this time. Just __n characters, periodt. πŸ¦‹
  • __istream_type & get (__streambuf_type &__sb, char_type __delim) β€” extraction into another streambuf. With a delimiter. Stealing characters from one streambuf and putting them into another. Iconic. 🌸
  • __istream_type & get (__streambuf_type &__sb) β€” extraction into another streambuf. No delimiter, just vibes. πŸ’…
  • __istream_type & getline (char_type *__s, streamsize __n, char_type __delim) β€” string extraction. Getting a whole line, or up to __n chars, or until __delim. The way that… 🫢
  • __istream_type & getline (char_type *__s, streamsize __n) β€” string extraction. Same energy, but no delimiter. Just __n chars max. 😭
  • __istream_type & ignore (streamsize __n, int_type __delim) β€” discarding characters. Like when you're reading a group chat and just skipping the drama. πŸ”₯
  • __istream_type & ignore (streamsize __n) β€” simple extraction. Yes, ignore is also extraction, it's complicated. It extracts and throws away. πŸ‘‘
  • __istream_type & ignore () β€” simple extraction. The no-argument version. Still ignoring, still extracting. 🌈
  • __istream_type & ignore (streamsize __n, char __delim) β€” simple extraction. With a char delimiter. Because why not. ⭐
  • int_type peek () β€” looking ahead in the stream. Peeking without extracting. No cap. πŸ’€
  • __istream_type & read (char_type *__s, streamsize __n) β€” extraction without delimiters. Just raw reading, no stopping for delimiters. πŸ™ˆ
  • streamsize readsome (char_type *__s, streamsize __n) β€” extraction until the buffer is exhausted, but no more. It's giving "read what's available, don't wait." πŸ“
  • __istream_type & putback (char_type __c) β€” unextracting a single character. Putting it back like you didn't see it. 🧚
  • __istream_type & unget () β€” unextracting the previous character. Oops, undo. πŸ’œ
  • int sync () β€” synchronizing the stream buffer. Getting everything in sync, slay. πŸ’–
  • pos_type tellg () β€” getting the current read position. Where are we? Here. ✨
  • __istream_type & seekg (pos_type) β€” changing the current read position. Moving the cursor, no big deal. πŸŽ€
  • __istream_type & seekg (off_type, ios_base::seekdir) β€” changing the current read position. With an offset and a seek direction. Fancy. πŸ¦‹
  • operator bool () const β€” the quick-and-easy status check. Is the stream good? Yes or no, bestie. 🌸
  • bool operator! () const β€” the quick-and-easy status check. The opposite of the above. πŸ’…
  • __ostream_type & operator<< (__ostream_type &(*__pf)(__ostream_type &)) β€” interface for manipulators. Letting you use things like std::endl and std::hex with your stream. It's giving "manipulator magic." 🫢
  • __ostream_type & operator<< (__ios_type &(*__pf)(__ios_type &)) β€” interface for manipulators. Another flavor of manipulator interface. 😭
  • __ostream_type & operator<< (ios_base &(*__pf)(ios_base &)) β€” interface for manipulators. And another. The trio is complete. πŸ”₯

Inserters ✨

Okay so all the operator<< functions (aka formatted output functions) share some common behavior. Each one starts by constructing a temporary object of type std::basic_ostream::sentry. This can have several effects, and it ends with setting a status flag. For the tea, check the sentry documentation. πŸ’…

If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument. No cap. πŸ‘‘

If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state, without causing an ios_base::failure to be thrown. The original exception will then be rethrown. So like, the stream gets marked bad, but it doesn't throw a new failure β€” it just rethrows the original. Periodt. 🌈

  • __ostream_type & operator<< (long __n) β€” integer arithmetic inserters. Just dropping that long into the stream. ⭐
  • __ostream_type & operator<< (unsigned long __n) β€” integer arithmetic inserters. Unsigned long version. πŸ’€
  • __ostream_type & operator<< (bool __n) β€” integer arithmetic inserters. Yes, bool counts as integer arithmetic here. πŸ™ˆ
  • __ostream_type & operator<< (short __n) β€” integer arithmetic inserters. Short and sweet. πŸ“
  • __ostream_type & operator<< (unsigned short __n) β€” integer arithmetic inserters. Unsigned short, still sweet. 🧚
  • __ostream_type & operator<< (int __n) β€” integer arithmetic inserters. The classic int. πŸ’œ
  • __ostream_type & operator<< (unsigned int __n) β€” integer arithmetic inserters. Unsigned int energy. πŸ’–
  • __ostream_type & operator<< (long long __n) β€” integer arithmetic inserters. long long, because sometimes you need more. ✨
  • __ostream_type & operator<< (unsigned long long __n) β€” integer arithmetic inserters. Unsigned long long, the final integer boss. πŸŽ€
  • __ostream_type & operator<< (double __f) β€” floating point arithmetic inserters. Double precision, double the fun. πŸ¦‹
  • __ostream_type & operator<< (float __f) β€” floating point arithmetic inserters. Float, the smaller cousin. 🌸
  • __ostream_type & operator<< (long double __f) β€” floating point arithmetic inserters. long double, for when you're extra. πŸ’…

Unformatted Output Functions ✨

All the unformatted output functions have some common behavior. Each starts by constructing a temporary object of type std::basic_ostream::sentry. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more. 🫢

If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument. 😭

If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state. If badbit is on in the stream's exceptions mask, the exception will be rethrown without completing its actions. So like, if you've set up exceptions, it'll throw. Otherwise, it just marks bad and moves on. πŸ”₯

  • __ostream_type & put (char_type __c) β€” simple insertion. Just one character, no formatting. πŸ‘‘
  • __ostream_type & write (const char_type *__s, streamsize __n) β€” character string insertion. Writing __n characters from a string. 🌈

Static Public Member Functions ✨

  • static bool sync_with_stdio (bool __sync=true) β€” interaction with the standard C I/O objects. Keeps C and C++ I/O in sync. Default is true. ⭐
  • static int xalloc () throw () β€” access to unique indices. Gets you a unique index for iword/pword. No cap. πŸ’€

Static Public Attributes ✨

  • static const openmode __noreplace
  • static const fmtflags adjustfield β€” a mask of left|right|internal. Useful for the 2-arg form of setf. So like, you can use this to adjust the field. πŸ’…
  • static const openmode app β€” seek to end before each write. So it always appends. Iconic. 🫢
  • static const openmode ate β€” open and seek to end immediately after opening. It's giving "start at the end." 😭
  • static const iostate badbit β€” indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file). Big yikes. πŸ”₯
  • static const fmtflags basefield β€” a mask of dec|oct|hex. Useful for the 2-arg form of setf. Base field energy. πŸ‘‘
  • static const seekdir beg β€” request a seek relative to the beginning of the stream. Start from the top, bestie. 🌈
  • static const openmode binary β€” perform input and output in binary mode (as opposed to text mode). This is probably not what you think it is; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. So like, don't assume, read the docs. πŸ’€
  • static const fmtflags boolalpha β€” insert/extract bool in alphabetic rather than numeric format. So true/false instead of 1/0. Slay. πŸ™ˆ
  • static const seekdir cur β€” request a seek relative to the current position within the sequence. Stay where you are, basically. πŸ“
  • static const fmtflags dec β€” converts integer input or generates integer output in decimal base. Base 10, the usual. 🧚
  • static const seekdir end β€” request a seek relative to the current end of the sequence. Go to the end, periodt. πŸ’œ
  • static const iostate eofbit β€” indicates that an input operation reached the end of an input sequence. You've hit the end, bestie. πŸ’–
  • static const iostate failbit β€” indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. It's giving "failure." ✨
  • static const fmtflags fixed β€” generate floating-point output in fixed-point notation. No scientific notation, just fixed. πŸ’…
  • static const fmtflags floatfield β€” a mask of scientific|fixed. Useful for the 2-arg form of setf. Float field vibes. πŸŽ€
  • static const iostate goodbit β€” indicates all is well. Good vibes only. πŸ¦‹
  • static const fmtflags hex β€” converts integer input or generates integer output in hexadecimal base. Base 16, hex girl summer. 🌸
  • static const openmode in β€” open for input. Default for ifstream and fstream. Reading mode. πŸ’…
  • static const fmtflags internal β€” adds fill characters at a designated internal point in certain generated output, or identical to right if no such point is designated. Internal fill, fancy. 🫢
  • static const fmtflags left β€” adds fill characters on the right (final positions) of certain generated output. (I.e., the thing you print is flush left.). Flush left, bestie. 😭
  • static const fmtflags oct β€” converts integer input or generates integer output in octal base. Base 8, old school. πŸ”₯
  • static const openmode out β€” open for output. Default for ofstream and fstream. Writing mode. πŸ‘‘
  • static const fmtflags right β€” adds fill characters on the left (initial positions) of certain generated output. (I.e., the thing you print is flush right.). Flush right, slay. 🌈
  • static const fmtflags scientific β€” generates floating-point output in scientific notation. Science! πŸ§ͺ
  • static const fmtflags showbase β€” generates a prefix indicating the numeric base of generated integer output. Like 0x for hex, 0 for octal. Show it off. ⭐
  • static const fmtflags showpoint β€” generates a decimal-point character unconditionally in generated floating-point output. Always show the dot. πŸ’€
  • static const fmtflags showpos β€” generates a + sign in non-negative generated numeric output. Positive vibes only, literally. πŸ™ˆ
  • static const fmtflags skipws β€” skips leading white space before certain input operations. No space, just skip. πŸ“
  • static const openmode trunc β€” truncate an existing stream when opening. Default for ofstream. Cut it off. 🧚
  • static const fmtflags unitbuf β€” flushes output after each output operation. No buffering, just flush. πŸ’œ
  • static const fmtflags uppercase β€” replaces certain lowercase letters with their uppercase equivalents in generated output. ALL CAPS ENERGY. πŸ’–

Protected Types ✨

  • enum { _S_local_word_size } β€” mysterious protected enum, iykyk. ✨

Protected Member Functions ✨

  • void _M_cache_locale (const locale &__loc)
  • void _M_call_callbacks (event __ev) throw ()
  • void _M_dispose_callbacks (void) throw ()
  • template<typename _ValueT> __istream_type & _M_extract (_ValueT &__v)
  • _Words & _M_grow_words (int __index, bool __iword)
  • void _M_init () throw ()
  • template<typename _ValueT> __ostream_type & _M_insert (_ValueT __v)
  • void _M_move (ios_base &) noexcept
  • void _M_swap (ios_base &__rhs) noexcept
  • void init (basic_streambuf< _CharT, _Traits > *__sb) β€” all setup is performed here. The main character of setup. πŸ’…
  • void move (basic_ios &&__rhs)
  • void move (basic_ios &__rhs)
  • void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)
  • void swap (basic_ios &__rhs) noexcept
  • void swap (basic_iostream &__rhs)
  • void swap (basic_istream &__rhs)
  • void swap (basic_ostream &__rhs)

Protected Attributes ✨

  • _Callback_list * _M_callbacks
  • const __ctype_type * _M_ctype
  • iostate _M_exception
  • char_type _M_fill
  • bool _M_fill_init
  • fmtflags _M_flags
  • streamsize _M_gcount
  • locale _M_ios_locale
  • _Words _M_local_word [_S_local_word_size]
  • const __num_get_type * _M_num_get
  • const __num_put_type * _M_num_put
  • streamsize _M_precision
  • basic_streambuf< _CharT, _Traits > * _M_streambuf
  • iostate _M_streambuf_state
  • basic_ostream< _CharT, _Traits > * _M_tie
  • streamsize _M_width
  • _Words * _M_word
  • int _M_word_size
  • _Words _M_word_zero

✨ Detailed Description ✨

template<typename _CharT, typename _Traits, typename _Alloc>
    class std::basic_stringstream< _CharT, _Traits, _Alloc >

Controlling input and output for std::string. πŸ’– That's the whole vibe of this class, bestie.

🌸 Template Parameters 🌸

  • _CharT β€” type of character stream, aka what kind of lil letters we're playing with.
  • _Traits β€” traits for character type, defaults to char_traits<_CharT>.
  • _Alloc β€” allocator type, defaults to allocator<_CharT>.

So here's the tea: this class supports reading from and writing to objects of type std::basic_string, using the inherited functions from std::basic_iostream. To control the associated sequence, an instance of std::basic_stringbuf is used, which this page refers to as sb. ✨ Remember that name, sb is gonna be showing up everywhere, she's the main character fr fr.


πŸ‘‘ Member Typedef Documentation πŸ‘‘

typedef void(* std::ios_base::event_callback) (event __e, ios_base &__b, int __i) [inherited]

The type of an event callback function. πŸŽ€

Parameters

  • __e β€” one of the members of the event enum.
  • __b β€” reference to the ios_base object.
  • __i β€” the integer provided when the callback was registered.

Event callbacks are user defined functions that get called during several ios_base and basic_ios functions, specifically imbue(), copyfmt(), and ~ios(). πŸ¦‹ Like little notification pings that fire off when stuff happens, iykyk.


typedef _Ios_Fmtflags std::ios_base::fmtflags [inherited]

This is a bitmask type. _Ios_Fmtflags is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type fmtflags are:

  • boolalpha
  • dec
  • fixed
  • hex
  • internal
  • left
  • oct
  • right
  • scientific
  • showbase
  • showpoint
  • showpos
  • skipws
  • unitbuf
  • uppercase
  • adjustfield
  • basefield
  • floatfield

typedef _Ios_Iostate std::ios_base::iostate [inherited]

Also a bitmask type, bestie. _Ios_Iostate is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type iostate are:

  • badbit
  • eofbit
  • failbit
  • goodbit

typedef _Ios_Openmode std::ios_base::openmode [inherited]

Yep, another bitmask type. _Ios_Openmode is implementation-defined, but it is valid to perform bitwise operations on these values and expect the Right Thing to happen. Defined objects of type openmode are:

  • app
  • ate
  • binary
  • in
  • out
  • trunc

typedef _Ios_Seekdir std::ios_base::seekdir [inherited]

This one is an enumerated type, not a bitmask β€” plot twist. _Ios_Seekdir is implementation-defined. Defined values of type seekdir are:

  • beg
  • cur, equivalent to SEEK_CUR in the C standard library.
  • end, equivalent to SEEK_END in the C standard library.

πŸ¦‹ Member Enumeration Documentation πŸ¦‹

enum std::ios_base::event [inherited]

The set of events that may be passed to an event callback. 🌈

  • erase_event is used during ~ios() and copyfmt().
  • imbue_event is used during imbue().
  • copyfmt_event is used during copyfmt().

Three lil events, three lil moments, very demure. πŸ’…


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream () [inline]

Default constructor starts with an empty string buffer. Initializes sb using the mode in|out, and passes &sb to the base class initializer. Does not allocate any buffer.

That's a lie. We initialize the base class with NULL, because the string class does its own memory management. 😭 No cap, the docs really said that.

std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream (ios_base::openmode __m) [inline], [explicit]

Starts with an empty string buffer.

Parameters

  • __m β€” whether the buffer can read, or write, or both.

Initializes sb using the mode from __m, and passes &sb to the base class initializer. Does not allocate any buffer.

That's a lie. We initialize the base class with NULL, because the string class does its own memory management. πŸ’€ Same energy, same disclaimer.

std::basic_stringstream< _CharT, _Traits, _Alloc >::basic_stringstream (const __string_type & __str, ios_base::openmode __m = ios_base::out | ios_base::in) [inline], [explicit]

Starts with an existing string buffer. πŸ‘‘

Parameters

  • __str β€” a string to copy as a starting buffer.
  • __m β€” whether the buffer can read, or write, or both.

Initializes sb using __str and __m, and passes &sb to the base class initializer.

That's a lie. We initialize the base class with NULL, because the string class does its own memory management. ✨ Third time's the charm, bestie.

std::basic_stringstream< _CharT, _Traits, _Alloc >::~basic_stringstream () [inline]

The destructor does nothing. The buffer is deallocated by the stringbuf object, not the formatting stream. 🧚 She said "not my job," and honestly? Respect.


πŸ’œ Member Function Documentation πŸ’œ

const locale & std::ios_base::_M_getloc () const [inline], [inherited]

Locale access. 🌍

Returns

A reference to the current locale.

Like getloc above, but returns a reference instead of generating a copy. Cheaper, faster, slay.

Referenced by std::money_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::num_put< _CharT, _OutIter >::do_put(), std::time_put< _CharT, _OutIter >::do_put(), std::time_get< _CharT, _InIter >::get(), and std::time_put< _CharT, _OutIter >::put().


template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::bad () const [inline], [nodiscard], [inherited]

Fast error checking. ⚑

Returns

True if the badbit is set.

Note that other iostate flags may also be set. Don't assume it's only badbit, girl.

Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry().


template<typename _CharT, typename _Traits> void std::basic_ios< _CharT, _Traits >::clear (iostate __state = goodbit) [inherited]

[Re]sets the error state. πŸ”„

Parameters

  • __state β€” the new state flag(s) to set.

See std::ios_base::iostate for the possible bit values. Most users will not need to pass an argument. 🫢

References std::ios_base::badbit, exceptions(), rdbuf(), and rdstate().

Referenced by std::basic_ios< char_type, traits_type >::exceptions(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::__detail::operator>>(), std::basic_istream< _CharT, _Traits >::putback(), rdbuf(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< char_type, traits_type >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().


template<typename _CharT, typename _Traits> basic_ios< _CharT, _Traits > & std::basic_ios< _CharT, _Traits >::copyfmt (const basic_ios< _CharT, _Traits > & __rhs) [inherited]

Copies fields of __rhs into this. πŸ“‹βœ¨

Parameters

  • __rhs β€” the source values for the copies.

Returns

Reference to this object.

All fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged. All values in the pword and iword arrays are copied. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. The final step is to copy exceptions(). Whole lil choreography, honestly.

References basic_ios(), std::__addressof(), exceptions(), fill(), std::ios_base::flags(), std::ios_base::getloc(), std::ios_base::precision(), tie(), std::tie(), and std::ios_base::width().


template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::eof () const [inline], [nodiscard], [inherited]

Fast error checking. ⚑

Returns

True if the eofbit is set.

Note that other iostate flags may also be set. Same warning, different flag.


template<typename _CharT, typename _Traits> iostate std::basic_ios< _CharT, _Traits >::exceptions () const [inline], [nodiscard], [inherited]

Throwing exceptions on errors. πŸ’₯

Returns

The current exceptions mask.

This changes nothing in the stream. See the one-argument version of exceptions(iostate) for the meaning of the return value. πŸŽ€

Referenced by clear(), and copyfmt().


template<typename _CharT, typename _Traits> void std::basic_ios< _CharT, _Traits >::exceptions (iostate __except) [inline], [inherited]

Throwing exceptions on errors. πŸ’₯

Parameters

  • __except β€” the new exceptions mask.

By default, error flags are set silently. You can set an exceptions mask for each stream; if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown. 🚨

If the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Like, instantly. No waiting period, bestie.

Try running the following under GCC 3.1 or later:

#include <iostream>
#include <fstream>
#include <exception>

int main()
{
    std::set_terminate (__gnu_cxx::__verbose_terminate_handler);

    std::ifstream f ("/etc/motd");

    std::cerr << "Setting badbit\n";
    f.setstate (std::ios_base::badbit);

    std::cerr << "Setting exception mask\n";
    f.exceptions (std::ios_base::badbit);
}

template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::fail () const [inline], [nodiscard], [inherited]

Fast error checking. ⚑

Returns

True if either the badbit or the failbit is set.

Checking the badbit in fail() is historical practice. It's giving "we've always done it this way." Note that other iostate flags may also be set.

Referenced by std::basic_ios< char_type, traits_type >::operator bool(), std::basic_ios< char_type, traits_type >::operator!(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::tellg(), and std::basic_ostream< _CharT, _Traits >::tellp().


template<typename _CharT, typename _Traits> char_type std::basic_ios< _CharT, _Traits >::fill () const [inline], [nodiscard], [inherited]

Retrieves the empty character. 🫧

Returns

The current fill character.

It defaults to a space (' ') in the current locale. 🌸

Referenced by copyfmt(), and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<.


template<typename _CharT, typename _Traits> char_type std::basic_ios< _CharT, _Traits >::fill (char_type __ch) [inline], [inherited]

Sets a new empty character. ✏️

Parameters

  • __ch β€” the new character.

Returns

The previous fill character.

She gives you the old one back, so polite. πŸ’–

Okay so the fill character? It's giving padding vibes. It gets used to fill out space when P+ characters have been requested (e.g., via setw), but only Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale. πŸ’…

fmtflags std::ios_base::flags () const [inline], [nodiscard], [inherited]

Access to format flags.

Returns

  • The format control flags for both input and output.

Referenced by β€” it's called by std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::num_put< _CharT, _OutIter >::do_put(), std::chrono::operator<<(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<, std::__detail::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator>>.

fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]

Setting new format flags all at once.

Parameters

  • __fmtfl β€” The new flags to set.

Returns

  • The previous format control flags.

This function overwrites all the format flags with __fmtfl. Periodt. πŸ’…

template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::flush () [inherited]

Synchronizing the stream buffer.

Returns

  • *this

If rdbuf() is a null pointer, changes nothing.

Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit.

References β€” std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by β€” std::flush().

template<typename _CharT, typename _Traits> streamsize std::basic_istream< _CharT, _Traits >::gcount () const [inline], [inherited]

Character counting.

Returns

  • The number of characters extracted by the previous unformatted input function dispatched for this stream.

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::get (void ) [inherited]

Simple extraction.

Returns

  • A character, or eof().

Tries to extract a character. If none are available, sets failbit and returns traits::eof().

References β€” _M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by β€” std::basic_istream< char_type, traits_type >::get(), and std::basic_istream< char_type, traits_type >::get().

template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb) [inline], [inherited]

Extraction into another streambuf.

Parameters

  • __sb β€” A streambuf in which to store data.

Returns

  • *this

Returns get(__sb,widen('\n')).

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (__streambuf_type & __sb, char_type __delim) [inherited]

Extraction into another streambuf.

Parameters

  • __sb β€” A streambuf in which to store data.
  • __delim β€” A "stop" character.

Returns

  • *this

Characters are extracted and inserted into __sb until one of the following happens:

  • the input sequence reaches EOF
  • insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted)
  • the next character equals __delim (in this case, the character is not extracted)
  • an exception occurs (and in this case is caught)

If no characters are stored, failbit is set in the stream's error state.

References β€” _M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type & __c) [inherited]

Simple extraction.

Parameters

  • __c β€” The character in which to store data.

Returns

  • *this

Tries to extract a character and store it in __c. If none are available, sets failbit and returns traits::eof().

Note β€” This function is not overloaded on signed char and unsigned char.

References β€” _M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n) [inline], [inherited]

Simple multiple-character extraction.

Parameters

  • __s β€” Pointer to an array.
  • __n β€” Maximum number of characters to store in s.

Returns

  • *this

Returns get(__s,__n,widen('\n')).

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get (char_type * __s, streamsize __n, char_type __delim) [inherited]

Simple multiple-character extraction.

Parameters

  • __s β€” Pointer to an array.
  • __n β€” Maximum number of characters to store in __s.
  • __delim β€” A "stop" character.

Returns

  • *this

Characters are extracted and stored into __s until one of the following happens:

  • __n-1 characters are stored
  • the input sequence reaches EOF
  • the next character equals __delim, in which case the character is not extracted

If no characters are stored, failbit is set in the stream's error state.

In any case, a null character is stored into the next location in the array.

Note β€” This function is not overloaded on signed char and unsigned char.

References β€” _M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().

template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n) [inline], [inherited]

String extraction.

Parameters

  • __s β€” A character array in which to store the data.
  • __n β€” Maximum number of characters to extract.

Returns

  • *this

Returns getline(__s,__n,widen('\n')).

basic_istream< char > & std::basic_istream< char >::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]

Explicit specialization declarations, defined in src/istream.cc.

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline (char_type * __s, streamsize __n, char_type __delim) [inherited]

String extraction.

Parameters

  • __s β€” A character array in which to store the data.
  • __n β€” Maximum number of characters to extract.
  • __delim β€” A "stop" character.

Returns

  • *this

Extracts and stores characters into __s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the __s array without setting failbit.

  1. the input sequence reaches end-of-file, in which case eofbit is set in the stream error state
  2. the next character equals __delim, in which case the character is extracted (and therefore counted in gcount()) but not stored
  3. __n-1 characters are stored, in which case failbit is set in the stream error state

If no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set.)

In any case, a null character is stored in the next location in the array.

Referenced by β€” std::basic_istream< char_type, traits_type >::getline().

locale std::ios_base::getloc () const [inline], [nodiscard], [inherited]

Locale access.

Returns

  • A copy of the current locale.

If imbue(loc) has previously been called, then this function returns loc. Otherwise, it returns a copy of std::locale(), the global C++ locale.

Referenced by β€” std::basic_ios< _CharT, _Traits >::copyfmt(), std::money_put< _CharT, _OutIter >::do_put(), std::basic_ios< _CharT, _Traits >::imbue(), std::chrono::operator<<(), std::operator>>(), std::operator>>(), and std::ws().

template<typename _CharT, typename _Traits> bool std::basic_ios< _CharT, _Traits >::good () const [inline], [nodiscard], [inherited]

Fast error checking.

Returns

  • True if no error flags are set.

A wrapper around rdstate.

Referenced by β€” std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and std::__detail::operator>>().

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (void ) [inherited]

Simple extraction.

Returns

  • A character, or eof().

Tries to extract a character. If none are available, sets failbit and returns traits::eof().

References β€” _M_gcount, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sbumpc().

Referenced by β€” std::basic_istream< char_type, traits_type >::ignore().

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n) [inherited]

Simple extraction.

Returns

  • A character, or eof().

Tries to extract a character. If none are available, sets failbit and returns traits::eof().

References β€” _M_gcount, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_streambuf< _CharT, _Traits >::sgetc().

template<typename _CharT, typename _Traits> __istream_type & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, char __delim) [inline], [inherited]

Simple extraction.

Returns

  • A character, or eof().

Tries to extract a character. If none are available, sets failbit and returns traits::eof().

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (streamsize __n, int_type __delim) [inherited]

Discarding characters.

Parameters

  • __n β€” Number of characters to discard.
  • __delim β€” A "stop" character.

Returns

  • *this

Extracts characters and throws them away until one of the following happens:

  • if __n != std::numeric_limits<int>::max(), __n characters are extracted
  • the input sequence reaches end-of-file
  • the next character equals __delim (and bestie, in this case the character is extracted 🫢) β€” lowkey important: this condition will never occur if __delim equals traits::eof().
NB: they provide four overloads, instead of the single function (with defaults) mandated by the Standard β€” and it's giving better performance while still conforming to the Standard. we love a compliant icon πŸ’…

References: _M_gcount, and std::ios_base::goodbit.


🌍 imbue β€” the move-to-a-new-locale one

template<typename _CharT, typename _Traits>
locale std::basic_ios<_CharT, _Traits>::imbue(const locale& __loc) [inherited]

okay so this one moves to a new locale, and that's the whole vibe ✨

Parameters

  • __loc β€” the new locale πŸ’–

Returns

  • the previous locale πŸ‘‘

It calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, it also calls that buffer's pubimbue(loc).

Additional l10n notes are at https://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html

References: std::ios_base::getloc(), std::ios_base::imbue(), and rdbuf().

Referenced by std::chrono::operator<<().


πŸ”§ init β€” the setup goblin

template<typename _CharT, typename _Traits>
void std::basic_ios<_CharT, _Traits>::init(basic_streambuf<_CharT, _Traits>* __sb) [protected], [inherited]

All the setup is performed right here, bestie. This is called from the public constructor. It is not virtual and cannot be redefined β€” periodt πŸ”’ no takesies backsies.

Referenced by std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ios< char_type, traits_type >::basic_ios(), std::basic_istream< char_type, traits_type >::basic_istream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ostream< char_type, traits_type >::basic_ostream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_stringstream< char >::basic_stringstream(), std::basic_stringstream< char >::basic_stringstream(), and std::basic_stringstream< char >::basic_stringstream().


πŸ”’ iword β€” access to the integer array

long& std::ios_base::iword(int __ix) [inline], [inherited]

Parameters

  • __ix β€” index into the array

Returns

  • a reference to an integer associated with the index

The iword function provides access to an array of integers that can be used for any purpose. The array grows as required to hold the supplied index. All integers in the array are initialized to 0.

The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference β€” it's giving "this reference will not last, bestie" 😭

References: iword().

Referenced by iword().


πŸͺ„ narrow β€” squeezes characters

template<typename _CharT, typename _Traits>
char std::basic_ios<_CharT, _Traits>::narrow(char_type __c, char __dfault) const [inline], [inherited]

Parameters

  • __c β€” the character to narrow
  • __dfault β€” the character to narrow (yes, same wording, that's what the docs say πŸ™ˆ)

Returns

  • the narrowed character

Maps a character of char_type to a character of char, if possible.

Returns the result of

std::use_facet<ctype<char_type> >(getloc()).narrow(c,dfault)

Additional l10n notes are at https://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html


βœ… operator bool β€” the quick-and-easy status check

template<typename _CharT, typename _Traits>
std::basic_ios<_CharT, _Traits>::operator bool() const [inline], [explicit], [nodiscard], [inherited]

The quick-and-easy status check πŸŽ€ This lets you write constructs such as if (!a_stream) ... and while (a_stream) ...


❌ operator! β€” also the quick-and-easy status check

template<typename _CharT, typename _Traits>
bool std::basic_ios<_CharT, _Traits>::operator!() const [inline], [nodiscard], [inherited]

The quick-and-easy status check πŸŽ€ This lets you write constructs such as if (!a_stream) ... and while (a_stream) ...


πŸŽ›οΈ operator<< β€” interface for manipulators

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (* __pf)(__ios_type&)) [inline], [inherited]

Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like "std::cout << std::endl". For more information, see the iomanip header.


πŸŽ›οΈ operator<< β€” interface for manipulators (the other flavor)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (* __pf)(__ostream_type&)) [inline], [inherited]

Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like "std::cout << std::endl". For more information, see the iomanip header.


πŸ“₯ operator<< β€” extracting from another streambuf

template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type* __sb) [inherited]

Parameters

  • __sb β€” a pointer to a streambuf

This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.

If __sb is NULL, the stream will set failbit in its error state. 🚨

Characters are extracted from __sb and inserted into *this until one of the following occurs:

  • the input stream reaches end-of-file,
  • insertion into the output sequence fails (in this case, the character that would have been inserted is not extracted), or
  • an exception occurs while getting a character from __sb, which sets failbit in the error state

If the function inserts no characters, failbit is set.


πŸ”’ operator<< β€” integer arithmetic inserters (bool)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool __n) [inline], [inherited]

Parameters

  • __n β€” a variable of builtin integral type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


🫧 operator<< β€” pointer arithmetic inserters

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void* __p) [inline], [inherited]

Parameters

  • __p β€” a variable of pointer type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


🌊 operator<< β€” floating point arithmetic inserters (double)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double __f) [inline], [inherited]

Parameters

  • __f β€” a variable of builtin floating point type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


🌊 operator<< β€” floating point arithmetic inserters (float)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float __f) [inline], [inherited]

Parameters

  • __f β€” a variable of builtin floating point type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


πŸ”’ operator<< β€” integer arithmetic inserters (int)

template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int __n) [inherited]

Parameters

  • __n β€” a variable of builtin integral type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


πŸŽ›οΈ operator<< β€” interface for manipulators (ios_base)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(ios_base& (* __pf)(ios_base&)) [inline], [inherited]

Interface for manipulators. Manipulators such as std::endl and std::hex use these functions in constructs like "std::cout << std::endl". For more information, see the iomanip header.


πŸ”’ operator<< β€” integer arithmetic inserters (long)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long __n) [inline], [inherited]

Parameters

  • __n β€” a variable of builtin integral type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


🌊 operator<< β€” floating point arithmetic inserters (long double)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double __f) [inline], [inherited]

Parameters

  • __f β€” a variable of builtin floating point type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


πŸ”’ operator<< β€” integer arithmetic inserters (long long)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long __n) [inline], [inherited]

Parameters

  • __n β€” a variable of builtin integral type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


πŸ”’ operator<< β€” integer arithmetic inserters (short)

template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short __n) [inherited]

Parameters

  • __n β€” a variable of builtin integral type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.

References: basic_ostream(), std::ios_base::badbit, std::ostreambuf_iterator< _CharT, _Traits >::failed(), std::ios_base::goodbit, std::num_put< _CharT, _OutIter >::put(), std::basic_ios< _CharT, _Traits >::setstate(), and std::use_facet().


πŸ”’ operator<< β€” integer arithmetic inserters (unsigned int)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int __n) [inline], [inherited]

Parameters

  • __n β€” a variable of builtin integral type

Returns

  • *this if successful

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


πŸ”’ operator<< β€” integer arithmetic inserters (unsigned long)

template<typename _CharT, typename _Traits>
__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n) [inline], [inherited]

Parameters

  • __n β€” a variable of builtin integral type

Returns

  • *this if successful

These functions use the stream's current locale β€” specifically, the num_get facet β€” to do all the numeric formatting. Yes, even on the output side. That's just how it is, bestie. πŸ’…


🌸 operator<< (unsigned long long __n)

template<typename _CharT, typename _Traits> __ostream_type &
std::basic_ostream< _CharT, _Traits >::operator<< (unsigned long long __n)
[inline],  [inherited]

Integer arithmetic inserters. That's the whole job description. πŸ”’

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


πŸ¦‹ operator<< (unsigned short __n)

template<typename _CharT, typename _Traits> __ostream_type &
std::basic_ostream< _CharT, _Traits >::operator<< (unsigned short __n)
[inline],  [inherited]

Integer arithmetic inserters. Same energy, smaller type. ✨

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.


πŸŽ€ operator>> (__ios_type &(* __pf )(__ios_type &))

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__ios_type &(* __pf
)(__ios_type &)) [inline],  [inherited]

Interface for manipulators, okay? Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. It's giving "middleware for vibes". 🌈


🧚 operator>> (__istream_type &(* __pf )(__istream_type &))

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (__istream_type &(*
__pf )(__istream_type &)) [inline],  [inherited]

Interface for manipulators. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. Twin of the one above, different function-pointer shape, same slay. πŸ’œ


πŸ”₯ operator>> (__streambuf_type * __sb)

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::operator>> (__streambuf_type *
__sb) [inherited]

Extracting into another streambuf. Basically piping, but make it C++.

Parameters

  • __sb β€” a pointer to a streambuf.

This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.

If __sb is NULL, the stream will set failbit in its error state.

Characters are extracted from this stream and inserted into the __sb streambuf until one of the following occurs:

  • the input stream reaches end-of-file,
  • insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted), or
  • an exception occurs (and in this case is caught)

If the function inserts no characters, failbit is set.

References std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


⭐ operator>> (bool & __n)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (bool & __n) [inline],
[inherited]

Integer arithmetic extractors. Yes, bool is living under the integer umbrella here. That's the lore. 😌

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


πŸ’– operator>> (double & __f)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (double & __f)
[inline],  [inherited]

Floating point arithmetic extractors. Decimals, bestie. πŸ“

Parameters

  • __f β€” a variable of builtin floating point type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


πŸŽ€ operator>> (float & __f)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (float & __f)
[inline],  [inherited]

Floating point arithmetic extractors. Same deal, smaller footprint. ✨

Parameters

  • __f β€” a variable of builtin floating point type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


πŸ’… operator>> (int & __n)

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::operator>> (int & __n)
[inherited]

Integer arithmetic extractors. The classic. The original. The main character. πŸ‘‘

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


🌈 operator>> (ios_base &(* __pf )(ios_base &))

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (ios_base &(* __pf
)(ios_base &)) [inline],  [inherited]

Interface for manipulators. Manipulators such as std::ws and std::dec use these functions in constructs like std::cin >> std::ws. For more information, see the iomanip header. Third member of the manipulator trio, no cap. 🫢


πŸ¦‹ operator>> (long & __n)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long & __n) [inline],
[inherited]

Integer arithmetic extractors. Long. Not short. Important distinction, iykyk. 😭

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


🧚 operator>> (long double & __f)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long double & __f)
[inline],  [inherited]

Floating point arithmetic extractors. Maximum precision princess energy. πŸ’œ

Parameters

  • __f β€” a variable of builtin floating point type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


⭐ operator>> (long long & __n)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (long long & __n)
[inline],  [inherited]

Integer arithmetic extractors. Big numbers, big feelings. πŸ”₯

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


πŸ’€ operator>> (short & __n)

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::operator>> (short & __n)
[inherited]

Integer arithmetic extractors. And this one comes with a receipts list, so pay attention. πŸ“

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.

References std::ios_base::badbit, std::ios_base::failbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::setstate(), and std::use_facet().


🌸 operator>> (unsigned int & __n)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned int & __n)
[inline],  [inherited]

Integer arithmetic extractors. No negatives allowed, we're keeping it positive. ✨

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


πŸŽ€ operator>> (unsigned long & __n)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long & __n)
[inline],  [inherited]

Integer arithmetic extractors. Still unsigned, still unbothered. πŸ’…

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


🫢 operator>> (unsigned long long & __n)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned long long &
__n) [inline],  [inherited]

Integer arithmetic extractors. The biggest unsigned one, and it ate. πŸ‘‘

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


πŸ¦‹ operator>> (unsigned short & __n)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (unsigned short & __n)
[inline],  [inherited]

Integer arithmetic extractors. Tiny, unsigned, doing her best. πŸ₯Ί

Parameters

  • __n β€” a variable of builtin integral type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


🌈 operator>> (void *& __p)

template<typename _CharT, typename _Traits> __istream_type &
std::basic_istream< _CharT, _Traits >::operator>> (void *& __p)
[inline],  [inherited]

Basic arithmetic extractors. Note it says basic, not integer β€” pointers get their own little label. 🎯

Parameters

  • __p β€” a variable of pointer type.

Returns

*this if successful.

These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.


πŸ‘€ peek (void)

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits
>::int_type std::basic_istream< _CharT, _Traits >::peek (void )
[inherited]

Looking ahead in the stream. Like reading the group chat before you reply. πŸ™ˆ

Returns

The next character, or eof().

If, after constructing the sentry object, good() is false, returns traits::eof(). Otherwise reads but does not extract the next input character.

References _M_gcount, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdbuf().


πŸ’œ std::ios_base::precision () const

streamsize std::ios_base::precision () const [inline],  [nodiscard],
[inherited]

Flags access. Just a lil getter, living her life.

Returns

The precision to generate on certain output operations.

Be careful if you try to give a definition of precision here; see DR 189.

Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), and std::chrono::operator<<().


πŸ’… std::ios_base::precision (streamsize __prec)

streamsize std::ios_base::precision (streamsize __prec) [inline],
[inherited]

Changing flags. The setter. She takes, she gives back. πŸ”„

Parameters

  • __prec β€” the new precision value.

Returns

The previous value of precision().


🌟 put (char_type __c)

template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits >
& std::basic_ostream< _CharT, _Traits >::put (char_type __c) [inherited]

Simple insertion. One character. That's it. That's the function. πŸŽ€

Parameters

  • __c β€” the character to insert.

Returns

*this

Tries to insert __c.

Note: This function is not overloaded on signed char and unsigned char.

References std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by std::endl(), and std::ends().


πŸ“ putback (char_type __c)

template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
& std::basic_istream< _CharT, _Traits >::putback (char_type __c)
[inherited]

Unextracting a single character. Putting it back. Un-eating the snack. 😭

Parameters

  • __c β€” the character to push back into the input stream.

Returns

*this

If rdbuf() is not null, calls rdbuf()->sputbackc(c).

If rdbuf() is null or if sputbackc() fails, sets badbit in the error state.

Note: This function first clears eofbit. Since no characters are extracted, the next call to gcount() will return 0, as required by DR 60.
continuing from the previous part, no biggie πŸ’–

References _M_gcount, std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().

Referenced by std::operator<<().


🫢 void *& std::ios_base::pword (int __ix) [inline], [inherited]

Access to the void pointer array. bestie this is the little drawer of mystery pointers ✨

Parameters

  • __ix β€” index into the array.

Returns

A reference to a void* associated with the index.

So basically the pword function gives you access to an array of pointers that you can use for literally anything. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.

🚨 okay listen up: the implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference. Not me warning you twice, it's that serious 😭

πŸ¦‹ template<typename _CharT, typename _Traits> basic_streambuf< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::rdbuf (basic_streambuf< _CharT, _Traits > * __sb) [inherited]

Changing the underlying buffer. glow-up for your stream ✨

Parameters

  • __sb β€” the new stream buffer.

Returns

The previous stream buffer.

It associates a new buffer with the current stream, and clears the error state. Clean slate energy πŸ’…

πŸ’€ okay so, tea time: due to historical accidents which the LWG refuses to correct, the I/O library suffers from a design error β€” this function is hidden in derived classes by overrides of the zero-argument rdbuf(), which is non-virtual for hysterical raisins. As a result, you must use explicit qualifications to access this function via any derived class. For example:
std::fstream     foo;         // or some other derived type
std::streambuf*  p = .....;

foo.ios::rdbuf(p);            // ios == basic_ios<char>

References clear().


🌸 template<typename _CharT, typename _Traits, typename _Alloc> __stringbuf_type * std::basic_stringstream< _CharT, _Traits, _Alloc >::rdbuf () const [inline], [nodiscard]

Accessing the underlying buffer. peek at what's underneath, no cap πŸ‘€

Returns

The current basic_stringbuf buffer.

Heads up: this hides both signatures of std::basic_ios::rdbuf(). Sneaky iconic behaviour fr fr.


🌈 template<typename _CharT, typename _Traits> iostate std::basic_ios< _CharT, _Traits >::rdstate () const [inline], [nodiscard], [inherited]

Returns the error state of the stream buffer.

Returns

A bit pattern (well, isn't everything? 😭)

See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good(). iykyk.

Referenced by std::basic_ios< char_type, traits_type >::bad(), clear(), std::basic_ios< char_type, traits_type >::eof(), std::basic_ios< char_type, traits_type >::fail(), std::basic_ios< char_type, traits_type >::good(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< char_type, traits_type >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().


πŸŽ€ template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::read (char_type * __s, streamsize __n) [inherited]

Extraction without delimiters. just raw grabbing, no filter ✨

Parameters

  • __s β€” a character array.
  • __n β€” maximum number of characters to store.

Returns

*this

If the stream state is good(), it extracts characters and stores them into __s until one of the following happens:

  • __n characters are stored
  • the input sequence reaches end-of-file, in which case the error state is set to failbit|eofbit.
πŸ™ˆ Note: this function is not overloaded on signed char and unsigned char.

References _M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


🧚 template<typename _CharT, typename _Traits> streamsize std::basic_istream< _CharT, _Traits >::readsome (char_type * __s, streamsize __n) [inherited]

Extraction until the buffer is exhausted, but no more. it's giving "take what's there and don't be greedy" πŸ’…

Parameters

  • __s β€” a character array.
  • __n β€” maximum number of characters to store.

Returns

The number of characters extracted.

It extracts characters and stores them into __s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:

  • if A == -1, sets eofbit and extracts no characters
  • if A == 0, extracts no characters
  • if A > 0, extracts min(A,n)

The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf. Very "we're not asking for more, we're just clearing the vibes" 🌸

References _M_gcount, std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


πŸ’œ void std::ios_base::register_callback (event_callback __fn, int __index) [inherited]

Add the callback __fn with parameter __index.

Parameters

  • __fn β€” the function to add.
  • __index β€” the integer to pass to the function when invoked.

It registers a function as an event callback with an integer parameter to be passed to the function when invoked. Multiple copies of the function are allowed. If there are multiple callbacks, they are invoked in the order they were registered. First come, first served, periodt πŸ‘‘


⭐ template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (off_type __off, ios_base::seekdir __dir) [inherited]

Changing the current read position. teleporting your read cursor, iconic ✨

Parameters

  • __off β€” a file offset object.
  • __dir β€” the direction in which to seek.

Returns

*this

If fail() is not true, it calls rdbuf()->pubseekoff(__off,__dir). If that function fails, it sets failbit.

😭 Note: this function first clears eofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

References std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().


πŸ’– template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg (pos_type __pos) [inherited]

Changing the current read position. same vibe, different arg, we love a duo 🫢

Parameters

  • __pos β€” a file position object.

Returns

*this

If fail() is not true, it calls rdbuf()->pubseekpos(__pos). If that function fails, it sets failbit.

😭 Note: this function first clears eofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

References std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_ios< _CharT, _Traits >::setstate().


πŸ“ template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (off_type __off, ios_base::seekdir __dir) [inherited]

Changing the current write position. now we're moving the write cursor, slay ✨

Parameters

  • __off β€” a file offset object.
  • __dir β€” the direction in which to seek.

Returns

*this

If fail() is not true, it calls rdbuf()->pubseekoff(off,dir). If that function fails, it sets failbit.

References std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


πŸ¦„ template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits > & std::basic_ostream< _CharT, _Traits >::seekp (pos_type __pos) [inherited]

Changing the current write position. yes bestie, there's two of them πŸ’…

Parameters

  • __pos β€” a file position object.

Returns

*this

If fail() is not true, it calls rdbuf()->pubseekpos(pos). If that function fails, it sets failbit.

References std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::failbit, std::ios_base::out, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


🌟 fmtflags std::ios_base::setf (fmtflags __fmtfl) [inline], [inherited]

Setting new format flags. adding to the aesthetic, not replacing it πŸŽ€

Parameters

  • __fmtfl β€” additional flags to set.

Returns

The previous format control flags.

This function sets additional flags in format control. Flags that were previously set remain set. No take-backs, no clearing, we're just adding πŸ’–

Referenced by std::__detail::operator>>().


✨ fmtflags std::ios_base::setf (fmtflags __fmtfl, fmtflags __mask) [inline], [inherited]

Setting new format flags. the masked version, main character energy πŸ‘‘

Parameters

  • __fmtfl β€” additional flags to set.
  • __mask β€” the flags mask for fmtfl.

Returns

The previous format control flags.

This function clears mask in the format flags, then sets fmtfl & mask. An example mask is ios_base::adjustfield. Clean out the old, slide in the new 🌈


πŸ’« template<typename _CharT, typename _Traits> void std::basic_ios< _CharT, _Traits >::setstate (iostate __state) [inline], [inherited]

Sets additional flags in the error state. more flags, more drama, love that for us 😭

Parameters

  • __state β€” the additional state flag(s) to set.

See std::ios_base::iostate for the possible bit values.


okay that's the end of this chunk, keep scrolling bestie, we're not done yet 🫢

  • Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry(), std::basic_fstream< char >::close(), std::basic_ifstream< char >::close(), std::basic_ofstream< char >::close(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::getline(), std::getline(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::operator<<(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::tr2::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::sync(), and std::ws().
template<typename _CharT, typename _Traits, typename _Alloc> __string_type
    std::basic_stringstream< _CharT, _Traits, _Alloc >::str () const &
    [inline],  [nodiscard]

okay so this one is literally just copying out the string buffer. that's it. that's the whole vibe. πŸ’–

Returns

rdbuf()->str()


template<typename _CharT, typename _Traits, typename _Alloc> void
    std::basic_stringstream< _CharT, _Traits, _Alloc >::str (const
    __string_type & __s) [inline]

setting a new buffer, bestie. you're swapping in a whole new string. πŸŽ€

Parameters

  • __s β€” the string to use as a new sequence.

Calls rdbuf()->str(s).


template<typename _CharT, typename _Traits> int std::basic_istream< _CharT,
    _Traits >::sync (void ) [inherited]

Synchronizing the stream buffer. it's giving "make the buffer agree with reality". ✨

Returns

0 on success, -1 on failure

If rdbuf() is a null pointer, returns -1.

Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.

Otherwise, returns 0.

Note β€” this function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount(). so don't come for gcount's count, they're unrelated fr fr.

References std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().


bool std::ios_base::sync_with_stdio (bool __sync = true) [static],
    [inherited]

Interaction with the standard C I/O objects. the C world and the C++ world, finally in the same group chat. πŸ’…

Parameters

  • __sync β€” whether to synchronize or not.

Returns

True if the standard streams were previously synchronized.

The synchronization referred to is only that between the standard C facilities (e.g., stdout) and the standard C++ objects (e.g., cout). User-declared streams are unaffected. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary


template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits
    >::pos_type std::basic_istream< _CharT, _Traits >::tellg (void )
    [inherited]

Getting the current read position. where are we reading rn bestie πŸ“

Returns

A file position object.

If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).

Note β€” this function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount(). At variance with putback, unget and seekg, eofbit is not cleared first. lowkey a little unhinged of it but okay πŸ‘‘

References std::ios_base::badbit, std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::in, and std::basic_ios< _CharT, _Traits >::rdbuf().


template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits
    >::pos_type std::basic_ostream< _CharT, _Traits >::tellp () [inherited]

Getting the current write position. the writing twin of tellg, iconic behavior ✨

Returns

A file position object.

If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,out).

References std::ios_base::cur, std::basic_ios< _CharT, _Traits >::fail(), std::ios_base::out, and std::basic_ios< _CharT, _Traits >::rdbuf().


template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits >
    * std::basic_ios< _CharT, _Traits >::tie () const [inline],
    [nodiscard],  [inherited]

Fetches the current tied stream. who's holding hands with who 🫢

Returns

A pointer to the tied stream, or NULL if the stream is not tied.

A stream may be tied (or synchronized) to a second output stream. When this stream performs any I/O, the tied stream is first flushed. For example, std::cin is tied to std::cout. the way that cin just flushes cout before it does anything… main character energy fr.

Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry(), and copyfmt().


template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits >
    * std::basic_ios< _CharT, _Traits >::tie (basic_ostream< _CharT, _Traits
    > * __tiestr) [inline],  [inherited]

Ties this stream to an output stream. making it official πŸ’

Parameters

  • __tiestr β€” the output stream.

Returns

The previously tied output stream, or NULL if the stream was not tied.

This sets up a new tie; see tie() for more.</pruple>


template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits >
    & std::basic_istream< _CharT, _Traits >::unget (void ) [inherited]

Unextracting the previous character. the undo button, bestie βͺ

Returns

*this

If rdbuf() is not null, calls rdbuf()->sungetc(c).

If rdbuf() is null or if sungetc() fails, sets badbit in the error state.

Note β€” this function first clears eofbit. Since no characters are extracted, the next call to gcount() will return 0, as required by DR 60.

References _M_gcount, std::ios_base::badbit, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::rdstate(), and std::basic_streambuf< _CharT, _Traits >::sungetc().

Referenced by std::__detail::operator>>().


void std::ios_base::unsetf (fmtflags __mask) [inline],  [inherited]

Clearing format flags. not me unsetting the vibe πŸ’€

Parameters

  • __mask β€” the flags to unset.

This function clears __mask in the format flags.


template<typename _CharT, typename _Traits> char_type std::basic_ios<
    _CharT, _Traits >::widen (char __c) const [inline],  [inherited]

Widens characters. glow-up but for a single char πŸ¦‹

Parameters

  • __c β€” the character to widen.

Returns

The widened character.

Maps a character of char to a character of char_type.

Returns the result of

std::use_facet<ctype<char_type> >(getloc()).widen(c)

Additional l10n notes are at https://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html

Referenced by std::endl(), std::basic_ios< char_type, traits_type >::fill(), std::basic_istream< char_type, traits_type >::get(), std::basic_istream< char_type, traits_type >::get(), std::basic_istream< char_type, traits_type >::getline(), std::getline(), std::getline(), std::operator<<(), std::operator<<(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<, and std::tr2::operator>>().


streamsize std::ios_base::width () const [inline],  [nodiscard],
    [inherited]

Flags access. how wide are we printing, bestie πŸ“

Returns

The minimum field width to generate on output operations.

Minimum field width refers to the number of characters.

Referenced by std::basic_ios< _CharT, _Traits >::copyfmt(), std::num_put< _CharT, _OutIter >::do_put(), std::operator>>(), and std::operator>>().


streamsize std::ios_base::width (streamsize __wide) [inline],  [inherited]

Changing flags. setting the width now ✨

Parameters

  • __wide β€” the new width value.

Returns

The previous value of width().


template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits >
    & std::basic_ostream< _CharT, _Traits >::write (const char_type * __s,
    streamsize __n) [inherited]

Character string insertion. shoving a whole string in, slay πŸ’…

Parameters

  • __s β€” the array to insert.
  • __n β€” maximum number of characters to insert.

Returns

*this

Characters are copied from __s and inserted into the stream until one of the following happens:

  • __n characters are inserted
  • inserting into the output sequence fails (in this case, badbit will be set in the stream's error state)
Note β€” this function is not overloaded on signed char and unsigned char. she said pick a lane πŸ™ˆ

int std::ios_base::xalloc () [static],  [inherited]

Access to unique indices. handing out numbered seats so nobody fights 🎟️

Returns

An integer different from all previous calls.

This function returns a unique integer every time it is called. It can be used for any purpose, but is primarily intended to be a unique index for the iword and pword functions. The expectation is that an application calls xalloc in order to obtain an index in the iword and pword arrays that can be used without fear of conflict.

The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays. no cap.


πŸ’– Member Data Documentation πŸ’–

template<typename _CharT, typename _Traits> streamsize std::basic_istream<
    _CharT, _Traits >::_M_gcount [protected],  [inherited]

The number of characters extracted in the previous unformatted function; see gcount(). she's keeping receipts πŸ“

Referenced by get(), get(), get(), get(), ignore(), ignore(), ignore(), peek(), putback(), read(), readsome(), and unget().


const fmtflags std::ios_base::adjustfield [static],  [inherited]

A mask of left|right|internal. useful for the 2-arg form of setf.

Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::internal(), std::left(), and std::right().


const openmode std::ios_base::app [static],  [inherited]

Seek to end before each write. yes, each one, she's persistent πŸŽ€

Referenced by std::basic_filebuf< char_type, traits_type >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::overflow(), and std::basic_filebuf< _CharT, _Traits >::xsputn().


const openmode std::ios_base::ate [static],  [inherited]

Open and seek to end immediately after opening. one and done, different from app, don't mix them up bestie 😭

Referenced by std::basic_filebuf< _CharT, _Traits >::open().


const iostate std::ios_base::badbit [static],  [inherited]

Indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file). this one is serious. badbit means things went actually wrong, not just "oops end of file". πŸ’€

Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::basic_ios< _CharT, _Traits >::clear(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_iostream< char_type, traits_type >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_iostream< char_type, traits_type >::operator<<(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, char_traits< _CharT > >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().


🌸 const fmtflags std::ios_base::basefield [static], [inherited]

A mask of dec|oct|hex. Bestie, it's genuinely useful for the 2-arg form of setf. πŸ’…

Referenced by std::dec(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), std::hex(), and std::oct().

🌈 const seekdir std::ios_base::beg [static], [inherited]

Asks for a seek relative to the beginning of the stream. Head empty, cursor at zero. ✨

Referenced by std::basic_filebuf< _CharT, _Traits >::seekpos().

πŸ¦‹ const openmode std::ios_base::binary [static], [inherited]

Does input and output in binary mode (as opposed to text mode). And okay so β€” this is probably not what you think it is; go read https://gcc.gnu.org/onlinedocs/libstdc++/manual/fstreams.html#std.io.filestreams.binary. Do not skip this, I'm so serious. 😭

Referenced by std::basic_filebuf< _CharT, _Traits >::showmanyc().

πŸŽ€ const fmtflags std::ios_base::boolalpha [static], [inherited]

Insert/extract bool in alphabetic rather than numeric format. So like true instead of 1. Iconic behaviour, no notes. πŸ‘‘

Referenced by std::boolalpha(), std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::noboolalpha().

πŸ’œ const seekdir std::ios_base::cur [static], [inherited]

Requests a seek relative to the current position within the sequence. Staying in the present moment, very mindful of it. 🧘

Referenced by std::basic_filebuf< _CharT, _Traits >::imbue(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_filebuf< _CharT, _Traits >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_istream< _CharT, _Traits >::tellg(), and std::basic_ostream< _CharT, _Traits >::tellp().

⭐ const fmtflags std::ios_base::dec [static], [inherited]

Converts integer input, or generates integer output, in decimal base. The default vibe, the people's choice. πŸ’…

Referenced by std::dec(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<, and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator>>.

🌸 const seekdir std::ios_base::end [static], [inherited]

Requests a seek relative to the current end of the sequence. Going straight to the end, we love a dramatic entrance. 🎬

Referenced by std::basic_filebuf< _CharT, _Traits >::open(), and std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff().

πŸ’€ const iostate std::ios_base::eofbit [static], [inherited]

Indicates that an input operation reached the end of an input sequence. It's giving "we've read everything, bestie, there is no more." 😭

Referenced by std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_date(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_time(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, char_traits< _CharT > >::peek(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, char_traits< _CharT > >::seekg(), std::basic_istream< _CharT, _Traits >::unget(), std::basic_istream< _CharT, char_traits< _CharT > >::unget(), and std::ws().

😭 const iostate std::ios_base::failbit [static], [inherited]

Indicates that an input operation failed to read the expected characters, or that an output operation failed to generate the desired characters. The "we tried and it did not work out" flag. We've all been there. πŸ’”

Referenced by std::basic_ostream< _CharT, _Traits >::sentry::sentry(), std::basic_fstream< char >::close(), std::basic_ifstream< char >::close(), std::basic_ofstream< char >::close(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::operator<<(), std::basic_iostream< char_type, traits_type >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ostream< _CharT, _Traits >::seekp(), and std::basic_ostream< _CharT, _Traits >::seekp().

πŸ“ const fmtflags std::ios_base::fixed [static], [inherited]

Generates floating-point output in fixed-point notation. Locked in. No drifting off into exponent-land. πŸ“Œ

Referenced by std::fixed(), and std::hexfloat().

🧚 const fmtflags std::ios_base::floatfield [static], [inherited]

A mask of scientific|fixed. Useful for the 2-arg form of setf. The floaty little mask that could. 🫢

Referenced by std::defaultfloat(), std::fixed(), std::hexfloat(), and std::scientific().

✨ const iostate std::ios_base::goodbit [static], [inherited]

Indicates all is well. The no-thoughts-just-vibes state. When this is set, bestie, we are thriving. πŸ’–

Referenced by std::basic_istream< _CharT, _Traits >::sentry::sentry(), std::num_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get(), std::time_get< _CharT, _InIter >::do_get_monthname(), std::time_get< _CharT, _InIter >::do_get_weekday(), std::time_get< _CharT, _InIter >::do_get_year(), std::basic_ostream< _CharT, _Traits >::flush(), std::basic_iostream< char_type, traits_type >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::get(), std::time_get< _CharT, _InIter >::get(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_iostream< char_type, traits_type >::operator<<(), std::basic_ostream< _CharT, _Traits >::operator<<(), std::basic_iostream< char_type, traits_type >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::basic_istream< _CharT, _Traits >::peek(), std::basic_ostream< _CharT, _Traits >::put(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws().

πŸ”₯ const fmtflags std::ios_base::hex [static], [inherited]

Converts integer input, or generates integer output, in hexadecimal base. 0x-core aesthetic, honestly. πŸŽ€

Referenced by std::num_get< _CharT, _InIter >::do_get(), std::num_put< _CharT, _OutIter >::do_put(), and std::hex().

πŸ’– const openmode std::ios_base::in [static], [inherited]

Open for input. Default for ifstream and fstream. The moment you open a file expecting to read it, this is the one carrying the whole operation. πŸ‘‘

Referenced by std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_ifstream< char >::basic_ifstream(), std::basic_istringstream< char >::basic_istringstream(), std::basic_stringbuf< char >::basic_stringbuf(), std::basic_stringstream< char >::basic_stringstream(), std::basic_filebuf< char_type, traits_type >::_M_set_buffer(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_ifstream< char >::open(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_filebuf< _CharT, _Traits >::pbackfail(), std::basic_streambuf< char_type, traits_type >::pubseekoff(), std::basic_streambuf< char_type, traits_type >::pubseekpos(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_streambuf< char_type, traits_type >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< char >::seekoff(), std::basic_streambuf< char_type, traits_type >::seekpos(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_stringbuf< char >::seekpos(), std::basic_filebuf< _CharT, _Traits >::showmanyc(), std::basic_stringbuf< char >::showmanyc(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_filebuf< _CharT, _Traits >::underflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::underflow(), and std::basic_filebuf< _CharT, _Traits >::xsgetn().

πŸ¦‹ const fmtflags std::ios_base::internal [static], [inherited]

Adds fill characters at a designated internal point in certain generated output β€” or, if no such point is designated, it's identical to right. Very "I'll be specific if you let me, otherwise I'll just be right." 🫢

Referenced by std::internal().

🌸 const fmtflags std::ios_base::left [static], [inherited]

Adds fill characters on the right (final positions) of certain generated output. I.e., the thing you print is flush left. So the padding goes after, not before. Slay. πŸ’…

Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::left(), and std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator<<.

🌈 const fmtflags std::ios_base::oct [static], [inherited]

Converts integer input, or generates integer output, in octal base. The base-eight girlies stay underrated, ngl. πŸ™

Referenced by std::oct().

  • const openmode std::ios_base::out [static], [inherited] β€” bestie this is the output flag πŸ’š opens the thing for writing. It's the default for ofstream and fstream, so those two just wake up in output mode, no cap.

Referenced by std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_fstream< char >::basic_fstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ofstream< char >::basic_ofstream(), std::basic_ostringstream< char >::basic_ostringstream(), std::basic_stringbuf< char >::basic_stringbuf(), std::basic_stringstream< char >::basic_stringstream(), std::basic_filebuf< char_type, traits_type >::_M_set_buffer(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_fstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_ofstream< char >::open(), std::basic_filebuf< _CharT, _Traits >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::overflow(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::pbackfail(), std::basic_streambuf< char_type, traits_type >::pubseekoff(), std::basic_streambuf< char_type, traits_type >::pubseekpos(), std::basic_streambuf< char_type, traits_type >::seekoff(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekoff(), std::basic_stringbuf< char >::seekoff(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_streambuf< char_type, traits_type >::seekpos(), std::basic_stringbuf< _CharT, _Traits, _Alloc >::seekpos(), std::basic_stringbuf< char >::seekpos(), std::basic_ostream< _CharT, _Traits >::tellp(), and std::basic_filebuf< _CharT, _Traits >::xsputn().

  • const fmtflags std::ios_base::right [static], [inherited] β€” pushes the fill characters onto the left (the initial positions) of certain generated output. So like, the thing you print is flush right. it's giving justified text but make it ✨aesthetic✨.

Referenced by std::right().

  • const fmtflags std::ios_base::scientific [static], [inherited] β€” floating-point output, but make it science πŸ”¬ notation, babe.

Referenced by std::hexfloat(), and std::scientific().

  • const fmtflags std::ios_base::showbase [static], [inherited] β€” drops a lil prefix on your integer output telling everyone which numeric base it's in. 0x girlies know πŸ‘‘

Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::noshowbase(), and std::showbase().

  • const fmtflags std::ios_base::showpoint [static], [inherited] β€” forces a decimal-point character into your floating-point output no matter what. no skipping it, we're showing up πŸ’…

Referenced by std::noshowpoint(), and std::showpoint().

  • const fmtflags std::ios_base::showpos [static], [inherited] β€” puts a + sign on non-negative numeric output. positivity era fr fr 🌈

Referenced by std::noshowpos(), and std::showpos().

  • const fmtflags std::ios_base::skipws [static], [inherited] β€” skips the leading white space before certain input operations. lowkey the reason your cin >> just works.

Referenced by std::noskipws(), std::__detail::operator>>(), std::philox_engine< uint_fast32_t, 32, 4, 10, 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85 >::operator>>, and std::skipws().

  • const openmode std::ios_base::trunc [static], [inherited] β€” truncates an existing stream when opening. It's the default for ofstream. So yeah bestie, if you open a file that already exists, the old contents are gone gone β€” this is the flag that ate πŸ’€
  • const fmtflags std::ios_base::unitbuf [static], [inherited] β€” flushes output after each output operation. obsessive? yes. thorough? also yes 🫢

Referenced by std::basic_ostream< _CharT, _Traits >::sentry::~sentry(), std::nounitbuf(), and std::unitbuf().

  • const fmtflags std::ios_base::uppercase [static], [inherited] β€” swaps certain lowercase letters for their UPPERCASE equivalents in generated output. the caps lock of format flags, iconic honestly.

Referenced by std::num_put< _CharT, _OutIter >::do_put(), std::nouppercase(), and std::uppercase().


πŸ’– Author πŸ’–

Generated automatically by Doxygen for libstdc++ from the source code. Not a human writing this one, just a robot doing its little thing πŸŽ€


and that's a wrap on the whole page, bestie!! 🌸 thank you for reading all the way through, you're literally the main character for that. this page came to you from libstdc++, and it's the std::basic..., _Alloc >(3) manual page β€” that trailing (3) is just the section number, iykyk. mwah, go compile something gorgeous πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms