File indexing completed on 2025-01-18 09:29:38
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_BIMAP_DETAIL_MODIFIER_ADAPTOR_HPP
0013 #define BOOST_BIMAP_DETAIL_MODIFIER_ADAPTOR_HPP
0014
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018
0019 #include <boost/config.hpp>
0020
0021 namespace boost {
0022 namespace bimaps {
0023 namespace detail {
0024
0025
0026
0027 template
0028 <
0029 class Modifier,
0030 class NewArgument,
0031 class FirstExtractor,
0032 class SecondExtractor
0033 >
0034 struct relation_modifier_adaptor :
0035 Modifier,
0036 FirstExtractor,
0037 SecondExtractor
0038 {
0039 typedef NewArgument argument_type;
0040 typedef void result_type;
0041
0042 relation_modifier_adaptor( const Modifier & m ) : Modifier(m) {}
0043 relation_modifier_adaptor( const Modifier & m,
0044 const FirstExtractor & fe,
0045 const SecondExtractor & se ) :
0046 Modifier(m), FirstExtractor(fe), SecondExtractor(se) {}
0047
0048 void operator()( NewArgument & x ) const
0049 {
0050 Modifier::operator()(
0051 FirstExtractor ::operator()( x ),
0052 SecondExtractor::operator()( x )
0053 );
0054 }
0055 };
0056
0057
0058
0059
0060
0061 template
0062 <
0063 class Modifier,
0064 class NewArgument,
0065 class Extractor
0066 >
0067 struct unary_modifier_adaptor :
0068 Modifier,
0069 Extractor
0070 {
0071 typedef NewArgument argument_type;
0072 typedef void result_type;
0073
0074 unary_modifier_adaptor( const Modifier & m ) : Modifier(m) {}
0075 unary_modifier_adaptor( const Modifier & m,
0076 const Extractor & fe) :
0077 Modifier(m), Extractor(fe) {}
0078
0079 void operator()( NewArgument & x ) const
0080 {
0081 Modifier::operator()( Extractor::operator()( x ) );
0082 }
0083 };
0084
0085
0086 }
0087 }
0088 }
0089
0090
0091 #endif