diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 10:33:02 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-10-24 10:33:02 +0200 |
commit | 8745a54f88f31cd51dc86c96039ebe0b3e98f5ea (patch) | |
tree | f27eba088bfbda6aed4f9d70e514ec87a5d553fc /src/unique.hpp | |
parent | 54acd7514dc0a2e9d593dd6312eae90ae6c0d6b5 (diff) | |
download | lanes-8745a54f88f31cd51dc86c96039ebe0b3e98f5ea.tar.gz lanes-8745a54f88f31cd51dc86c96039ebe0b3e98f5ea.tar.bz2 lanes-8745a54f88f31cd51dc86c96039ebe0b3e98f5ea.zip |
Added strong types UserValueCount and UnusedInt
Diffstat (limited to 'src/unique.hpp')
-rw-r--r-- | src/unique.hpp | 12 |
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 | ||
48 | template <typename T, typename TAG> | 60 | template <typename T, typename TAG> |