32template <
typename BaseT,
typename T>
33 requires std::is_arithmetic_v<T>
120 requires std::is_integral_v<T>
134 requires std::is_integral_v<T>
165 return static_cast<BaseT &
>(*this);
174 return static_cast<const BaseT &
>(*this);
187template <
typename BaseT,
typename T>
188 requires std::is_arithmetic_v<T>
191 return lhs.get() == rhs.get();
200template <
typename BaseT,
typename T>
201 requires std::is_arithmetic_v<T>
204 return lhs.get() <=> rhs.get();
213template <
typename BaseT,
typename T>
214 requires std::is_arithmetic_v<T>
217 return BaseT(lhs.get() + rhs.get());
226template <
typename BaseT,
typename T>
227 requires std::is_arithmetic_v<T>
230 return BaseT(lhs.get() - rhs.get());
239template <
typename BaseT,
typename T>
240 requires std::is_arithmetic_v<T>
243 return BaseT(lhs.get() * rhs.get());
252template <
typename BaseT,
typename T>
253 requires std::is_arithmetic_v<T>
256 return BaseT(lhs.get() / rhs.get());
268template <
typename BaseT,
typename T>
269 requires std::is_integral_v<T>
285template <
typename BaseT,
typename T>
286 requires std::is_integral_v<T>
289 return BaseT{T(l) | T(r)};
302template <
typename BaseT,
typename T>
303 requires std::is_integral_v<T>
306 return BaseT{T(l) & T(r)};
constexpr BaseT operator/(IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept
Division operator.
constexpr BaseT operator&(IntrinsicType< BaseT, T > l, IntrinsicType< BaseT, T > r) noexcept
Performs bitwise AND operation between two IntrinsicType objects.
constexpr BaseT operator|(IntrinsicType< BaseT, T > l, IntrinsicType< BaseT, T > r) noexcept
Performs bitwise OR operation between two IntrinsicType objects.
constexpr BaseT operator-(IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept
Subtraction operator.
constexpr BaseT operator~(IntrinsicType< BaseT, T > t) noexcept
Performs bitwise NOT operation on an IntrinsicType.
constexpr auto operator<=>(IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept
Equality comparison operator.
constexpr BaseT operator*(IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept
Multiplication operator.
constexpr bool operator==(IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept
Equality comparison operator.
constexpr BaseT operator+(IntrinsicType< BaseT, T > lhs, IntrinsicType< BaseT, T > rhs) noexcept
Addition operator.
CRTP type designed to allow creation of strong types based on intrinsics.
constexpr BaseT operator+=(BaseT arg) noexcept
Add assignment operator.
constexpr BaseT & operator|=(BaseT arg) noexcept
Bitwise OR assignment operator.
BaseT & operator=(value_type v)
Assignment operator from value_type.
BaseT & operator=(BaseT arg) noexcept
Assignment operator from BaseT.
constexpr BaseT operator/=(BaseT arg) noexcept
Divide assignment operator.
constexpr BaseT operator-=(BaseT arg) noexcept
Subtract assignment operator.
BaseT & CrtpBase() noexcept
Helper function to perform CRTP cast.
constexpr BaseT operator*=(BaseT arg) noexcept
Multiply assignment operator.
const BaseT & CrtpBase() const noexcept
Const version of helper function to perform CRTP cast.
constexpr IntrinsicType(value_type v=value_type()) noexcept
Constructs an IntrinsicType object.
constexpr BaseT & operator&=(BaseT arg) noexcept
Bitwise AND assignment operator.
constexpr value_type get() const noexcept
Getter for the underlying value.