MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
ibinary< T > 模板结构体 参考

位运算接口基类 更多...

#include <inumeric.hpp>

Public 成员函数

MSTL_NODISCARD MSTL_CONSTEXPR14 T operator& (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator&=(other)))
 按位与运算符
MSTL_NODISCARD MSTL_CONSTEXPR14 T operator| (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator|=(other)))
 按位或运算符
MSTL_NODISCARD MSTL_CONSTEXPR14 T operator^ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator^=(other)))
 按位异或运算符
MSTL_NODISCARD MSTL_CONSTEXPR14 T operator~ () const noexcept(noexcept(derived().operator~()))
 按位取反运算符
MSTL_NODISCARD MSTL_CONSTEXPR14 T operator<< (const uint32_t shift) const
 左移运算符
MSTL_NODISCARD MSTL_CONSTEXPR14 T operator>> (const uint32_t shift) const
 右移运算符
MSTL_CONSTEXPR14 T & operator&= (const T &other) noexcept(noexcept(derived().operator&=(other)))
 按位与赋值运算符
MSTL_CONSTEXPR14 T & operator|= (const T &other) noexcept(noexcept(derived().operator|=(other)))
 按位或赋值运算符
MSTL_CONSTEXPR14 T & operator^= (const T &other) noexcept(noexcept(derived().operator^=(other)))
 按位异或赋值运算符
MSTL_CONSTEXPR14 T & operator<<= (const uint32_t shift)
 左移赋值运算符
MSTL_CONSTEXPR14 T & operator>>= (const uint32_t shift)
 右移赋值运算符

详细描述

template<typename T>
struct ibinary< T >

位运算接口基类

模板参数
T派生类类型

使用CRTP模式为派生类提供位运算运算符的通用实现。 派生类只需实现复合赋值运算符,即可自动获得相应的二元运算符。

在文件 inumeric.hpp217 行定义.

成员函数说明

◆ operator&()

template<typename T>
MSTL_NODISCARD MSTL_CONSTEXPR14 T ibinary< T >::operator& ( const T & other) const
inlinenoexcept

按位与运算符

参数
other右操作数
返回
两个对象按位与的结果

在文件 inumeric.hpp241 行定义.

◆ operator&=()

template<typename T>
MSTL_CONSTEXPR14 T & ibinary< T >::operator&= ( const T & other)
inlinenoexcept

按位与赋值运算符

参数
other右操作数
返回
当前对象的引用

在文件 inumeric.hpp307 行定义.

◆ operator<<()

template<typename T>
MSTL_NODISCARD MSTL_CONSTEXPR14 T ibinary< T >::operator<< ( const uint32_t shift) const
inline

左移运算符

参数
shift移位位数

在文件 inumeric.hpp285 行定义.

◆ operator<<=()

template<typename T>
MSTL_CONSTEXPR14 T & ibinary< T >::operator<<= ( const uint32_t shift)
inline

左移赋值运算符

参数
shift移位位数
返回
当前对象的引用

在文件 inumeric.hpp337 行定义.

◆ operator>>()

template<typename T>
MSTL_NODISCARD MSTL_CONSTEXPR14 T ibinary< T >::operator>> ( const uint32_t shift) const
inline

右移运算符

参数
shift移位位数
返回
对象右移shift位的结果

在文件 inumeric.hpp296 行定义.

◆ operator>>=()

template<typename T>
MSTL_CONSTEXPR14 T & ibinary< T >::operator>>= ( const uint32_t shift)
inline

右移赋值运算符

参数
shift移位位数
返回
当前对象的引用

在文件 inumeric.hpp346 行定义.

◆ operator^()

template<typename T>
MSTL_NODISCARD MSTL_CONSTEXPR14 T ibinary< T >::operator^ ( const T & other) const
inlinenoexcept

按位异或运算符

参数
other右操作数
返回
两个对象按位异或的结果

在文件 inumeric.hpp265 行定义.

◆ operator^=()

template<typename T>
MSTL_CONSTEXPR14 T & ibinary< T >::operator^= ( const T & other)
inlinenoexcept

按位异或赋值运算符

参数
other右操作数
返回
当前对象的引用

在文件 inumeric.hpp327 行定义.

◆ operator|()

template<typename T>
MSTL_NODISCARD MSTL_CONSTEXPR14 T ibinary< T >::operator| ( const T & other) const
inlinenoexcept

按位或运算符

参数
other右操作数
返回
两个对象按位或的结果

在文件 inumeric.hpp253 行定义.

◆ operator|=()

template<typename T>
MSTL_CONSTEXPR14 T & ibinary< T >::operator|= ( const T & other)
inlinenoexcept

按位或赋值运算符

参数
other右操作数
返回
当前对象的引用

在文件 inumeric.hpp317 行定义.

◆ operator~()

template<typename T>
MSTL_NODISCARD MSTL_CONSTEXPR14 T ibinary< T >::operator~ ( ) const
inlinenoexcept

按位取反运算符

返回
对象按位取反的结果

在文件 inumeric.hpp276 行定义.


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