From 45ebc1e555b65f4a3bdebde95b59560b172e983d Mon Sep 17 00:00:00 2001 From: joaquintides Date: Mon, 27 Mar 2023 13:39:14 +0200 Subject: [PATCH] fixed call ambiguities in insert_or_visit --- .../unordered/detail/foa/concurrent_table.hpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/include/boost/unordered/detail/foa/concurrent_table.hpp b/include/boost/unordered/detail/foa/concurrent_table.hpp index 83360cbc..4272bedc 100644 --- a/include/boost/unordered/detail/foa/concurrent_table.hpp +++ b/include/boost/unordered/detail/foa/concurrent_table.hpp @@ -453,16 +453,26 @@ public: group_exclusive{},std::forward(f),std::move(x)); } - /* typename=void tilts call ambiguities in favor of init_type */ + /* SFINAE tilts call ambiguities in favor of init_type */ - template - BOOST_FORCEINLINE bool insert_or_visit(const value_type& x,F&& f) + template + BOOST_FORCEINLINE auto insert_or_visit(const Value& x,F&& f) + ->typename std::enable_if< + !std::is_same::value&& + std::is_same::value, + bool + >::type { return emplace_or_visit_impl(group_exclusive{},std::forward(f),x); } - template - BOOST_FORCEINLINE bool insert_or_visit(value_type&& x,F&& f) + template + BOOST_FORCEINLINE auto insert_or_visit(Value&& x,F&& f) + ->typename std::enable_if< + !std::is_same::value&& + std::is_same::value, + bool + >::type { return emplace_or_visit_impl( group_exclusive{},std::forward(f),std::move(x));