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/concept_tags.hpp 10 /// \brief Bimap tags and concepts 11 12 #ifndef BOOST_BIMAP_DETAIL_CONCEPT_TAGS_HPP 13 #define BOOST_BIMAP_DETAIL_CONCEPT_TAGS_HPP 14 15 #if defined(_MSC_VER) 16 #pragma once 17 #endif 18 19 #include <boost/config.hpp> 20 21 #include <boost/mpl/identity.hpp> 22 #include <boost/mpl/placeholders.hpp> 23 #include <boost/mpl/bool.hpp> 24 25 namespace boost { 26 namespace bimaps { 27 namespace detail { 28 29 /// \brief Tag of {SetType}_of definition classes 30 /** 31 The {SetType}_of classes are derived from this class so it is easy to construct 32 metafunctions. For example now is easy to create a is_set_type_of metafunction. 33 **/ 34 35 struct set_type_of_tag {}; 36 37 /// \brief Tag of {SetType}_of_relation definition classes 38 39 struct set_type_of_relation_tag {}; 40 41 /// \brief Tag of {Side}_based identifiers 42 43 struct side_based_tag : set_type_of_relation_tag {}; 44 45 } // namespace detail 46 47 48 /** \struct boost::bimaps::left_based 49 \brief Tag to indicate that the main view will be based on the left side. 50 51 This is convenient because the multi-index core will be more efficient. 52 If possible use this options or the right based one. 53 54 See also right_based. 55 **/ 56 57 /** \struct boost::bimaps::right_based 58 \brief Tag to indicate that the main view will be based on the right side. 59 60 This is convenient because the multi-index core will be more efficient. 61 If possible use this options or the right based one. 62 63 See also left_based. 64 **/ 65 66 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES 67 68 struct left_based : ::boost::bimaps::detail::side_based_tag 69 { 70 // I run into troubles if I do not define bind for side based tags. 71 // Maybe a more coherent way of binding the relation can be developed. 72 template< class Relation > struct bind_to { typedef void type; }; 73 74 typedef mpl::bool_<true> left_mutable_key; 75 typedef mpl::bool_<true> right_mutable_key; 76 }; 77 78 struct right_based : ::boost::bimaps::detail::side_based_tag 79 { 80 // I run into troubles if I do not define bind for side based tags. 81 // Maybe a more coherent way of binding the relation can be developed. 82 template< class Relation > struct bind_to { typedef void type; }; 83 84 typedef mpl::bool_<true> left_mutable_key; 85 typedef mpl::bool_<true> right_mutable_key; 86 }; 87 88 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES 89 90 typedef mpl::_ _relation; 91 92 } // namespace bimaps 93 } // namespace boost 94 95 96 #endif // BOOST_BIMAP_DETAIL_CONCEPT_TAGS_HPP 97 98