STD::BITSET_REFERENCE(3cxx)

πŸ’– NAME πŸ’–

okay so welcome to std::bitset< _Nb >::reference β€” yes, that whole name β€” from the 3cxx manual, bestie πŸ’…. This is the tiny proxy class that encapsulates the concept of a single bit. No cap, it’s giving β€œone bit but make it a whole object” energy. πŸŽ€


✨ SYNOPSIS ✨

#include <bitset>

🌸 Public Member Functions 🌸

  • constexpr reference (bitset &__b, size_t __pos) noexcept β€” constructor vibe: takes a bitset &__b and a size_t __pos; it’s constexpr and noexcept.
  • reference (const reference &)=default β€” copy constructor, and it’s =default, so the compiler is handling it. periodt.
  • constexpr reference & flip () noexcept β€” flip it; returns reference &; constexpr and noexcept.
  • constexpr operator bool () const noexcept β€” conversion to bool; const, constexpr, noexcept.
  • constexpr reference & operator= (bool __x) noexcept β€” assignment from bool __x; returns reference &; constexpr, noexcept.
  • constexpr reference & operator= (const reference &__j) noexcept β€” assignment from const reference &__j; returns reference &; constexpr, noexcept.
  • constexpr bool operator~ () const noexcept β€” the ~ operator, returns bool; const, constexpr, noexcept.

🫢 Friends 🫢

  • class bitset β€” yep, bitset is a friend. iykyk πŸ’œ

🌈 Detailed Description 🌈

template<size_t _Nb>
class std::bitset< _Nb >::reference

So like, this class encapsulates the concept of a single bit πŸ’–. An instance of this class is a proxy for an actual bit; this way the individual bit operations are done as faster word-size bitwise instructions. Slay.

Most users will never need to use this class directly, fr fr; conversions to and from bool are automatic and should be transparent. Overloaded operators help to preserve the illusion. It’s giving invisible-helper main character energy. ✨

(On a typical system, this bit reference is 64 times the size of an actual bit. Ha. 😭)


πŸŽ€ Author πŸŽ€

Generated automatically by Doxygen for libstdc++ from the source code.

okay that’s the page, bestie 🫢 β€” source/version libstdc++, manual 3cxx, and the footer doesn’t list a date so I’m not inventing one 😭. Doxygen made this, and it ate. Bye! πŸ’…βœ¨

πŸ“¦ where this page comes from