Skip to content

Commit f2b7b7c

Browse files
committed
Add unary plus operation
1 parent 049d007 commit f2b7b7c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/slimcpplib/long_uint.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class long_uint_t
105105
constexpr long_uint_t operator+(const long_uint_t& that) const noexcept;
106106
constexpr long_uint_t& operator++() noexcept;
107107
constexpr long_uint_t operator++(int) noexcept;
108+
constexpr long_uint_t operator+() const noexcept;
108109
constexpr long_uint_t& operator-=(const long_uint_t& that) noexcept;
109110
constexpr long_uint_t operator-(const long_uint_t& that) const noexcept;
110111
constexpr long_uint_t& operator--() noexcept;
@@ -512,6 +513,15 @@ constexpr long_uint_t<native_t, size> long_uint_t<native_t, size>::operator++(in
512513

513514

514515

516+
////////////////////////////////////////////////////////////////////////////////////////////////////
517+
template<typename native_t, uint_t size>
518+
constexpr long_uint_t<native_t, size> long_uint_t<native_t, size>::operator+() const noexcept
519+
{
520+
return *this;
521+
}
522+
523+
524+
515525
////////////////////////////////////////////////////////////////////////////////////////////////////
516526
template<typename native_t, uint_t size>
517527
constexpr long_uint_t<native_t, size>& long_uint_t<native_t, size>::operator-=(const long_uint_t& that) noexcept

0 commit comments

Comments
 (0)