Convert the non-unordered_map case not use key_compare
Key_compare is implemented in the std::unordered_map in MSVC, so the result is the initial attempt to use SFINAE to select 1 or the other wasn't effective. This patch makes the 'default' case implement the std::map case so that key_compare isn't used for SFINAE testing.
This commit is contained in:
parent
16e8d99967
commit
827b15a0ba
12
src/json.hpp
12
src/json.hpp
@ -116,17 +116,11 @@ struct void_converter
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Type to help determine between a map or unordered-map type for the
|
// Type to help determine between a map or unordered-map type for the
|
||||||
// object_t type alias. Takes advantage of the fact that a map has a
|
// object_t type alias. Takes advantage of the fact that an unordered_map
|
||||||
// key_comparer member type and unordered_map has a hasher member type
|
// has a hasher member type
|
||||||
template<template<typename...> class ObjectType, class Key, class Value,
|
template<template<typename...> class ObjectType, class Key, class Value,
|
||||||
template<typename> class AllocatorType, typename Enable = void>
|
template<typename> class AllocatorType, typename Enable = void>
|
||||||
struct object_t_helper{};
|
struct object_t_helper
|
||||||
// Specialization that works for the 'map' type
|
|
||||||
template<template<typename...> class ObjectType, class Key, class Value,
|
|
||||||
template<typename> class AllocatorType>
|
|
||||||
struct object_t_helper<ObjectType, Key, Value, AllocatorType,
|
|
||||||
typename void_converter<typename ObjectType<char,char>::key_compare>::type
|
|
||||||
>
|
|
||||||
{
|
{
|
||||||
using type = ObjectType<
|
using type = ObjectType<
|
||||||
Key,
|
Key,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user