summaryrefslogtreecommitdiff
path: root/src/enum.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-11-11 21:43:27 +1100
committerMaxime Coste <mawww@kakoune.org>2021-11-21 09:44:56 +1100
commitfb4cef5b61639c507e6c5740cc5973d0d79ba673 (patch)
tree751e533a39d9a51be6b8af9e4abe6af75df00e87 /src/enum.hh
parent04f11c2af3e0ecdc78df9800d381b2fdc46af3b7 (diff)
Replace std::enable_if with requires
Introduce some concepts for enum and flags handling, goodbye and thanks for all the fish std::enable_if.
Diffstat (limited to 'src/enum.hh')
-rw-r--r--src/enum.hh4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/enum.hh b/src/enum.hh
index 09e11ef0..bedfea6d 100644
--- a/src/enum.hh
+++ b/src/enum.hh
@@ -2,12 +2,16 @@
#define enum_hh_INCLUDED
#include "string.hh"
+#include "meta.hh"
namespace Kakoune
{
template<typename T> struct EnumDesc { T value; StringView name; };
+template<typename T>
+concept DescribedEnum = requires { enum_desc(Meta::Type<T>{}); };
+
}
#endif // enum_hh_INCLUDED