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

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

#include <inumeric.hpp>

类 iarithmetic< T > 继承关系图:
[图例]

Public 成员函数

NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T operator+ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator+=(other)))
 加法运算符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T operator- (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator-=(other)))
 减法运算符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T operator* (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator*=(other)))
 乘法运算符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T operator/ (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator/=(other)))
 除法运算符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T operator% (const T &other) const noexcept(noexcept(const_cast< T & >(derived()).operator%=(other)))
 取模运算符
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T operator- () const noexcept(noexcept(derived().operator-()))
 一元负号运算符
NEFORCE_CONSTEXPR14 T & operator+= (const T &other) noexcept(noexcept(derived().operator+=(other)))
 加法赋值运算符
NEFORCE_CONSTEXPR14 T & operator-= (const T &other) noexcept(noexcept(derived().operator-=(other)))
 减法赋值运算符
NEFORCE_CONSTEXPR14 T & operator*= (const T &other) noexcept(noexcept(derived().operator*=(other)))
 乘法赋值运算符
NEFORCE_CONSTEXPR14 T & operator/= (const T &other)
 除法赋值运算符
NEFORCE_CONSTEXPR14 T & operator%= (const T &other)
 取模赋值运算符
NEFORCE_CONSTEXPR14 T & operator++ () noexcept(noexcept(derived().operator++()))
 前置自增运算符
NEFORCE_CONSTEXPR14 T operator++ (int) noexcept(noexcept(derived().operator++()))
 后置自增运算符
NEFORCE_CONSTEXPR14 T & operator-- () noexcept(noexcept(derived().operator--()))
 前置自减运算符
NEFORCE_CONSTEXPR14 T operator-- (int) noexcept(noexcept(derived().operator--()))
 后置自减运算符

详细描述

template<typename T>
struct iarithmetic< T >

算术运算接口基类

模板参数
T派生类类型

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

在文件 inumeric.hpp30 行定义.

成员函数说明

◆ operator%()

template<typename T>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator% ( const T & other) const
inlinenoexcept

取模运算符

参数
other右操作数
返回
两个对象取模的结果

在文件 inumeric.hpp98 行定义.

◆ operator%=()

template<typename T>
NEFORCE_CONSTEXPR14 T & iarithmetic< T >::operator%= ( const T & other)
inline

取模赋值运算符

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

在文件 inumeric.hpp152 行定义.

◆ operator*()

template<typename T>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator* ( const T & other) const
inlinenoexcept

乘法运算符

参数
other右操作数
返回
两个对象相乘的结果

在文件 inumeric.hpp74 行定义.

◆ operator*=()

template<typename T>
NEFORCE_CONSTEXPR14 T & iarithmetic< T >::operator*= ( const T & other)
inlinenoexcept

乘法赋值运算符

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

在文件 inumeric.hpp136 行定义.

◆ operator+()

template<typename T>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator+ ( const T & other) const
inlinenoexcept

加法运算符

参数
other右操作数
返回
两个对象相加的结果

在文件 inumeric.hpp50 行定义.

◆ operator++() [1/2]

template<typename T>
NEFORCE_CONSTEXPR14 T & iarithmetic< T >::operator++ ( )
inlinenoexcept

前置自增运算符

返回
自增后的对象引用

在文件 inumeric.hpp158 行定义.

◆ operator++() [2/2]

template<typename T>
NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator++ ( int )
inlinenoexcept

后置自增运算符

返回
自增前的对象副本

在文件 inumeric.hpp164 行定义.

◆ operator+=()

template<typename T>
NEFORCE_CONSTEXPR14 T & iarithmetic< T >::operator+= ( const T & other)
inlinenoexcept

加法赋值运算符

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

在文件 inumeric.hpp118 行定义.

◆ operator-() [1/2]

template<typename T>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator- ( ) const
inlinenoexcept

一元负号运算符

返回
对象的相反数

在文件 inumeric.hpp109 行定义.

◆ operator-() [2/2]

template<typename T>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator- ( const T & other) const
inlinenoexcept

减法运算符

参数
other右操作数
返回
两个对象相减的结果

在文件 inumeric.hpp62 行定义.

◆ operator--() [1/2]

template<typename T>
NEFORCE_CONSTEXPR14 T & iarithmetic< T >::operator-- ( )
inlinenoexcept

前置自减运算符

返回
自减后的对象引用

在文件 inumeric.hpp174 行定义.

◆ operator--() [2/2]

template<typename T>
NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator-- ( int )
inlinenoexcept

后置自减运算符

返回
自减前的对象副本

在文件 inumeric.hpp180 行定义.

◆ operator-=()

template<typename T>
NEFORCE_CONSTEXPR14 T & iarithmetic< T >::operator-= ( const T & other)
inlinenoexcept

减法赋值运算符

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

在文件 inumeric.hpp127 行定义.

◆ operator/()

template<typename T>
NEFORCE_NODISCARD NEFORCE_CONSTEXPR14 T iarithmetic< T >::operator/ ( const T & other) const
inlinenoexcept

除法运算符

参数
other右操作数
返回
两个对象相除的结果

在文件 inumeric.hpp86 行定义.

◆ operator/=()

template<typename T>
NEFORCE_CONSTEXPR14 T & iarithmetic< T >::operator/= ( const T & other)
inline

除法赋值运算符

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

在文件 inumeric.hpp145 行定义.


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