C++ Bitset 库 - reference() 函数
描述
C++ std::bitset::reference 是嵌入式类,它提供可以从 std::bitset::operator[] 返回的左值。通过 std::bitset::reference 对 bitset 执行的任何读取或写入操作最终都会读取或写入整个底层 bitset。
声明
以下是 std::bitset::reference 类形式 std::bitset 头的声明。
C++98
class bitset::reference {
friend class bitset;
reference(); /* Private constructor */
public:
~reference();
operator bool() const;
reference& operator = (bool x);
reference& operator = (const reference& x);
reference& flip();
bool operator~() const;
}
C++11
class bitset::reference {
friend class bitset;
reference() noexcept; /* Private constructor */
public:
~reference();
operator bool() const noexcept;
reference& operator= (bool x) noexcept;
reference& operator= (const reference& x) noexcept;
reference& flip() noexcept;
bool operator~() const noexcept;
}

