Skip to content

Commit 049d007

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

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

include/slimcpplib/long_int.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class long_int_t : public long_uint_t<native_t, size>
9595
constexpr long_int_t operator+(const long_int_t& that) const noexcept;
9696
constexpr long_int_t& operator++() noexcept;
9797
constexpr long_int_t operator++(int) noexcept;
98+
constexpr long_int_t operator+() const noexcept;
9899
constexpr long_int_t& operator-=(const long_int_t& that) noexcept;
99100
constexpr long_int_t operator-(const long_int_t& that) const noexcept;
100101
constexpr long_int_t& operator--() noexcept;
@@ -327,6 +328,15 @@ constexpr long_int_t<native_t, size> long_int_t<native_t, size>::operator++(int)
327328

328329

329330

331+
////////////////////////////////////////////////////////////////////////////////////////////////////
332+
template<typename native_t, uint_t size>
333+
constexpr long_int_t<native_t, size> long_int_t<native_t, size>::operator+() const noexcept
334+
{
335+
return *this;
336+
}
337+
338+
339+
330340
////////////////////////////////////////////////////////////////////////////////////////////////////
331341
template<typename native_t, uint_t size>
332342
constexpr long_int_t<native_t, size>& long_int_t<native_t, size>::operator-=(const long_int_t& that) noexcept

0 commit comments

Comments
 (0)