From 827b15a0ba09eafcbeb2bbc36241f0c3a96beefa Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Wed, 30 Dec 2015 13:22:45 -0800 Subject: [PATCH] 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. --- src/json.hpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/json.hpp b/src/json.hpp index 606dc5629..6a06cacf3 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -116,17 +116,11 @@ struct void_converter }; // 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 -// key_comparer member type and unordered_map has a hasher member type +// object_t type alias. Takes advantage of the fact that an unordered_map +// has a hasher member type template class ObjectType, class Key, class Value, template class AllocatorType, typename Enable = void> -struct object_t_helper{}; -// Specialization that works for the 'map' type -template class ObjectType, class Key, class Value, - template class AllocatorType> -struct object_t_helper::key_compare>::type - > +struct object_t_helper { using type = ObjectType< Key,