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 12 namespace test { 13 template <class Container> 14 struct is_set : public boost::is_same<typename Container::key_type, 15 typename Container::value_type> 16 { 17 }; 18 19 template <class Container> struct has_unique_keys 20 { 21 static char flip(typename Container::iterator const&); 22 static long flip(std::pair<typename Container::iterator, bool> const&); 23 BOOST_STATIC_CONSTANT(bool, 24 value = sizeof(long) == 25 sizeof(flip( 26 ((Container*)0)->insert(*(typename Container::value_type*)0)))); 27 }; 28 } 29 30 #endif 31