Add SFINAE to transparent count() overload in unordered_map

This commit is contained in:
LeonineKing1199
2021-11-22 11:16:04 -08:00
parent f41b3e8295
commit 59db6cf788
2 changed files with 29 additions and 4 deletions
@@ -40,6 +40,7 @@
#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#include <boost/type_traits/is_nothrow_swappable.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/make_void.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/unordered/detail/fwd.hpp>
#include <boost/utility/addressof.hpp>
@@ -722,6 +723,22 @@ namespace boost {
#endif
////////////////////////////////////////////////////////////////////////////
// Type checkers used for the transparent member functions added by C++20 and up
template <class>
struct make_dependent : public true_type {};
template <class, class = void> struct is_transparent : public false_type
{
};
template <class T>
struct is_transparent<T,
typename boost::make_void<typename T::is_transparent>::type> : public true_type
{
};
////////////////////////////////////////////////////////////////////////////
// Explicitly call a destructor