summaryrefslogtreecommitdiff
path: root/src/insert_completer.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-03-15 17:42:02 +0000
committerMaxime Coste <mawww@kakoune.org>2017-03-15 17:42:02 +0000
commita49e175727928b8b45c0c2ccdb01f143ea6d18c2 (patch)
tree88c1c3909c2ab06394a63af5ebab8fdcd0a389f0 /src/insert_completer.hh
parenta88e58763bd33e021511d2e821703f478afd85bf (diff)
Migrate to a more value based meta programming model
Introduce Meta::Type<T> to store a type as value, and pass it around, migrate enum_desc and option_type_name to this.
Diffstat (limited to 'src/insert_completer.hh')
-rw-r--r--src/insert_completer.hh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/insert_completer.hh b/src/insert_completer.hh
index dac3db27..d7061c37 100644
--- a/src/insert_completer.hh
+++ b/src/insert_completer.hh
@@ -37,18 +37,18 @@ using InsertCompleterDescList = Vector<InsertCompleterDesc, MemoryDomain::Option
String option_to_string(const InsertCompleterDesc& opt);
void option_from_string(StringView str, InsertCompleterDesc& opt);
-template<> struct option_type_name<InsertCompleterDesc>
+inline StringView option_type_name(Meta::Type<InsertCompleterDesc>)
{
- static constexpr StringView name() { return "completer"; }
-};
+ return "completer";
+}
using CompletionCandidate = std::tuple<String, String, String>;
using CompletionList = PrefixedList<String, CompletionCandidate>;
-template<> struct option_type_name<CompletionList>
+inline StringView option_type_name(Meta::Type<CompletionList>)
{
- static constexpr StringView name() { return "completions"; }
-};
+ return "completions";
+}
struct InsertCompletion
{