diff --git a/src/id_map.hh b/src/id_map.hh index 023c73c0..e8fe1ccb 100644 --- a/src/id_map.hh +++ b/src/id_map.hh @@ -18,6 +18,9 @@ public: using iterator = typename container_type::iterator; using const_iterator = typename container_type::const_iterator; + id_map() = default; + id_map(std::initializer_list val) : m_content{val} {} + void append(const value_type& value) { m_content.push_back(value); @@ -91,6 +94,8 @@ public: prefix, cursor_pos, [](const value_type&) { return true; }); } + bool empty() const { return m_content.empty(); } + iterator begin() { return m_content.begin(); } iterator end() { return m_content.end(); } const_iterator begin() const { return m_content.begin(); } diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index b41dc9a0..49d970f7 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -2,11 +2,10 @@ #define parameters_parser_hh_INCLUDED #include "exception.hh" +#include "id_map.hh" #include "memoryview.hh" #include "string.hh" -#include - namespace Kakoune { @@ -40,7 +39,7 @@ struct SwitchDesc String description; }; -using SwitchMap = std::unordered_map; +using SwitchMap = id_map; String generate_switches_doc(const SwitchMap& opts);