Use more C++17 features
Mainly structured bindings, inline variables, and class template
argument deduction, plus many more smaller things.
Change-Id: I810d17e0adb470426e4e30c898e03b3140ad052f
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 4e162bd..570f219 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -52,11 +52,10 @@
{
BOOST_ASSERT(strategyName.size() > 1);
BOOST_ASSERT(strategyName.at(-1).isVersion());
- Registry& registry = getRegistry();
- BOOST_ASSERT(registry.count(strategyName) == 0);
- registry[strategyName] = [] (auto&&... args) {
+ auto r = getRegistry().insert_or_assign(strategyName, [] (auto&&... args) {
return make_unique<S>(std::forward<decltype(args)>(args)...);
- };
+ });
+ BOOST_VERIFY(r.second);
}
/** \return Whether a strategy instance can be created from \p instanceName