3 // Copyright (c) 2006-2007 Matias Capeletto
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)
9 /// \file relation/support/get.hpp
10 /// \brief get<tag>(r) function
12 #ifndef BOOST_BIMAP_RELATION_SUPPORT_GET_HPP
13 #define BOOST_BIMAP_RELATION_SUPPORT_GET_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
21 #include <boost/bimap/relation/support/value_type_of.hpp>
23 #include <boost/bimap/relation/detail/access_builder.hpp>
25 #include <boost/mpl/if.hpp>
26 #include <boost/type_traits/is_same.hpp>
27 #include <boost/type_traits/is_const.hpp>
29 #ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
37 /** \brief Gets a pair view of the relation.
39 \ingroup relation_group
42 template< class Tag, class SymmetricType >
43 BOOST_DEDUCED_TYPENAME result_of::get<Tag,SymmetricType>::type
44 get( SymmetricType & );
46 } // namespace support
47 } // namespace relation
51 #endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
55 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
62 // Since it is very error-prone to directly write the hole bunch
63 // of relation accesor. They are buil from litle macro blocks that
64 // are both more readable, leading to self docummenting code and a
65 // lot more easier to understand and mantain.
66 // It is very important to note that the three building blocks have
67 // to laid in the same namespace in order to work. There is also
68 // important to keep them in order.
69 // The forward declaration are not necesary but they help a lot to
70 // the reader, as they undercover what is the signature of the
72 // In the end, it is not quicker to do it in this way because you
73 // write a lot. But this code has no complexity at all and almost
74 // every word writed is for documentation.
77 // -------------------------------------------------------------------------
81 template< class Tag, class Relation >
82 struct get<Tag,Relation>;
84 typedef -unspecified- type;
87 } // namespace result_of
91 BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
100 // -------------------------------------------------------------------------
102 BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
107 return st.get_left(),
108 return st.get_right()
113 template< class SymmetricType >
114 BOOST_DEDUCED_TYPENAME result_of::get<
115 ::boost::bimaps::relation::member_at::info, SymmetricType >::type
116 get(::boost::bimaps::relation::member_at::info, SymmetricType & rel)
121 } // namespace detail
124 //----------------------------------------------------------------------------
126 BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
132 } // namespace support
133 } // namespace relation
134 } // namespace bimaps
137 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
139 #endif // BOOST_BIMAP_RELATION_SUPPORT_GET_HPP