Boost C++ Libraries Boost.Bimap Home Libraries People FAQ More

PrevUpHomeNext

generate_relation_binder.hpp

Go to the documentation of this file.
00001 // Boost.Bimap
00002 //
00003 // Copyright (c) 2006-2007 Matias Capeletto
00004 //
00005 // Distributed under the Boost Software License, Version 1.0.
00006 // (See accompanying file LICENSE_1_0.txt or copy at
00007 // http://www.boost.org/LICENSE_1_0.txt)
00008 
00009 /// \file detail/generate_relation_binder.hpp
00010 /// \brief Define macros to help building the set type of definitions
00011 
00012 #ifndef BOOST_BIMAP_DETAIL_GENERATE_RELATION_BINDER_HPP
00013 #define BOOST_BIMAP_DETAIL_GENERATE_RELATION_BINDER_HPP
00014 
00015 #if defined(_MSC_VER) && (_MSC_VER>=1200)
00016 #pragma once
00017 #endif
00018 
00019 #include <boost/config.hpp>
00020 
00021 #include <boost/mpl/apply.hpp>
00022 
00023 /*===========================================================================*/
00024 #define BOOST_BIMAP_GENERATE_RELATION_BINDER_0CP(                             \
00025                                                                               \
00026         SET_TYPE_OF                                                           \
00027     )                                                                         \
00028                                                                               \
00029     template< class Relation >                                                \
00030     struct bind_to                                                            \
00031     {                                                                         \
00032         typedef SET_TYPE_OF<Relation> type;                                   \
00033                                                                               \
00034     };
00035 /*===========================================================================*/
00036 
00037 
00038 
00039 /*===========================================================================*/
00040 #define BOOST_BIMAP_GENERATE_RELATION_BINDER_1CP(                             \
00041                                                                               \
00042         SET_TYPE_OF,                                                          \
00043         CP1                                                                   \
00044     )                                                                         \
00045                                                                               \
00046     template< class Relation >                                                \
00047     struct bind_to                                                            \
00048     {                                                                         \
00049         typedef SET_TYPE_OF                                                   \
00050         <                                                                     \
00051             Relation,                                                         \
00052             BOOST_DEDUCED_TYPENAME mpl::apply<CP1,Relation>::type             \
00053                                                                               \
00054         > type;                                                               \
00055                                                                               \
00056     };
00057 /*===========================================================================*/
00058 
00059 
00060 
00061 /*===========================================================================*/
00062 #define BOOST_BIMAP_GENERATE_RELATION_BINDER_2CP(                             \
00063                                                                               \
00064         SET_TYPE_OF,                                                          \
00065         CP1,                                                                  \
00066         CP2                                                                   \
00067     )                                                                         \
00068                                                                               \
00069     template< class Relation >                                                \
00070     struct bind_to                                                            \
00071     {                                                                         \
00072         typedef SET_TYPE_OF                                                   \
00073         <                                                                     \
00074             Relation,                                                         \
00075             BOOST_DEDUCED_TYPENAME mpl::apply<CP1,Relation>::type,            \
00076             BOOST_DEDUCED_TYPENAME mpl::apply<CP2,Relation>::type             \
00077                                                                               \
00078         > type;                                                               \
00079                                                                               \
00080     };
00081 /*===========================================================================*/
00082 
00083 
00084 
00085 #endif // BOOST_BIMAP_DETAIL_GENERATE_RELATION_BINDER_HPP
Copyright 2006 Matias Capeletto

PrevUpHomeNext