Chris@101: /* Copyright 2003-2013 Joaquin M Lopez Munoz. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Chris@16: * See http://www.boost.org/libs/multi_index for library home page. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ARGS_HPP Chris@16: #define BOOST_MULTI_INDEX_DETAIL_HASH_INDEX_ARGS_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include /* keep it first to prevent nasty warns in MSVC */ Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost{ Chris@16: Chris@16: namespace multi_index{ Chris@16: Chris@16: namespace detail{ Chris@16: Chris@16: /* Hashed index specifiers can be instantiated in two forms: Chris@16: * Chris@16: * (hashed_unique|hashed_non_unique)< Chris@16: * KeyFromValue, Chris@16: * Hash=boost::hash, Chris@16: * Pred=std::equal_to > Chris@16: * (hashed_unique|hashed_non_unique)< Chris@16: * TagList, Chris@16: * KeyFromValue, Chris@16: * Hash=boost::hash, Chris@16: * Pred=std::equal_to > Chris@16: * Chris@16: * hashed_index_args implements the machinery to accept this Chris@16: * argument-dependent polymorphism. Chris@16: */ Chris@16: Chris@16: template Chris@16: struct index_args_default_hash Chris@16: { Chris@16: typedef ::boost::hash type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct index_args_default_pred Chris@16: { Chris@16: typedef std::equal_to type; Chris@16: }; Chris@16: Chris@16: template Chris@16: struct hashed_index_args Chris@16: { Chris@16: typedef is_tag full_form; Chris@16: Chris@16: typedef typename mpl::if_< Chris@16: full_form, Chris@16: Arg1, Chris@16: tag< > >::type tag_list_type; Chris@16: typedef typename mpl::if_< Chris@16: full_form, Chris@16: Arg2, Chris@16: Arg1>::type key_from_value_type; Chris@16: typedef typename mpl::if_< Chris@16: full_form, Chris@16: Arg3, Chris@16: Arg2>::type supplied_hash_type; Chris@16: typedef typename mpl::eval_if< Chris@16: mpl::is_na, Chris@16: index_args_default_hash, Chris@16: mpl::identity Chris@16: >::type hash_type; Chris@16: typedef typename mpl::if_< Chris@16: full_form, Chris@16: Arg4, Chris@16: Arg3>::type supplied_pred_type; Chris@16: typedef typename mpl::eval_if< Chris@16: mpl::is_na, Chris@16: index_args_default_pred, Chris@16: mpl::identity Chris@16: >::type pred_type; Chris@16: Chris@16: BOOST_STATIC_ASSERT(is_tag::value); Chris@16: BOOST_STATIC_ASSERT(!mpl::is_na::value); Chris@16: BOOST_STATIC_ASSERT(!mpl::is_na::value); Chris@16: BOOST_STATIC_ASSERT(!mpl::is_na::value); Chris@16: }; Chris@16: Chris@16: } /* namespace multi_index::detail */ Chris@16: Chris@16: } /* namespace multi_index */ Chris@16: Chris@16: } /* namespace boost */ Chris@16: Chris@16: #endif