diff --git a/src/blackmisc/dictionary.h b/src/blackmisc/dictionary.h index 45252a73f..465ca00c7 100644 --- a/src/blackmisc/dictionary.h +++ b/src/blackmisc/dictionary.h @@ -38,14 +38,16 @@ namespace BlackMisc using ::BlackMisc::qHash; // bring hidden name into scope template - struct SupportsQHash : std::integral_constant() == std::declval()), NotFound>::value && - ! std::is_same())), NotFound>::value - > {}; + constexpr static bool supportsQHash() + { + return ! std::is_same() == std::declval()), NotFound>::value && + ! std::is_same())), NotFound>::value; + }; template - struct SupportsQMap : std::integral_constant() < std::declval()), NotFound>::value - > {}; + constexpr static bool supportsQMap() + { + return ! std::is_same() < std::declval()), NotFound>::value; + }; } template @@ -72,12 +74,11 @@ namespace BlackMisc //! Trait to select the appropriate default associative container type depending on what the key type supports - template - struct AssociativityTraits : public Private::AssociativityTraits::value, Private::ADL::SupportsQMap::value> - {}; + template + using DefaultAssociativeType = typename Private::AssociativityTraits(), Private::ADL::supportsQMap()>::template DefaultType; //! Associative container with value semantics, chooses a sensible default implementation container type - template class Impl = AssociativityTraits::template DefaultType> + template class Impl = DefaultAssociativeType> class CDictionary : public Mixin::DBusOperators>, public Mixin::JsonOperators>,