aboutsummaryrefslogtreecommitdiff
path: root/src/unique.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unique.hpp')
-rw-r--r--src/unique.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/unique.hpp b/src/unique.hpp
index 829fa49..98a9d48 100644
--- a/src/unique.hpp
+++ b/src/unique.hpp
@@ -43,6 +43,18 @@ class Unique
43 { 43 {
44 return Unique<T, TAG>{ std::exchange(val, val + 1) }; 44 return Unique<T, TAG>{ std::exchange(val, val + 1) };
45 } 45 }
46
47 // pre-decrement
48 auto& operator--() noexcept
49 {
50 --val;
51 return *this;
52 }
53 // post-decrement
54 auto operator--(int) noexcept
55 {
56 return Unique<T, TAG>{ std::exchange(val, val - 1) };
57 }
46}; 58};
47 59
48template <typename T, typename TAG> 60template <typename T, typename TAG>