NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
bit_reference结构体 参考

位引用类 更多...

#include <bitmap.hpp>

类 bit_reference 继承关系图:
[图例]

Public 成员函数

NEFORCE_CONSTEXPR20 bit_reference ()=default
 默认构造函数
NEFORCE_CONSTEXPR20 bit_reference (uint32_t *ptr, const uint32_t mask) noexcept
 构造函数
NEFORCE_CONSTEXPR20 bit_reference (const bit_reference &other) noexcept
 拷贝构造函数
NEFORCE_CONSTEXPR20 bit_referenceoperator= (const bit_reference &other) noexcept
 拷贝赋值运算符
NEFORCE_CONSTEXPR20 bit_reference (bit_reference &&other) noexcept
 移动构造函数
NEFORCE_CONSTEXPR20 bit_referenceoperator= (bit_reference &&other) noexcept
 移动赋值运算符
NEFORCE_CONSTEXPR20 bit_referenceoperator= (const bool value) noexcept
 赋值布尔值
NEFORCE_CONSTEXPR20 operator bool () const noexcept
 转换为布尔值
NEFORCE_CONSTEXPR20 void flip () const noexcept
 翻转位值
NEFORCE_CONSTEXPR20 void swap (bit_reference &other) noexcept
 交换两个位引用
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool operator== (const bit_reference &rhs) const noexcept
 相等比较操作符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool operator< (const bit_reference &rhs) const noexcept
 小于比较操作符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_t to_hash () const noexcept
 计算哈希值
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string to_string () const
 转换为字符串
Public 成员函数 继承自 icomparable< bit_reference >
NEFORCE_NODISCARD constexpr bool operator== (const bit_reference &rhs) const noexcept(noexcept(derived()==rhs))
 相等比较运算符
NEFORCE_NODISCARD constexpr bool operator!= (const bit_reference &rhs) const noexcept(noexcept(!(*this==rhs)))
 不等比较运算符
NEFORCE_NODISCARD constexpr bool operator< (const bit_reference &rhs) const noexcept(noexcept(derived()< rhs))
 小于比较运算符
NEFORCE_NODISCARD constexpr bool operator> (const bit_reference &rhs) const noexcept(noexcept(rhs< derived()))
 大于比较运算符
NEFORCE_NODISCARD constexpr bool operator<= (const bit_reference &rhs) const noexcept(noexcept(!(derived() > rhs)))
 小于等于比较运算符
NEFORCE_NODISCARD constexpr bool operator>= (const bit_reference &rhs) const noexcept(noexcept(!(derived()< rhs)))
 大于等于比较运算符
Public 成员函数 继承自 ihashable< bit_reference >
NEFORCE_NODISCARD constexpr size_t to_hash () const noexcept(noexcept(derived().to_hash()))
 获取对象的哈希值
Public 成员函数 继承自 istringify< bit_reference >
NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string to_string () const
 转换为字符串

详细描述

位引用类

提供对位图中单个位的引用语义,支持赋值、转换和翻转操作。 模拟布尔引用的行为,允许直接操作位图中的位。

在文件 bitmap.hpp33 行定义.

构造及析构函数说明

◆ bit_reference() [1/3]

NEFORCE_CONSTEXPR20 bit_reference::bit_reference ( uint32_t * ptr,
const uint32_t mask )
inlinenoexcept

构造函数

参数
ptr指向字的指针
mask位掩码

在文件 bitmap.hpp49 行定义.

◆ bit_reference() [2/3]

NEFORCE_CONSTEXPR20 bit_reference::bit_reference ( const bit_reference & other)
inlinenoexcept

拷贝构造函数

参数
other源位引用

在文件 bitmap.hpp57 行定义.

引用了 bit_reference().

◆ bit_reference() [3/3]

NEFORCE_CONSTEXPR20 bit_reference::bit_reference ( bit_reference && other)
inlinenoexcept

移动构造函数

参数
other源位引用

在文件 bitmap.hpp74 行定义.

引用了 bit_reference().

成员函数说明

◆ operator bool()

NEFORCE_CONSTEXPR20 bit_reference::operator bool ( ) const
inlineexplicitnoexcept

转换为布尔值

返回
位的布尔值

在文件 bitmap.hpp111 行定义.

◆ operator<()

NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool bit_reference::operator< ( const bit_reference & rhs) const
inlinenoexcept

小于比较操作符

参数
rhs右侧位引用
返回
比较结果(false < true)

在文件 bitmap.hpp145 行定义.

引用了 bit_reference().

◆ operator=() [1/3]

NEFORCE_CONSTEXPR20 bit_reference & bit_reference::operator= ( bit_reference && other)
inlinenoexcept

移动赋值运算符

参数
other源位引用
返回
自身引用

在文件 bitmap.hpp86 行定义.

引用了 bit_reference().

◆ operator=() [2/3]

NEFORCE_CONSTEXPR20 bit_reference & bit_reference::operator= ( const bit_reference & other)
inlinenoexcept

拷贝赋值运算符

参数
other源位引用
返回
自身引用

在文件 bitmap.hpp66 行定义.

引用了 bit_reference().

◆ operator=() [3/3]

NEFORCE_CONSTEXPR20 bit_reference & bit_reference::operator= ( const bool value)
inlinenoexcept

赋值布尔值

参数
value要赋的值
返回
自身引用

在文件 bitmap.hpp98 行定义.

引用了 bit_reference().

◆ operator==()

NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 bool bit_reference::operator== ( const bit_reference & rhs) const
inlinenoexcept

相等比较操作符

参数
rhs右侧位引用
返回
两个位是否相等

在文件 bitmap.hpp136 行定义.

引用了 bit_reference().

◆ swap()

NEFORCE_CONSTEXPR20 void bit_reference::swap ( bit_reference & other)
inlinenoexcept

交换两个位引用

参数
other要交换的另一个位引用

在文件 bitmap.hpp122 行定义.

引用了 addressof() , 以及 bit_reference().

◆ to_hash()

NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 size_t bit_reference::to_hash ( ) const
inlinenoexcept

计算哈希值

返回
哈希值

在文件 bitmap.hpp153 行定义.

◆ to_string()

NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string bit_reference::to_string ( ) const
inline

转换为字符串

返回
"1"或"0"的字符串表示

在文件 bitmap.hpp161 行定义.


该结构体的文档由以下文件生成: