diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-01 11:22:30 +0200 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-17 00:42:12 +0200 |
| commit | d324e506e3ebf35e151a6e3efaed940280589757 (patch) | |
| tree | 3f945d201270cd2f19321c6387e1875090aa3956 /src | |
| parent | 08ea6d07e4e5fcd7176a3cdacc18977e89115f4b (diff) | |
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<StringView>{"a", "b", "c"}
doesn't work because it's missing a template argument.
Diffstat (limited to 'src')
| -rw-r--r-- | src/commands.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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<StringView, 8> modes = { "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" }; +static constexpr auto modes = make_array<StringView>({ "normal", "insert", "menu", "prompt", "goto", "view", "user", "object" }); const CommandDesc debug_cmd = { "debug", |
