File indexing completed on 2025-01-18 09:53:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #if !defined(BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
0012 #define BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED
0013
0014 #include <boost/config.hpp>
0015 #include <boost/iterator_adaptors.hpp>
0016 #include <boost/iterator/transform_iterator.hpp>
0017
0018 #include <boost/assert.hpp>
0019
0020
0021 #ifdef BOOST_HAS_ABI_HEADERS
0022 #include BOOST_ABI_PREFIX
0023 #endif
0024
0025
0026 namespace boost {
0027 namespace wave {
0028 namespace impl {
0029
0030
0031
0032
0033
0034
0035
0036 template <class AdaptableUnaryFunctionT, class IteratorT>
0037 class ref_transform_iterator_generator
0038 {
0039 typedef typename AdaptableUnaryFunctionT::result_type return_type;
0040 typedef typename AdaptableUnaryFunctionT::argument_type argument_type;
0041
0042 public:
0043 typedef boost::transform_iterator<
0044 return_type (*)(argument_type), IteratorT, return_type>
0045 type;
0046 };
0047
0048 template <class AdaptableUnaryFunctionT, class IteratorT>
0049 inline
0050 typename ref_transform_iterator_generator<
0051 AdaptableUnaryFunctionT, IteratorT>::type
0052 make_ref_transform_iterator(
0053 IteratorT base, AdaptableUnaryFunctionT const &f)
0054 {
0055 typedef typename ref_transform_iterator_generator<
0056 AdaptableUnaryFunctionT, IteratorT>::type
0057 iterator_type;
0058 return iterator_type(base, f.transform);
0059 }
0060
0061
0062
0063
0064 template <typename TokenT, typename ParseTreeNodeT>
0065 struct get_token_value {
0066
0067 typedef TokenT const &result_type;
0068 typedef ParseTreeNodeT const &argument_type;
0069
0070 static result_type
0071 transform (argument_type node)
0072 {
0073 BOOST_ASSERT(1 == std::distance(node.value.begin(),
0074 node.value.end()));
0075 return *node.value.begin();
0076 }
0077 };
0078
0079
0080 }
0081 }
0082 }
0083
0084
0085 #ifdef BOOST_HAS_ABI_HEADERS
0086 #include BOOST_ABI_SUFFIX
0087 #endif
0088
0089 #endif