STD::WIOS(3)

πŸŽ€ std::basic_ios< _CharT, _Traits > πŸŽ€

okay so this is straight out of the Library Functions Manual, and bestie, we're opening with a genuine banger. This is std::basic_ios< _CharT, _Traits > β€” the template class that's lowkey the blueprint for every stream class you've ever met. πŸ’…

πŸ’– NAME πŸ’–

std::basic_ios< _CharT, _Traits > β€” Template class basic_ios, the virtual base class for all stream classes. That's the whole name section. Iconic brevity, no notes. ✨

🌈 SYNOPSIS 🌈

#include <ios>

Inherits std::ios_base.

Inherited by std::basic_istream< char > [virtual], std::basic_istream< wchar_t > [virtual], std::basic_ostream< char > [virtual], std::basic_ostream< wchar_t > [virtual], std::basic_istream< _CharT, _Traits > [virtual], and std::basic_ostream< _CharT, _Traits > [virtual].

look at that inheritance tree. the way it's literally everyone's parent. main character energy fr fr. πŸ‘‘


πŸ¦‹ Public Types πŸ¦‹

  • enum event { erase_event, imbue_event, copyfmt_event } β€” the little roster of events that might get passed to an event callback.
  • typedef void(* event_callback) (event __e, ios_base &__b, int __i) β€” what an event callback function looks like, type-wise.
  • typedef _Ios_Fmtflags fmtflags β€” this is a bitmask type.
  • typedef _Ios_Iostate iostate β€” this is a bitmask type too.
  • typedef _Ios_Openmode openmode β€” yep, also a bitmask type.
  • typedef _Ios_Seekdir seekdir β€” and this one is an enumerated type.
  • typedef _CharT char_type
  • typedef _Traits::int_type int_type
  • typedef _Traits::pos_type pos_type
  • typedef _Traits::off_type off_type
  • typedef _Traits traits_type
  • typedef ctype< _CharT > __ctype_type
  • typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > __num_put_type
  • typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > __num_get_type

πŸ’œ Public Member Functions πŸ’œ

  • basic_ios (basic_streambuf< _CharT, _Traits > *__sb) β€” the constructor, and it does the initialization for you. 🫢
  • virtual ~basic_ios () β€” Empty. That's the whole description. It's giving minimalism. πŸ’€
  • const locale & _M_getloc () const β€” locale access.
  • void _M_setstate (iostate __state) β€” (no description given, it just does its thing)
  • bool bad () const β€” fast error checking.
  • void clear (iostate __state=goodbit) β€” [re]sets the error state.
  • basic_ios & copyfmt (const basic_ios &__rhs) β€” copies the 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.
  • 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, boom.
  • locale getloc () const β€” locale access.
  • bool good () const β€” fast error checking.
  • locale imbue (const locale &__loc) β€” moves to a new locale.
  • long & iword (int __ix) β€” access to the integer array.
  • char narrow (char_type __c, char __dfault) const β€” squeezes characters.
  • streamsize precision () const β€” flags access.
  • streamsize precision (streamsize __prec) β€” changing flags.
  • void *& pword (int __ix) β€” access to the void pointer array.
  • basic_streambuf< _CharT, _Traits > * rdbuf () const β€” accessing the underlying buffer.
  • basic_streambuf< _CharT, _Traits > * rdbuf (basic_streambuf< _CharT, _Traits > *__sb) β€” changing the underlying buffer.
  • iostate rdstate () const β€” returns the error state of the stream buffer.
  • void register_callback (event_callback __fn, int __index) β€” adds the callback __fn with parameter __index.
  • 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.
  • 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.
  • void unsetf (fmtflags __mask) β€” clearing format flags.
  • char_type widen (char __c) const β€” widens characters.
  • streamsize width () const β€” flags access.
  • streamsize width (streamsize __wide) β€” changing flags.
  • operator bool () const β€” the quick-and-easy status check. ✨
  • bool operator! () const β€” the quick-and-easy status check.

🌸 Static Public Member Functions 🌸

  • static bool sync_with_stdio (bool __sync=true) β€” interaction with the standard C I/O objects.
  • static int xalloc () throw () β€” access to unique indices.

⭐ Static Public Attributes ⭐

  • static const openmode __noreplace β€” (no description given)
  • static const fmtflags adjustfield β€” a mask of left|right|internal. Useful for the 2-arg form of setf.
  • static const openmode app β€” seek to end before each write.
  • static const openmode ate β€” open and seek to end immediately after opening.
  • static const iostate badbit β€” indicates a loss of integrity in an input or output sequence (such as an irrecoverable read error from a file).
  • static const fmtflags basefield β€” a mask of dec|oct|hex. Useful for the 2-arg form of setf.
  • static const seekdir beg β€” request a seek relative to the beginning of the stream.
  • 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.
  • static const fmtflags boolalpha β€” insert/extract bool in alphabetic rather than numeric format.
  • static const seekdir cur β€” request a seek relative to the current position within the sequence.
  • static const fmtflags dec β€” converts integer input or generates integer output in decimal base.
  • static const seekdir end β€” request a seek relative to the current end of the sequence.
  • static const iostate eofbit β€” indicates that an input operation reached the end of an input sequence.
  • 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.
  • static const fmtflags fixed β€” generate floating-point output in fixed-point notation.
  • static const fmtflags floatfield β€” a mask of scientific|fixed. Useful for the 2-arg form of setf.
  • static const iostate goodbit β€” indicates all is well. 🫢 (the vibes are immaculate)
  • static const fmtflags hex β€” converts integer input or generates integer output in hexadecimal base.
  • static const openmode in β€” open for input. Default for ifstream and fstream.
  • 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.
  • 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.).
  • static const fmtflags oct β€” converts integer input or generates integer output in octal base.
  • static const openmode out β€” open for output. Default for ofstream and fstream.
  • 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.).
  • static const fmtflags scientific β€” generates floating-point output in scientific notation.
  • static const fmtflags showbase β€” generates a prefix indicating the numeric base of generated integer output.
  • static const fmtflags showpoint β€” generates a decimal-point character unconditionally in generated floating-point output.
  • static const fmtflags showpos β€” generates a + sign in non-negative generated numeric output.
  • static const fmtflags skipws β€” skips leading white space before certain input operations.
  • static const openmode trunc β€” truncate an existing stream when opening. Default for ofstream.
  • static const fmtflags unitbuf β€” flushes output after each output operation.
  • static const fmtflags uppercase β€” replaces certain lowercase letters with their uppercase equivalents in generated output.

πŸ”₯ Protected Types πŸ”₯

  • enum { _S_local_word_size }

🧚 Protected Member Functions 🧚

  • basic_ios () β€” Empty.
  • basic_ios (const basic_ios &)=delete
  • void _M_cache_locale (const locale &__loc)
  • void _M_call_callbacks (event __ev) throw ()
  • void _M_dispose_callbacks (void) throw ()
  • _Words & _M_grow_words (int __index, bool __iword)
  • void _M_init () throw ()
  • 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.
  • void move (basic_ios &&__rhs)
  • void move (basic_ios &__rhs)
  • basic_ios & operator= (const basic_ios &)=delete
  • void set_rdbuf (basic_streambuf< _CharT, _Traits > *__sb)
  • void swap (basic_ios &__rhs) noexcept

πŸ’… 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
  • 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>
    class std::basic_ios< _CharT, _Traits >

Template class basic_ios, virtual base class for all stream classes.

🌈 Template Parameters 🌈

  • _CharT β€” type of character stream.
  • _Traits β€” traits for character type, defaults to char_traits<_CharT>.

Most of the member functions called dispatched on stream objects (e.g., std::cout.foo(bar);) are consolidated in this class.


so yeah. everything your stream does, it got it from here. it's literally the mother of all streams and we're obsessed. 🫢✨

✨ Member Typedef Documentation ✨

Ok bestie, this is the nickname wall. These are the little aliases basic_ios gives you so you don't have to type the whole template soup every single time. Some are standard, some are not, and the page is very clear about which is which, so let's not play. πŸ’…


πŸŽ€ __ctype_type

template<typename _CharT, typename _Traits>
typedef ctype<_CharT> std::basic_ios<_CharT, _Traits>::__ctype_type

These are non-standard types. That's the whole note. 🫢

πŸŽ€ __num_get_type

template<typename _CharT, typename _Traits>
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> >
    std::basic_ios<_CharT, _Traits>::__num_get_type

Also non-standard types. Same energy, different alias. ✨

πŸŽ€ __num_put_type

template<typename _CharT, typename _Traits>
typedef num_put<_CharT, ostreambuf_iterator<_CharT, _Traits> >
    std::basic_ios<_CharT, _Traits>::__num_put_type

Non-standard types again. Yes, all three __-prefixed ones are the non-standard squad β€” that's literally why they're hiding behind the double underscore. πŸ’€

πŸ‘‘ char_type

template<typename _CharT, typename _Traits>
typedef _CharT std::basic_ios<_CharT, _Traits>::char_type

Okay so these are the standard types. And what does "standard" buy you, you ask? It permits a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. Translation: you get a portable, blessed way to name things even though the actual guts are implementation-specific. Iconic behavior honestly. 🌈

πŸ’– event_callback β€” inherited

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

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().

πŸ’– fmtflags β€” inherited

typedef _Ios_Fmtflags std::ios_base::fmtflags

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

πŸ‘‘ int_type

template<typename _CharT, typename _Traits>
typedef _Traits::int_type std::basic_ios<_CharT, _Traits>::int_type

Standard type βœ… β€” same deal as char_type: a standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. πŸ¦‹

πŸ’– iostate β€” inherited

typedef _Ios_Iostate std::ios_base::iostate

This is a bitmask type. _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

πŸ‘‘ off_type

template<typename _CharT, typename _Traits>
typedef _Traits::off_type std::basic_ios<_CharT, _Traits>::off_type

Standard type βœ…. Standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. You know the drill, bestie. πŸ’…

πŸ’– openmode β€” inherited

typedef _Ios_Openmode std::ios_base::openmode

This is a 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

πŸ‘‘ pos_type

template<typename _CharT, typename _Traits>
typedef _Traits::pos_type std::basic_ios<_CharT, _Traits>::pos_type

Standard type βœ…. Standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. ✨

πŸ’– seekdir β€” inherited

typedef _Ios_Seekdir std::ios_base::seekdir

This is an enumerated type. _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.

πŸ‘‘ traits_type

template<typename _CharT, typename _Traits>
typedef _Traits std::basic_ios<_CharT, _Traits>::traits_type

Standard type βœ…. Standardized way of referring to names of (or names dependent on) the template parameters, which are specific to the implementation. And that's the whole typedef tour, mwah. 😘


🌸 Member Enumeration Documentation 🌸

🧚 enum std::ios_base::event β€” inherited

The set of events that may be passed to an event callback. So like:

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

Not me thinking this is giving very much "which notification is this" energy. πŸŽ€


πŸ’œ Constructor & Destructor Documentation πŸ’œ

πŸ¦‹ basic_ios(basic_streambuf<_CharT, _Traits> * __sb) β€” [inline], [explicit]

template<typename _CharT, typename _Traits>
std::basic_ios<_CharT, _Traits>::basic_ios (basic_streambuf<_CharT, _Traits> * __sb)

Constructor performs initialization. The parameter is passed by derived streams.

Referenced by copyfmt().

πŸ¦‹ virtual ~basic_ios() β€” [inline], [virtual]

template<typename _CharT, typename _Traits>
virtual std::basic_ios<_CharT, _Traits>::~basic_ios ()

Empty. The destructor does nothing. More specifically, it does not destroy the streambuf held by rdbuf().

Bestie this is a real one β€” do not assume the destructor cleans up your streambuf, because it literally does not. πŸ‘€

πŸ¦‹ basic_ios() β€” [inline], [protected]

template<typename _CharT, typename _Traits>
std::basic_ios<_CharT, _Traits>::basic_ios ()

Empty. The default constructor does nothing and is not normally accessible to users. It's protected, so it's staying in its lane. πŸšͺ


✨ Member Function Documentation ✨

πŸ’… _M_getloc() β€” [inline], [inherited]

const locale & std::ios_base::_M_getloc () const

Locale access. 🌍

Returns

  • A reference to the current locale.

Like getloc above, but returns a reference instead of generating a copy. Cheaper, faster, no cap. πŸ”₯

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().

πŸ’… bad() β€” [inline], [nodiscard]

template<typename _CharT, typename _Traits>
bool std::basic_ios<_CharT, _Traits>::bad () const

Fast error checking. ⚑

Returns

  • True if the badbit is set.

Note that other iostate flags may also be set. So like, bad() being true doesn't mean the others are chilling. πŸ™ˆ

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

πŸ’… clear()

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

[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. (Default is goodbit, so calling clear() bare is giving "reset me pls" 🧼.)

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().

πŸ’… copyfmt()

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

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().

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().

πŸ’… eof() β€” [inline], [nodiscard]

template<typename _CharT, typename _Traits>
bool std::basic_ios<_CharT, _Traits>::eof () const

Fast error checking. ⚑

Returns

  • True if the eofbit is set.

Note that other iostate flags may also be set. πŸ’€

πŸ’… exceptions() β€” [inline], [nodiscard]

template<typename _CharT, typename _Traits>
iostate std::basic_ios<_CharT, _Traits>::exceptions () const

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().

πŸ’… exceptions(iostate __except) β€” [inline]

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

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. πŸ‘€ 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);
}

πŸ’… fail() β€” [inline], [nodiscard]

template<typename _CharT, typename _Traits>
bool std::basic_ios<_CharT, _Traits>::fail () const

Fast error checking. ⚑

Returns

  • True if either the badbit or the failbit is set.

Checking the badbit in fail() is historical practice. Note that other iostate flags may also be set. (Yeah, it's a two-for-one situation. Ancient lore. 🏺)

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().

πŸ’… fill() β€” [inline], [nodiscard]

template<typename _CharT, typename _Traits>
char_type std::basic_ios<_CharT, _Traits>::fill () const

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<<.

πŸ’… fill(char_type __ch) β€” [inline]

template<typename _CharT, typename _Traits>
char_type std::basic_ios<_CharT, _Traits>::fill (char_type __ch)

Sets a new empty character. ✨

okay continuing from literally one breath ago, no re-intro, we're just picking the thread back up 🧡✨

  • __ch β€” the new character. that's the whole input bestie, she's low maintenance πŸ’…

Returns: the previous fill character. yeah she hands you the old one back like a lil souvenir πŸŽ€

The fill character is used to fill out space when P+ characters have been requested (e.g., via setw), Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale. so it's the padding princess of your output stream, iconic behavior fr fr.


πŸ’– fmtflags std::ios_base::flags () const [inline], [nodiscard], [inherited]

Access to format flags.

Returns: the format control flags for both input and output. all of them, at once, in your hands πŸ‘‘

Referenced 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>>. not her being the most popular girl at the function party 😭

πŸ’œ fmtflags std::ios_base::flags (fmtflags __fmtfl) [inline], [inherited]

Setting new format flags all at once. one shot, one kill, no take-backs πŸ”₯

  • __fmtfl β€” the new flags to set.

Returns: the previous format control flags.

This function overwrites all the format flags with __fmtfl. like, every single one. no survivors. so if you had flags you cared about, you better have saved them first bestie πŸ™ˆ

πŸ¦‹ locale std::ios_base::getloc () const [inline], [nodiscard], [inherited]

Locale access.

Returns: a copy of the current locale. a copy, note it, she's not handing you the original.

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]

Fast error checking. she's quick, she's cheap, she's reliable πŸ’…

Returns: True if no error flags are set.

A wrapper around rdstate. basically the glamorous front desk of the error state, translating all the bit nonsense into a yes or no for you.

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> locale std::basic_ios< _CharT, _Traits >::imbue (const locale & __loc)

Moves to a new locale. relocation era πŸ’«

  • __loc β€” the new locale.

Returns: the previous locale.

Calls ios_base::imbue(loc), and if a stream buffer is associated with this stream, calls that buffer's pubimbue(loc). so she tells both the base and the buffer, because leaving anyone out would be rude.

Additional l10n notes are at https://gcc.gnu.org/onlinedocs/libstdc++/manual/localization.html β€” go read them, they're giving very much required reading πŸ“š

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

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

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

All setup is performed here. This is called from the public constructor. It is not virtual and cannot be redefined. so don't even try to override her, she's booked and busy 🚫

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(). everybody and their mother calls init, it's giving main character energy for real πŸ‘‘

πŸ“ long & std::ios_base::iword (int __ix) [inline], [inherited]

Access to integer array.

  • __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. she'll ghost that reference the second the array resizes, no cap πŸ’€

References iword().

Referenced by iword().

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

Squeezes characters. compression moment πŸ—œοΈ

  • __c β€” the character to narrow.
  • __dfault β€” the character to narrow.

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.

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

The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) .... she's the friend who just tells you yes or no, no essay required 🫢

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

The quick-and-easy status check. This allows you to write constructs such as if (!a_stream) ... and while (a_stream) .... same vibe, flipped sign, the mirrored twin πŸ’…

πŸŽ€ streamsize std::ios_base::precision () const [inline], [nodiscard], [inherited]

Flags access.

Returns: the precision to generate on certain output operations.

Be careful if you try to give a definition of precision here; see DR 189. yeah, don't get cute with it, the committee said so πŸ™ˆ

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

πŸ”₯ streamsize std::ios_base::precision (streamsize __prec) [inline], [inherited]

Changing flags.

  • __prec β€” the new precision value.

Returns: the previous value of precision().

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

Access to void pointer array.

  • __ix β€” index into the array.

Returns: a reference to a void* associated with the index.

The pword function provides access to an array of pointers that can be used for any purpose. The array grows as required to hold the supplied index. All pointers 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. same warning as iword, she is NOT playing around bestie 😭

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

Accessing the underlying buffer.

Returns: the current stream buffer.

This does not change the state of the stream. she's just showing you the buffer, no touching, no meddling, purely a look πŸ‘€

Referenced by clear(), std::basic_ostream< _CharT, _Traits >::flush(), 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::getline(), std::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::ignore(), imbue(), std::operator<<(), std::basic_istream< _CharT, _Traits >::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::operator>>(), std::tr2::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_ostream< _CharT, _Traits >::seekp(), std::basic_ostream< _CharT, _Traits >::seekp(), std::basic_istream< _CharT, _Traits >::sync(), std::basic_istream< _CharT, _Traits >::tellg(), std::basic_ostream< _CharT, _Traits >::tellp(), std::basic_istream< _CharT, _Traits >::unget(), and std::ws(). literally everyone. she IS the moment ✨

πŸ‘‘ template<typename _CharT, typename _Traits> basic_streambuf< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::rdbuf (basic_streambuf< _CharT, _Traits > * __sb)

Changing the underlying buffer.

  • __sb β€” the new stream buffer.

Returns: the previous stream buffer.

Associates a new buffer with the current stream, and clears the error state. fresh buffer, fresh start, we love a glow-up 🌸

🚨 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. yes, "hysterical raisins." they really wrote that. and yeah, you HAVE to spell it out or you'll be crying in compiler errors fr fr 😭

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> iostate std::basic_ios< _CharT, _Traits >::rdstate () const [inline], [nodiscard]

Returns the error state of the stream buffer.

Returns: a bit pattern (well, isn't everything?) β€” yes the manpage really is that sassy, we stan a witty doc πŸŽ€

See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good(). like, the raw bits are there if you want them, but the wrappers are the translation service bestie.

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().

🌟 void std::ios_base::register_callback (event_callback __fn, int __index) [inherited]

Add the callback __fn with parameter __index.

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

she signs your callback up for the notification list, and every time something goes down she pings it with that integer. very much "add me to the group chat" energy πŸ’Œ

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.

okay so queue theory but make it C++ ✨ order of registration = order of firing, bestie. No cutting the line πŸ’…

πŸŽ€ fmtflags std::ios_base::setf (fmtflags __fmtfl) [inline], [inherited]

Setting new format flags.

Parameters

  • __fmtfl β€” the extra flags you wanna switch on.

Returns

  • The previous format control flags. (so you can put them back later, iykyk)

This function sets additional flags in format control. Flags that were previously set remain set β€” it's additive, babe, nothing gets yeeted.

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


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

Setting new format flags. Yeah, same name, different energy β€” this one's the two-arg version ✨

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. so it's like, out with the old within the mask, in with the new, and only the overlap counts. slay.


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

Sets additional flags in the error state.

Parameters

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

See std::ios_base::iostate for the possible bit values. go peek at the enum, bestie, the bits are right 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::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().

that reference list is giving "everyone showed up to the party" πŸ’€ literally the whole standard library pulled up

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

Interaction with the standard C I/O objects.

Parameters

  • __sync β€” whether to synchronize or not.

Returns

  • True if the standard streams were previously synchronized. true = "yeah they were already synced before I touched anything" 🫢

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

heads up bestie: it's a static function, so it's the whole-vibe switch, not a per-object thing ✨

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

Fetches the current tied stream.

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. that's the whole reason your prompts show up before your program blocks on input, no cap 😭

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

[nodiscard] means don't just call it and ghost the return value β€” the compiler will side-eye you πŸ’…

πŸ“ template<typename _CharT, typename _Traits> basic_ostream< _CharT, _Traits > * std::basic_ios< _CharT, _Traits >::tie (basic_ostream< _CharT, _Traits > * __tiestr) [inline]

Ties this stream to an output stream.

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. yes it's an overload set, yes it's the same name, no I don't make the rules ✨


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

Clearing format flags.

Parameters

  • __mask β€” the flags to unset.

This function clears __mask in the format flags. the anti-setf. the hater of flags. we love her for it.


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

Widens characters.

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.

Returns

  • The minimum field width to generate on output operations.

Minimum field width refers to the number of characters. not bytes, bestie, 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.

Parameters

  • __wide β€” the new width value.

Returns

  • The previous value of width(). screenshot before you edit, basically πŸ“Έ

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

Access to unique indices.

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. it's your personal locker key in the iword/pword locker room πŸ”

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.


πŸ’– Member Data Documentation πŸ’–

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

A mask of left|right|internal. Useful for the 2-arg form of setf. iykyk β€” the two-arg setf is literally why this mask exists 🫢

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. every. single. write. no skipping πŸ’…

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. note the difference from app: this one's a one-time thing at open, app is every write ✨

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 the serious one, bestie. irrecoverable. the stream is not okay. it's giving "we don't talk about this stream anymore" 😭

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. Useful for the 2-arg form of setf. the number-base trio, all masked up together 🫢

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]

Request a seek relative to the beginning of the stream.

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


⭐ const openmode std::ios_base::binary [static], [inherited]

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.

fr fr, read the link. the manpage is literally telling you your mental model is off. that's a rare and precious warning, don't skip it πŸ’›

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/false instead of 1/0. cute, right? πŸŽ€

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]

Request a seek relative to the current position within the sequence.

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. base ten, the people's base πŸ’…

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]

Request a seek relative to the current end of the sequence. the current end. as in, wherever the end is right now, go from there ✨

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.

okay so picking up EXACTLY where we left off πŸ’… β€” the referenced-by roll call for the last constant just keeps going, and bestie, it is a lot. Same energy, no cuts, here's every single one:

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().


✨ failbit ✨

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

not me putting the sad flag first 😭 this one flags that an input operation failed to read the characters it was supposed to read, or that an output operation failed to generate the characters you wanted it to. it's giving "the vibes were off" but for your stream.

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().


🌸 fixed 🌸

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

makes floating-point output come out in fixed-point notation. no science-y business, just numbers being numbers. iconic of it.

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


πŸŽ€ floatfield πŸŽ€

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

a mask of scientific|fixed. lowkey the useful one when you're doing the 2-arg form of setf. yes bestie, TWO ARGS, it's a whole thing.

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


πŸ’– goodbit πŸ’–

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

indicates all is well 🫢 that's it, that's the whole description, and honestly? we love a flag with zero drama.

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().

bestie there are duplicates in there. that's not me being sloppy, that's literally the list. leave it πŸ’…

🌈 hex 🌈

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

converts integer input, or generates integer output, in hexadecimal base. base 16 girlies rise.

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


πŸ¦‹ in πŸ¦‹

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

open for input. it's the default for ifstream and fstream. if you've ever wondered why reading "just works", hi, it's her.

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().


🧚 internal 🧚

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

drops fill characters at a designated internal point in certain generated output β€” or, if no such point got designated, it's identical to right. so basically right's understudy but with main character energy.

Referenced by: std::internal().


πŸ‘‘ left πŸ‘‘

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

adds fill characters on the right (the final positions) of certain generated output. i.e. the thing you print is flush left. left-aligned girlies, this is your moment.

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<<.


⭐ oct ⭐

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

converts integer input, or generates integer output, in octal base. base 8, the niche queen.

Referenced by: std::oct().


πŸ’œ out πŸ’œ

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

open for output. it's the default for ofstream and fstream. the writing half of the duo.

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]

adds fill characters on the left (the initial positions) of certain generated output. i.e. the thing you print is flush right. mirror image, same slay.

Referenced by: std::right().


✨ scientific ✨

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

generates floating-point output in scientific notation. e-notation bestie, like 1.5e+10 and such.

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


πŸŽ€ showbase πŸŽ€

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

generates a prefix showing off the numeric base of your generated integer output. like 0x for hex, so everyone knows what's up.

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


🌸 showpoint 🌸

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

generates a decimal-point character unconditionally in generated floating-point output. yes even when you didn't ask for one. it said consistency, periodt.

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


πŸ¦‹ showpos πŸ¦‹

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

generates a + sign on non-negative generated numeric output. positivity, literally.

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


πŸ’… skipws πŸ’…

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

skips leading white space before certain input operations. that's why your cin >> x doesn't choke on the spaces between your numbers 🫢

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


πŸ”₯ trunc πŸ”₯

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

truncates an existing stream when opening it. it's the default for ofstream. heads up bestie, truncate means the old contents are GONE gone. no cap. πŸ’€


🫢 unitbuf 🫢

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

flushes output after each output operation. every single one. no buffering delays, just instant delivery.

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


  • const fmtflags std::ios_base::uppercase [static], [inherited] β€” bestie this one is SO satisfying πŸ’… it flips certain lowercase letters into their uppercase equivalents when stuff gets written out. That's it. That's the whole vibe. generated output only, so it's giving glow-up, not rewrite. ✨

🫢 REFERENCED BY 🫢

These cuties are the ones pulling up on uppercase β€” no cap, they're all in its mentions:

  • std::num_put< _CharT, _OutIter >::do_put()
  • std::nouppercase()
  • std::uppercase()

πŸ‘‘ AUTHOR πŸ‘‘

Ok so plot twist: no human wrote this by hand, bestie 😭 it was generated automatically by Doxygen for libstdc++ from the source code. The source code is the main character here, periodt. πŸŽ€


and that's a wrap on the whole page, my love πŸ¦‹πŸ’– every single section, every option, every reference β€” all of it, delivered. This one came to you from the libstdc++ docs, and the footer tags it as std::basic..., _Traits >(3) with the date stamp riding shotgun right there in the footer with it. go forth and ios_base responsibly, ily πŸ«ΆπŸ’œπŸ’…

πŸ“¦ 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