forked from boostorg/unordered
Make 'has_unique_keys' container independent.
This commit is contained in:
@ -8,8 +8,6 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <boost/unordered_set.hpp>
|
|
||||||
#include <boost/unordered_map.hpp>
|
|
||||||
|
|
||||||
namespace test
|
namespace test
|
||||||
{
|
{
|
||||||
@ -22,19 +20,11 @@ namespace test
|
|||||||
template <class Container>
|
template <class Container>
|
||||||
struct has_unique_keys
|
struct has_unique_keys
|
||||||
{
|
{
|
||||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
static char flip(BOOST_DEDUCED_TYPENAME Container::iterator const&);
|
||||||
};
|
static long flip(std::pair<BOOST_DEDUCED_TYPENAME Container::iterator, bool> const&);
|
||||||
|
BOOST_STATIC_CONSTANT(bool, value = sizeof(long) == sizeof(
|
||||||
template <class V, class H, class P, class A>
|
flip(((Container*) 0)->insert(*(BOOST_DEDUCED_TYPENAME Container::value_type*) 0))
|
||||||
struct has_unique_keys<boost::unordered_set<V, H, P, A> >
|
));
|
||||||
{
|
|
||||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class K, class M, class H, class P, class A>
|
|
||||||
struct has_unique_keys<boost::unordered_map<K, M, H, P, A> >
|
|
||||||
{
|
|
||||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user