From d324e506e3ebf35e151a6e3efaed940280589757 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 1 Aug 2022 11:22:30 +0200 Subject: [PATCH] Use make_array to avoid specifying the array size When I wrote this line I wanted to avoid adding the array size but I didn't know about make_array(). I had unsuccessfully tried some alternatives, for example Array{"a", "b", "c"} which doesn't work because we need StringView (c.f. git blame on this line) also Array{"a", "b", "c"} doesn't work because it's missing a template argument. --- src/commands.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index 46481b9d..d3843a8d 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -1452,7 +1452,7 @@ KeymapMode parse_keymap_mode(StringView str, const KeymapManager::UserModeList& return (KeymapMode)(std::distance(user_modes.begin(), it) + offset); } -static constexpr Array modes = { "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" }; +static constexpr auto modes = make_array({ "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" }); const CommandDesc debug_cmd = { "debug",