#ifndef BMATH_HEADER_ONLY_MATH_LIB #define BMATH_HEADER_ONLY_MATH_LIB #include #include #include namespace bmath { template requires(std::integral || std::is_same_v) class mint { public: [[nodiscard]] constexpr explicit mint() : value{} {} [[nodiscard]] constexpr explicit mint(IntegralType _value) : value{_value} {} [[nodiscard]] constexpr explicit operator IntegralType() const noexcept { return value; } template [[nodiscard]] constexpr mint operator+( mint const& otherMint) const noexcept { return mint{value + otherMint.value}; } [[nodiscard]] constexpr mint& operator-(mint const& other) const noexcept {} [[nodiscard]] constexpr mint& operator*(mint const& other) const noexcept {} [[nodiscard]] constexpr mint& operator/(mint const& other) const noexcept {} [[nodiscard]] constexpr mint& operator%(mint const& other) const noexcept {} friend constexpr bool operator==(std::convertible_to auto a, mint const& b) noexcept { return static_cast(a) == b.value; } friend constexpr bool operator==( mint const& a, std::convertible_to auto b) noexcept { return a.value == static_cast(b); } template [[nodiscard]] constexpr bool operator==( mint const& otherMint) const noexcept { return value == otherMint.value; } [[nodiscard]] constexpr IntegralType get() const { return value; } private: IntegralType value{}; }; } // namespace bmath #endif