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