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 support/map_by.hpp
10 /// \brief map_by<tag>(b) function
12 #ifndef BOOST_BIMAP_SUPPORT_MAP_BY_HPP
13 #define BOOST_BIMAP_SUPPORT_MAP_BY_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
21 #include <boost/bimap/support/map_type_by.hpp>
22 #include <boost/bimap/relation/detail/access_builder.hpp>
25 #ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
31 /** \brief Gets a map view of a bidirectional map
33 Convertible to \c map_type_by<Tag,Bimap>::type
34 Instead of using \c map_type_by<Tag,Bimap>::type this functions use
35 \b Boost.call_traits to find the best way to return this value. To help
36 the user of this function the following metafunction is provided
41 template< class Tag, class Bimap >
42 struct map_by( Bimap & b );
44 } // namespace result_of
48 See also member_at, value_type_of.
52 template< class Tag, class Bimap >
53 BOOST_DEDUCED_TYPENAME result_of::map_by<Tag,Bimap>::type
56 } // namespace support
60 #endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
64 #ifndef BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
70 // Since it is very error-prone to directly write the hole bunch
71 // of relation accesor. They are buil from litle macro blocks that
72 // are both more readable, leading to self docummenting code and a
73 // lot more easier to understand and mantain.
74 // It is very important to note that the three building blocks have
75 // to laid in the same namespace in order to work. There is also
76 // important to keep them in order.
77 // The forward declaration are not necesary but they help a lot to
78 // the reader, as they undercover what is the signature of the
80 // In the end, it is not quicker to do it in this way because you
81 // write a lot. But this code has no complexity at all and almost
82 // every word writed is for documentation.
85 // -------------------------------------------------------------------------
89 template< class Tag, class Bimap >
90 struct map_by<Tag,Bimap>;
92 typedef -unspecified- type;
95 } // namespace result_of
99 BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
106 // -------------------------------------------------------------------------
108 BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
118 // --------------------------------------------------------------------------
120 BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
125 } // namespace support
126 } // namespace bimaps
129 #endif // BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
131 #endif // BOOST_BIMAP_SUPPORT_MAP_BY_HPP