1 // Boost.Bimap 2 // 3 // Copyright (c) 2006-2007 Matias Capeletto 4 // 5 // Distributed under the Boost Software License, Version 1.0. 6 // (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 9 /// \file detail/generate_relation_binder.hpp 10 /// \brief Define macros to help building the set type of definitions 11 12 #ifndef BOOST_BIMAP_DETAIL_GENERATE_RELATION_BINDER_HPP 13 #define BOOST_BIMAP_DETAIL_GENERATE_RELATION_BINDER_HPP 14 15 #if defined(_MSC_VER) 16 #pragma once 17 #endif 18 19 #include <boost/config.hpp> 20 21 #include <boost/mpl/apply.hpp> 22 23 /*===========================================================================*/ 24 #define BOOST_BIMAP_GENERATE_RELATION_BINDER_0CP( \ 25 \ 26 SET_TYPE_OF \ 27 ) \ 28 \ 29 template< class Relation > \ 30 struct bind_to \ 31 { \ 32 typedef SET_TYPE_OF<Relation> type; \ 33 \ 34 }; 35 /*===========================================================================*/ 36 37 38 39 /*===========================================================================*/ 40 #define BOOST_BIMAP_GENERATE_RELATION_BINDER_1CP( \ 41 \ 42 SET_TYPE_OF, \ 43 CP1 \ 44 ) \ 45 \ 46 template< class Relation > \ 47 struct bind_to \ 48 { \ 49 typedef SET_TYPE_OF \ 50 < \ 51 Relation, \ 52 BOOST_DEDUCED_TYPENAME mpl::apply<CP1, \ 53 BOOST_DEDUCED_TYPENAME Relation::storage_base >::type \ 54 \ 55 > type; \ 56 \ 57 }; 58 /*===========================================================================*/ 59 60 61 62 /*===========================================================================*/ 63 #define BOOST_BIMAP_GENERATE_RELATION_BINDER_2CP( \ 64 \ 65 SET_TYPE_OF, \ 66 CP1, \ 67 CP2 \ 68 ) \ 69 \ 70 template< class Relation > \ 71 struct bind_to \ 72 { \ 73 typedef SET_TYPE_OF \ 74 < \ 75 Relation, \ 76 BOOST_DEDUCED_TYPENAME mpl::apply<CP1, \ 77 BOOST_DEDUCED_TYPENAME Relation::storage_base >::type, \ 78 BOOST_DEDUCED_TYPENAME mpl::apply<CP2, \ 79 BOOST_DEDUCED_TYPENAME Relation::storage_base >::type \ 80 \ 81 > type; \ 82 \ 83 }; 84 /*===========================================================================*/ 85 86 87 88 #endif // BOOST_BIMAP_DETAIL_GENERATE_RELATION_BINDER_HPP 89