std::ios_base::flags(3)

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

πŸ’… std::ios_base::flags(3) πŸ’…

Okay so we're flipping through the C++ Standard Libary manual, section 3, and this page is the std::ios_base::flags glow-up. It's giving format flag headquarters energy, and honestly? iconic. ✨


πŸ¦‹ NAME πŸ¦‹

std::ios_base::flags β€” that's the function name, bestie. Literally std::ios_base::flags. No cap. πŸ’–

🌸 Synopsis 🌸

fmtflags flags() const;           (1)
fmtflags flags( fmtflags flags ); (2)

Manages format flags. πŸŽ€

  1. returns current formatting setting
  2. replaces current settings with given ones.

πŸ“ Parameters πŸ“

  • flags β€” new formatting setting. It can be a combination of formatting flags constants.

✨ Formatting flags ✨

  • dec β€” use decimal base for integer I/O: see std::dec
  • oct β€” use octal base for integer I/O: see std::oct
  • hex β€” use hexadecimal base for integer I/O: see std::hex
  • basefield β€” dec | oct | hex. Useful for masking operations
  • left β€” left adjustment (adds fill characters to the right): see std::left
  • right β€” right adjustment (adds fill characters to the left): see std::right
  • internal β€” internal adjustment (adds fill characters to the internal designated point): see std::internal
  • adjustfield β€” left | right | internal. Useful for masking operations
  • scientific β€” generate floating point types using scientific notation, or hex notation if combined with fixed: see std::scientific
  • fixed β€” generate floating point types using fixed notation, or hex notation if combined with scientific: see std::fixed
  • floatfield β€” scientific | fixed. Useful for masking operations
  • boolalpha β€” insert and extract bool type in alphanumeric format: see std::boolalpha
  • showbase β€” generate a prefix indicating the numeric base for integer output, require the currency indicator in monetary I/O: see std::showbase
  • showpoint β€” generate a decimal-point character unconditionally for floating-point number output: see std::showpoint
  • showpos β€” generate a + character for non-negative numeric output: see std::showpos
  • skipws β€” skip leading whitespace before certain input operations: see std::skipws
  • unitbuf β€” flush the output after each output operation: see std::unitbuf
  • uppercase β€” replace certain lowercase letters with their uppercase equivalents in certain output operations: see std::uppercase

πŸ‘‘ Return value πŸ‘‘

It hands back the formatting flags before the call to the function. So you get the old vibe check result, basically. πŸ’…

😭 Example 😭

This section is incomplete Reason: no example

🫢 See also 🫢

  • setf β€” sets specific format flag (public member function)
  • unsetf β€” clears specific format flag (public member function)

πŸŽ€ Category πŸŽ€

  • Todo no example

xoxo, bestie πŸ’– β€” this page came from http://cppreference.com, dated 2024.06.10, and it's the std::ios_base::flags(3) page. Slay. 🌈

πŸ“¦ where this page comes from