|
| 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 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_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 T &other) |
| | 除法赋值运算符
|
| MSTL_CONSTEXPR14 T & | operator%= (const T &other) |
| | 取模赋值运算符
|
| MSTL_CONSTEXPR14 T & | operator++ () noexcept(noexcept(derived().operator++())) |
| | 前置自增运算符
|
| MSTL_CONSTEXPR14 T | operator++ (int) noexcept(noexcept(derived().operator++())) |
| | 后置自增运算符
|
| MSTL_CONSTEXPR14 T & | operator-- () noexcept(noexcept(derived().operator--())) |
| | 前置自减运算符
|
| MSTL_CONSTEXPR14 T | operator-- (int) noexcept(noexcept(derived().operator--())) |
| | 后置自减运算符
|
template<typename T>
struct iarithmetic< T >
算术运算接口基类
- 模板参数
-
使用CRTP模式为派生类提供算术运算符的通用实现。 派生类只需实现复合赋值运算符,即可自动获得相应的二元运算符。
在文件 inumeric.hpp 第 30 行定义.