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:
Erich Keane 2015-12-30 13:22:45 -08:00
parent 16e8d99967
commit 827b15a0ba

View File

@ -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<template<typename...> class ObjectType, class Key, class Value,
template<typename> class AllocatorType, typename Enable = void>
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
>
struct object_t_helper
{
using type = ObjectType<
Key,