Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:39

0001 // Boost.Bimap
0002 //
0003 // Copyright (c) 2006-2007 Matias Capeletto
0004 //
0005 // Distributed under the Boost Software License, Version 1.0.
0006 // (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 /// \file support/map_by.hpp
0010 /// \brief map_by<tag>(b) function
0011 
0012 #ifndef BOOST_BIMAP_SUPPORT_MAP_BY_HPP
0013 #define BOOST_BIMAP_SUPPORT_MAP_BY_HPP
0014 
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018 
0019 #include <boost/config.hpp>
0020 
0021 #include <boost/bimap/support/map_type_by.hpp>
0022 #include <boost/bimap/relation/detail/access_builder.hpp>
0023 
0024 
0025 #ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
0026 
0027 namespace boost {
0028 namespace bimaps {
0029 namespace support {
0030 
0031 /** \brief Gets a map view of a bidirectional map
0032 
0033 Convertible to \c map_type_by<Tag,Bimap>::type
0034 Instead of using \c map_type_by<Tag,Bimap>::type this functions use
0035 \b Boost.call_traits to find the best way to return this value. To help
0036 the user of this function the following metafunction is provided
0037 \code
0038 
0039 namespace result_of {
0040 
0041 template< class Tag, class Bimap >
0042 struct map_by( Bimap & b );
0043 
0044 } // namespace result_of
0045 
0046 \endcode
0047 
0048 See also member_at, value_type_of.
0049 \ingroup bimap_group
0050                                                                         **/
0051 
0052 template< class Tag, class Bimap >
0053 BOOST_DEDUCED_TYPENAME result_of::map_by<Tag,Bimap>::type
0054     map_by( Bimap & b );
0055 
0056 } // namespace support
0057 } // namespace bimaps
0058 } // namespace boost
0059 
0060 #endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
0061 
0062 
0063 
0064 #ifndef BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0065 
0066 namespace boost {
0067 namespace bimaps {
0068 namespace support {
0069 
0070 // Since it is very error-prone to directly write the hole bunch
0071 // of relation accesor. They are built from little macro blocks that
0072 // are both more readable, leading to self docummenting code and a
0073 // lot more easier to understand and maintain.
0074 // It is very important to note that the three building blocks have
0075 // to laid in the same namespace in order to work. There is also
0076 // important to keep them in order.
0077 // The forward declaration are not necessary but they help a lot to
0078 // the reader, as they undercover what is the signature of the
0079 // result code.
0080 // In the end, it is not quicker to do it in this way because you
0081 // write a lot. But this code has no complexity at all and almost
0082 // every word writed is for documentation.
0083 
0084 // Result of
0085 // -------------------------------------------------------------------------
0086 /*
0087     namespace result_of {
0088 
0089     template< class Tag, class Bimap >
0090     struct map_by<Tag,Bimap>;
0091     {
0092         typedef -unspecified- type;
0093     };
0094 
0095     } // namespace result_of
0096 
0097 */
0098 
0099 BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
0100 (
0101     map_by,
0102     map_type_by
0103 )
0104 
0105 // Implementation
0106 // -------------------------------------------------------------------------
0107 
0108 BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
0109 (
0110     map_by,
0111     Bimap,
0112     b,
0113     return b.left,
0114     return b.right
0115 )
0116 
0117 // Interface
0118 // --------------------------------------------------------------------------
0119 
0120 BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
0121 (
0122     map_by
0123 )
0124 
0125 } // namespace support
0126 } // namespace bimaps
0127 } // namespace boost
0128 
0129 #endif // BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0130 
0131 #endif // BOOST_BIMAP_SUPPORT_MAP_BY_HPP
0132