From 3aaf8955141eaf9db324edbf5c9e0095b90a1641 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Fri, 7 Oct 2022 11:19:20 +0200 Subject: [PATCH] restricted erase generic arg as per C++23 requirements (hopefully fixes test errors in VS2015) --- include/boost/unordered/detail/foa.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/boost/unordered/detail/foa.hpp b/include/boost/unordered/detail/foa.hpp index 223fd60d..27d48d57 100644 --- a/include/boost/unordered/detail/foa.hpp +++ b/include/boost/unordered/detail/foa.hpp @@ -1091,8 +1091,13 @@ public: --size_; } - template - std::size_t erase(const Key& x) + template< + typename Key, + typename std::enable_if< + !std::is_convertible::value&& + !std::is_convertible::value>::type* =nullptr + > + std::size_t erase(Key&& x) { auto it=find(x); if(it!=end()){