From 6b1379a99266d3c4c8a602d5a28460e71e5ded4a Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Thu, 6 Oct 2022 10:45:49 -0700 Subject: [PATCH] Update SFINAE to handle the case of the init_type and moved_type being the same --- include/boost/unordered/detail/foa.hpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 66026009..4be574ee 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -1229,22 +1229,13 @@ private: } template< - bool dependent_value=false, + class T, typename std::enable_if< - has_different_init_type||dependent_value>::type* =nullptr + has_different_init_type&&( + std::is_same::value||std::is_same::value + )>::type* =nullptr > - static inline auto key_from(const init_type& x) - ->decltype(type_policy::extract(x)) - { - return type_policy::extract(x); - } - - template< - bool dependent_value=false, - typename std::enable_if< - has_different_init_type||dependent_value>::type* =nullptr - > - static inline auto key_from(const moved_type& x) + static inline auto key_from(const T& x) ->decltype(type_policy::extract(x)) { return type_policy::extract(x);