restricted erase generic arg as per C++23 requirements

(hopefully fixes test errors in VS2015)
This commit is contained in:
joaquintides
2022-10-07 11:19:20 +02:00
parent 2057ccaeb5
commit 3aaf895514

View File

@ -1091,8 +1091,13 @@ public:
--size_;
}
template<typename Key>
std::size_t erase(const Key& x)
template<
typename Key,
typename std::enable_if<
!std::is_convertible<Key&&,iterator>::value&&
!std::is_convertible<Key&&,const_iterator>::value>::type* =nullptr
>
std::size_t erase(Key&& x)
{
auto it=find(x);
if(it!=end()){