Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 /* Copyright 2003-2005 Joaquín M López Muñoz.
2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * See http://www.boost.org/libs/multi_index for library home page.
9 #ifndef BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ARGS_HPP
10 #define BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ARGS_HPP
12 #if defined(_MSC_VER)&&(_MSC_VER>=1200)
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17 #include <boost/functional/hash/hash.hpp>
18 #include <boost/mpl/aux_/na.hpp>
19 #include <boost/mpl/eval_if.hpp>
20 #include <boost/mpl/identity.hpp>
21 #include <boost/mpl/if.hpp>
22 #include <boost/multi_index/tag.hpp>
23 #include <boost/static_assert.hpp>
24 #include <boost/type_traits/is_same.hpp>
29 template<class T> struct hash; /* fwd decl. */
31 namespace multi_index{
35 /* Hashed index specifiers can be instantiated in two forms:
37 * (hashed_unique|hashed_non_unique)<
39 * Hash=boost::hash<KeyFromValue::result_type>,
40 * Pred=std::equal_to<KeyFromValue::result_type> >
41 * (hashed_unique|hashed_non_unique)<
44 * Hash=boost::hash<KeyFromValue::result_type>,
45 * Pred=std::equal_to<KeyFromValue::result_type> >
47 * hashed_index_args implements the machinery to accept this
48 * argument-dependent polymorphism.
51 template<typename KeyFromValue>
52 struct index_args_default_hash
54 typedef ::boost::hash<typename KeyFromValue::result_type> type;
57 template<typename KeyFromValue>
58 struct index_args_default_pred
60 typedef std::equal_to<typename KeyFromValue::result_type> type;
63 template<typename Arg1,typename Arg2,typename Arg3,typename Arg4>
64 struct hashed_index_args
66 typedef is_tag<Arg1> full_form;
68 typedef typename mpl::if_<
71 tag< > >::type tag_list_type;
72 typedef typename mpl::if_<
75 Arg1>::type key_from_value_type;
76 typedef typename mpl::if_<
79 Arg2>::type supplied_hash_type;
80 typedef typename mpl::eval_if<
81 mpl::is_na<supplied_hash_type>,
82 index_args_default_hash<key_from_value_type>,
83 mpl::identity<supplied_hash_type>
85 typedef typename mpl::if_<
88 Arg3>::type supplied_pred_type;
89 typedef typename mpl::eval_if<
90 mpl::is_na<supplied_pred_type>,
91 index_args_default_pred<key_from_value_type>,
92 mpl::identity<supplied_pred_type>
95 BOOST_STATIC_ASSERT(is_tag<tag_list_type>::value);
96 BOOST_STATIC_ASSERT(!mpl::is_na<key_from_value_type>::value);
97 BOOST_STATIC_ASSERT(!mpl::is_na<hash_type>::value);
98 BOOST_STATIC_ASSERT(!mpl::is_na<pred_type>::value);
101 } /* namespace multi_index::detail */
103 } /* namespace multi_index */
105 } /* namespace boost */