diff options
-rw-r--r-- | config/src/vespa/config/retriever/configkeyset.h | 8 | ||||
-rw-r--r-- | config/src/vespa/config/retriever/configkeyset.hpp | 16 |
2 files changed, 6 insertions, 18 deletions
diff --git a/config/src/vespa/config/retriever/configkeyset.h b/config/src/vespa/config/retriever/configkeyset.h index 294b3eb7423..e0a77f50efb 100644 --- a/config/src/vespa/config/retriever/configkeyset.h +++ b/config/src/vespa/config/retriever/configkeyset.h @@ -31,14 +31,8 @@ public: */ ConfigKeySet & add(const ConfigKeySet & configKeySet); private: - template<typename... ConfigTypes> - struct TypeTag {}; - - template<typename ConfigType> - void addImpl(const vespalib::string & configId, TypeTag<ConfigType>); - template<typename ConfigType, typename... ConfigTypes> - void addImpl(const vespalib::string & configId, TypeTag<ConfigType, ConfigTypes...>); + void addImpl(const vespalib::string & configId); }; } // namespace config diff --git a/config/src/vespa/config/retriever/configkeyset.hpp b/config/src/vespa/config/retriever/configkeyset.hpp index cfa43fdd8f0..60fcbf7d84a 100644 --- a/config/src/vespa/config/retriever/configkeyset.hpp +++ b/config/src/vespa/config/retriever/configkeyset.hpp @@ -7,24 +7,18 @@ template <typename... ConfigTypes> ConfigKeySet & ConfigKeySet::add(const vespalib::string & configId) { - addImpl(configId, TypeTag<ConfigTypes...>()); + addImpl<ConfigTypes...>(configId); return *this; } -template <typename ConfigType> -void -ConfigKeySet::addImpl(const vespalib::string & configId, TypeTag<ConfigType>) -{ - insert(ConfigKey::create<ConfigType>(configId)); -} - template <typename ConfigType, typename... ConfigTypes> void -ConfigKeySet::addImpl(const vespalib::string & configId, TypeTag<ConfigType, ConfigTypes...>) +ConfigKeySet::addImpl(const vespalib::string & configId) { insert(ConfigKey::create<ConfigType>(configId)); - addImpl(configId, TypeTag<ConfigTypes...>()); + if constexpr(sizeof...(ConfigTypes) > 0) { + addImpl<ConfigTypes...>(configId); + } } - } |