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_pair_functor.hpp
0010 /// \brief get_pair_functor definition
0011 
0012 #ifndef BOOST_BIMAP_RELATION_SUPPORT_GET_PAIR_FUNCTOR_HPP
0013 #define BOOST_BIMAP_RELATION_SUPPORT_GET_PAIR_FUNCTOR_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_by.hpp>
0022 
0023 namespace boost {
0024 namespace bimaps {
0025 namespace relation {
0026 namespace support {
0027 
0028 /// \brief A Functor that takes a relation as a parameter an return the desired view.
0029 /**
0030 
0031 This functor is included to help users of the relation class when using
0032 stl algorithms.
0033 
0034 See also member_at, pair_by().
0035 \ingroup relation_group
0036 
0037                                                                                   **/
0038 
0039 template< class Tag, class Relation >
0040 struct get_pair_functor
0041 {
0042     BOOST_DEDUCED_TYPENAME result_of::pair_by<Tag,Relation>::type
0043     operator()( Relation & r ) const
0044     {
0045         return pair_by<Tag>(r);
0046     }
0047 
0048     BOOST_DEDUCED_TYPENAME result_of::pair_by<Tag,const Relation>::type
0049     operator()( const Relation & r ) const
0050     {
0051         return pair_by<Tag>(r);
0052     }
0053 };
0054 
0055 
0056 /// \brief A Functor that takes a relation as a parameter an return the above view.
0057 /**
0058 
0059 \ingroup relation_group
0060                                                                                   **/
0061 
0062 template< class Relation >
0063 struct get_above_view_functor
0064 {
0065     BOOST_DEDUCED_TYPENAME Relation::above_view &
0066     operator()( Relation & r ) const
0067     {
0068         return r.get_view();
0069     }
0070 
0071     const BOOST_DEDUCED_TYPENAME Relation::above_view &
0072     operator()( const Relation & r ) const
0073     {
0074         return r.get_view();
0075     }
0076 };
0077 
0078 } // namespace support
0079 } // namespace relation
0080 } // namespace bimaps
0081 } // namespace boost
0082 
0083 
0084 #endif // BOOST_BIMAP_RELATION_SUPPORT_GET_PAIR_FUNCTOR_HPP
0085