Back to home page

EIC code displayed by LXR

 
 

    


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

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 relation/support/get.hpp
0010 /// \brief get<tag>(r) function
0011 
0012 #ifndef BOOST_BIMAP_RELATION_SUPPORT_GET_HPP
0013 #define BOOST_BIMAP_RELATION_SUPPORT_GET_HPP
0014 
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018 
0019 #include <boost/config.hpp>
0020 
0021 #include <boost/bimap/relation/support/value_type_of.hpp>
0022 
0023 #include <boost/bimap/relation/detail/access_builder.hpp>
0024 
0025 #include <boost/mpl/if.hpp>
0026 #include <boost/type_traits/is_same.hpp>
0027 #include <boost/type_traits/is_const.hpp>
0028 
0029 #ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
0030 
0031 
0032 namespace boost {
0033 namespace bimaps {
0034 namespace relation {
0035 namespace support {
0036 
0037 /** \brief Gets a pair view of the relation.
0038 
0039 \ingroup relation_group
0040                                                                         **/
0041 
0042 template< class Tag, class SymmetricType >
0043 BOOST_DEDUCED_TYPENAME result_of::get<Tag,SymmetricType>::type
0044     get( SymmetricType & );
0045 
0046 } // namespace support
0047 } // namespace relation
0048 } // namespace bimaps
0049 } // namespace boost
0050 
0051 #endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
0052 
0053 
0054 
0055 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0056 
0057 namespace boost {
0058 namespace bimaps {
0059 namespace relation {
0060 namespace support {
0061 
0062 // Since it is very error-prone to directly write the hole bunch
0063 // of relation accesor. They are built from little macro blocks that
0064 // are both more readable, leading to self docummenting code and a
0065 // lot more easier to understand and maintain.
0066 // It is very important to note that the three building blocks have
0067 // to laid in the same namespace in order to work. There is also
0068 // important to keep them in order.
0069 // The forward declaration are not necessary but they help a lot to
0070 // the reader, as they undercover what is the signature of the
0071 // result code.
0072 // In the end, it is not quicker to do it in this way because you
0073 // write a lot. But this code has no complexity at all and almost
0074 // every word writed is for documentation.
0075 
0076 // Result of
0077 // -------------------------------------------------------------------------
0078 /*
0079     namespace result_of {
0080 
0081     template< class Tag, class Relation >
0082     struct get<Tag,Relation>;
0083     {
0084         typedef -unspecified- type;
0085     };
0086 
0087     } // namespace result_of
0088 
0089 */
0090 
0091 BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
0092 (
0093     get,
0094     value_type_of
0095 )
0096 
0097 
0098 
0099 // Implementation
0100 // -------------------------------------------------------------------------
0101 
0102 BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
0103 (
0104     get,
0105     SymmetricType,
0106     st,
0107     return st.get_left(),
0108     return st.get_right()
0109 )
0110 
0111 namespace detail {
0112 
0113 template< class SymmetricType >
0114 BOOST_DEDUCED_TYPENAME result_of::get<
0115     ::boost::bimaps::relation::member_at::info, SymmetricType >::type
0116 get(::boost::bimaps::relation::member_at::info, SymmetricType & rel)
0117 {
0118     return rel.info;
0119 }
0120 
0121 } // namespace detail
0122 
0123 // Interface
0124 //----------------------------------------------------------------------------
0125 
0126 BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
0127 (
0128     get
0129 )
0130 
0131 
0132 } // namespace support
0133 } // namespace relation
0134 } // namespace bimaps
0135 } // namespace boost
0136 
0137 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0138 
0139 #endif // BOOST_BIMAP_RELATION_SUPPORT_GET_HPP
0140