]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // Copyright 2005-2009 Daniel James. | |
3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | ||
6 | #if !defined(BOOST_UNORDERED_TEST_HELPERS_METAFUNCTIONS_HEADER) | |
7 | #define BOOST_UNORDERED_TEST_HELPERS_METAFUNCTIONS_HEADER | |
8 | ||
9 | #include <boost/config.hpp> | |
10 | #include <boost/type_traits/is_same.hpp> | |
11 | ||
b32b8144 FG |
12 | namespace test { |
13 | template <class Container> | |
14 | struct is_set | |
15 | : public boost::is_same<BOOST_DEDUCED_TYPENAME Container::key_type, | |
16 | BOOST_DEDUCED_TYPENAME Container::value_type> | |
17 | { | |
18 | }; | |
7c673cae | 19 | |
b32b8144 FG |
20 | template <class Container> struct has_unique_keys |
21 | { | |
22 | static char flip(BOOST_DEDUCED_TYPENAME Container::iterator const&); | |
23 | static long flip( | |
24 | std::pair<BOOST_DEDUCED_TYPENAME Container::iterator, bool> const&); | |
25 | BOOST_STATIC_CONSTANT(bool, | |
26 | value = sizeof(long) == | |
27 | sizeof( | |
28 | flip(((Container*)0) | |
29 | ->insert( | |
30 | *(BOOST_DEDUCED_TYPENAME Container::value_type*)0)))); | |
31 | }; | |
7c673cae FG |
32 | } |
33 | ||
34 | #endif |