From 7fde185cef7ffbb6945f5823eebfa76e33091d8b Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Wed, 14 Aug 2024 10:42:02 -0700 Subject: [PATCH] Use inline variables for basic factories --- include/mettle/suite/factory.hpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/include/mettle/suite/factory.hpp b/include/mettle/suite/factory.hpp index 7a84d96..c67bfbc 100644 --- a/include/mettle/suite/factory.hpp +++ b/include/mettle/suite/factory.hpp @@ -12,8 +12,6 @@ namespace mettle { namespace detail { struct auto_factory_t { - constexpr auto_factory_t() {} - template T make() const { return {}; @@ -21,8 +19,6 @@ namespace mettle { }; struct type_only_factory_t { - constexpr type_only_factory_t() {} - template void make() const {} }; @@ -38,9 +34,7 @@ namespace mettle { template T make() const { - using Indices = std::make_index_sequence< - std::tuple_size::value - >; + using Indices = std::make_index_sequence>; return make_impl(Indices()); } private: @@ -54,8 +48,8 @@ namespace mettle { } - constexpr detail::auto_factory_t auto_factory; - constexpr detail::type_only_factory_t type_only; + inline detail::auto_factory_t auto_factory; + inline detail::type_only_factory_t type_only; template auto bind_factory(Args &&...args) {