forked from boostorg/config
Merge pull request #374 from boostorg/has_hash
Update boost_has_hash.ipp tests for multiset.
This commit is contained in:
@ -96,8 +96,8 @@
|
|||||||
|
|
||||||
#if defined(__has_include)
|
#if defined(__has_include)
|
||||||
#if defined(BOOST_HAS_HASH)
|
#if defined(BOOST_HAS_HASH)
|
||||||
#if !__has_include(BOOST_HASH_SET_HEADER)
|
#if !__has_include(BOOST_HASH_SET_HEADER) || (__GNUC__ >= 10)
|
||||||
#undef BOOST_HAS_HAS
|
#undef BOOST_HAS_HASH
|
||||||
#undef BOOST_HAS_SET_HEADER
|
#undef BOOST_HAS_SET_HEADER
|
||||||
#undef BOOST_HAS_MAP_HEADER
|
#undef BOOST_HAS_MAP_HEADER
|
||||||
#endif
|
#endif
|
||||||
@ -167,6 +167,16 @@
|
|||||||
# define BOOST_LIBSTDCXX_VERSION 40300
|
# define BOOST_LIBSTDCXX_VERSION 40300
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if (BOOST_LIBSTDCXX_VERSION >= 100000) && defined(BOOST_HAS_HASH)
|
||||||
|
//
|
||||||
|
// hash_set/hash_map deprecated and have terminal bugs:
|
||||||
|
//
|
||||||
|
#undef BOOST_HAS_HASH
|
||||||
|
#undef BOOST_HAS_SET_HEADER
|
||||||
|
#undef BOOST_HAS_MAP_HEADER
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if (BOOST_LIBSTDCXX_VERSION < 50100)
|
#if (BOOST_LIBSTDCXX_VERSION < 50100)
|
||||||
// libstdc++ does not define this function as it's deprecated in C++11, but clang still looks for it,
|
// libstdc++ does not define this function as it's deprecated in C++11, but clang still looks for it,
|
||||||
// defining it here is a terrible cludge, but should get things working:
|
// defining it here is a terrible cludge, but should get things working:
|
||||||
|
@ -26,6 +26,11 @@ void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_set<Key,Eq,Hash,Alloc>& )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class Key, class Eq, class Hash, class Alloc>
|
||||||
|
void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<Key,Eq,Hash,Alloc>& )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
template <class Key, class T, class Eq, class Hash, class Alloc>
|
template <class Key, class T, class Eq, class Hash, class Alloc>
|
||||||
void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>& )
|
void foo(const BOOST_STD_EXTENSION_NAMESPACE::hash_map<Key,T,Eq,Hash,Alloc>& )
|
||||||
{
|
{
|
||||||
@ -37,9 +42,15 @@ int test()
|
|||||||
{
|
{
|
||||||
#ifndef DISABLE_BOOST_HAS_HASH_TEST
|
#ifndef DISABLE_BOOST_HAS_HASH_TEST
|
||||||
BOOST_STD_EXTENSION_NAMESPACE::hash_set<int> hs;
|
BOOST_STD_EXTENSION_NAMESPACE::hash_set<int> hs;
|
||||||
|
hs.insert(2);
|
||||||
foo(hs);
|
foo(hs);
|
||||||
BOOST_STD_EXTENSION_NAMESPACE::hash_map<int, long> hm;
|
BOOST_STD_EXTENSION_NAMESPACE::hash_map<int, long> hm;
|
||||||
|
hm[3] = 2;
|
||||||
foo(hm);
|
foo(hm);
|
||||||
|
BOOST_STD_EXTENSION_NAMESPACE::hash_multiset<int> hs2;
|
||||||
|
hs2.insert(2);
|
||||||
|
hs2.insert(2);
|
||||||
|
foo(hs2);
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user