aboutsummaryrefslogtreecommitdiff
path: root/src/unique.hpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-11-20 17:51:49 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2024-11-20 17:51:49 +0100
commit304e4dfabe4555dff4aa72e75b677405fd30d1b3 (patch)
treeac934000415b46f784bda25ba671e74b9481573b /src/unique.hpp
parent872826ecaca5370e3492385cff3795d995b33ec7 (diff)
downloadlanes-304e4dfabe4555dff4aa72e75b677405fd30d1b3.tar.gz
lanes-304e4dfabe4555dff4aa72e75b677405fd30d1b3.tar.bz2
lanes-304e4dfabe4555dff4aa72e75b677405fd30d1b3.zip
Some [[nodiscard]] boyscouting
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: