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/pair_by.hpp
10 /// \brief pair_by<member>(r) function
12 #ifndef BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP
13 #define BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
21 #include <boost/bimap/relation/support/pair_type_by.hpp>
22 #include <boost/bimap/relation/detail/access_builder.hpp>
24 #ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
31 /** \brief Gets a pair view of the relation.
33 \ingroup relation_group
36 template< class Tag, class Relation >
37 BOOST_DEDUCED_TYPENAME result_of::pair_by<Tag,Relation>::type
38 pair_by( Relation & rel );
40 } // namespace support
41 } // namespace relation
45 #endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
48 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
56 // Since it is very error-prone to directly write the hole bunch
57 // of relation accesor. They are buil from litle macro blocks that
58 // are both more readable, leading to self docummenting code and a
59 // lot more easier to understand and mantain.
60 // It is very important to note that the three building blocks have
61 // to laid in the same namespace in order to work. There is also
62 // important to keep them in order.
63 // The forward declaration are not necesary but they help a lot to
64 // the reader, as they undercover what is the signature of the
66 // In the end, it is not quicker to do it in this way because you
67 // write a lot. But this code has no complexity at all and almost
68 // every word writed is for documentation.
71 // -------------------------------------------------------------------------
75 template< class Tag, class Relation >
76 struct pair_by<Tag,Relation>;
78 typedef -unspecified- type;
81 } // namespace result_of
84 BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
93 // -------------------------------------------------------------------------
95 BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
100 return rel.get_left_pair(),
101 return rel.get_right_pair()
105 // --------------------------------------------------------------------------
107 BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
112 } // namespace support
113 } // namespace relation
114 } // namespace bimaps
118 #endif // BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
120 #endif // BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP