aboutsummaryrefslogtreecommitdiff
path: root/src/unique.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unique.hpp')
-rw-r--r--src/unique.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/unique.hpp b/src/unique.hpp
index c214dbc..aec5610 100644
--- a/src/unique.hpp
+++ b/src/unique.hpp
@@ -3,8 +3,9 @@
3// ################################################################################################# 3// #################################################################################################
4 4
5// A unique type generator 5// A unique type generator
6// Marking *all* Unique<> types as [[nodiscard]] is maybe overkill, but there is no way of marking a specific instanciation
6template <typename T, typename TAG, typename specialization = void> 7template <typename T, typename TAG, typename specialization = void>
7class Unique 8class [[nodiscard]] Unique
8{ 9{
9 private: 10 private:
10 T val; // no default initialization so that std::is_trivial_v<Unique<T>> == true 11 T val; // no default initialization so that std::is_trivial_v<Unique<T>> == true
@@ -69,7 +70,8 @@ class Unique
69}; 70};
70 71
71template <typename T, typename TAG> 72template <typename T, typename TAG>
72class Unique<T, TAG, std::enable_if_t<!std::is_scalar_v<T>>> 73// Marking *all* Unique<> types as [[nodiscard]] is maybe overkill, but there is no way of marking a specific instanciation
74class [[nodiscard]] Unique<T, TAG, std::enable_if_t<!std::is_scalar_v<T>>>
73: public T 75: public T
74{ 76{
75 public: 77 public: