annotate DEPENDENCIES/generic/include/boost/range/adaptor/indirected.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 // Boost.Range library
Chris@16 2 //
Chris@16 3 // Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and
Chris@16 4 // distribution is subject to the Boost Software License, Version
Chris@16 5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 6 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 7 //
Chris@16 8 // For more information, see http://www.boost.org/libs/range/
Chris@16 9 //
Chris@16 10
Chris@16 11 #ifndef BOOST_RANGE_ADAPTOR_INDIRECTED_HPP
Chris@16 12 #define BOOST_RANGE_ADAPTOR_INDIRECTED_HPP
Chris@16 13
Chris@16 14 #include <boost/range/iterator_range.hpp>
Chris@101 15 #include <boost/range/concepts.hpp>
Chris@16 16 #include <boost/iterator/indirect_iterator.hpp>
Chris@16 17
Chris@16 18 namespace boost
Chris@16 19 {
Chris@16 20 namespace range_detail
Chris@16 21 {
Chris@16 22 template< class R >
Chris@16 23 struct indirected_range :
Chris@16 24 public boost::iterator_range<
Chris@16 25 boost::indirect_iterator<
Chris@16 26 BOOST_DEDUCED_TYPENAME range_iterator<R>::type
Chris@16 27 >
Chris@16 28 >
Chris@16 29 {
Chris@16 30 private:
Chris@16 31 typedef boost::iterator_range<
Chris@16 32 boost::indirect_iterator<
Chris@16 33 BOOST_DEDUCED_TYPENAME range_iterator<R>::type
Chris@16 34 >
Chris@16 35 >
Chris@16 36 base;
Chris@16 37
Chris@16 38 public:
Chris@16 39 explicit indirected_range( R& r )
Chris@16 40 : base( r )
Chris@16 41 { }
Chris@16 42 };
Chris@16 43
Chris@16 44 struct indirect_forwarder {};
Chris@16 45
Chris@101 46 template< class SinglePassRange >
Chris@101 47 inline indirected_range<SinglePassRange>
Chris@101 48 operator|( SinglePassRange& r, indirect_forwarder )
Chris@16 49 {
Chris@101 50 BOOST_RANGE_CONCEPT_ASSERT((
Chris@101 51 SinglePassRangeConcept<SinglePassRange>));
Chris@101 52
Chris@101 53 return indirected_range<SinglePassRange>( r );
Chris@16 54 }
Chris@16 55
Chris@101 56 template< class SinglePassRange >
Chris@101 57 inline indirected_range<const SinglePassRange>
Chris@101 58 operator|( const SinglePassRange& r, indirect_forwarder )
Chris@16 59 {
Chris@101 60 BOOST_RANGE_CONCEPT_ASSERT((
Chris@101 61 SinglePassRangeConcept<const SinglePassRange>));
Chris@101 62
Chris@101 63 return indirected_range<const SinglePassRange>( r );
Chris@16 64 }
Chris@16 65
Chris@16 66 } // 'range_detail'
Chris@16 67
Chris@16 68 using range_detail::indirected_range;
Chris@16 69
Chris@16 70 namespace adaptors
Chris@16 71 {
Chris@16 72 namespace
Chris@16 73 {
Chris@16 74 const range_detail::indirect_forwarder indirected =
Chris@16 75 range_detail::indirect_forwarder();
Chris@16 76 }
Chris@16 77
Chris@101 78 template<class SinglePassRange>
Chris@101 79 inline indirected_range<SinglePassRange>
Chris@101 80 indirect(SinglePassRange& rng)
Chris@16 81 {
Chris@101 82 BOOST_RANGE_CONCEPT_ASSERT((
Chris@101 83 SinglePassRangeConcept<SinglePassRange>));
Chris@101 84 return indirected_range<SinglePassRange>(rng);
Chris@16 85 }
Chris@16 86
Chris@101 87 template<class SinglePassRange>
Chris@101 88 inline indirected_range<const SinglePassRange>
Chris@101 89 indirect(const SinglePassRange& rng)
Chris@16 90 {
Chris@101 91 BOOST_RANGE_CONCEPT_ASSERT((
Chris@101 92 SinglePassRangeConcept<const SinglePassRange>));
Chris@101 93
Chris@101 94 return indirected_range<const SinglePassRange>(rng);
Chris@16 95 }
Chris@16 96 } // 'adaptors'
Chris@16 97
Chris@16 98 }
Chris@16 99
Chris@16 100 #endif