diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 9dae609f..3a224714 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -1499,13 +1499,30 @@ private: template< typename T, - typename std::enable_if::value>::type* =nullptr + typename Ty=typename std::decay::type, + typename std::enable_if< + !is_init_or_value_type::value&& + std::is_convertible::value + >::type* =nullptr > static inline init_type value_from(T&& x) { return std::forward(x); } + template< + typename T, + typename Ty=typename std::decay::type, + typename std::enable_if< + !is_init_or_value_type::value&& + !std::is_convertible::value + >::type* =nullptr + > + static inline value_type value_from(T&& x) + { + return std::forward(x); + } + template static inline auto key_from(const T& x) ->decltype(type_policy::extract(x)) diff --git a/include/boost/unordered/unordered_flat_map.hpp b/include/boost/unordered/unordered_flat_map.hpp index ea90c7e6..bcaa8dce 100644 --- a/include/boost/unordered/unordered_flat_map.hpp +++ b/include/boost/unordered/unordered_flat_map.hpp @@ -239,7 +239,7 @@ namespace boost { void insert(InputIterator first, InputIterator last) { for (auto pos = first; pos != last; ++pos) { - table_.insert(value_type(*pos)); + table_.insert(*pos); } }