annotate DEPENDENCIES/generic/include/boost/range/adaptor/copied.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 // Boost.Range library
Chris@16 2 //
Chris@101 3 // Copyright Thorsten Ottosen, Neil Groves 2006. 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_COPIED_HPP
Chris@16 12 #define BOOST_RANGE_ADAPTOR_COPIED_HPP
Chris@16 13
Chris@16 14 #include <boost/range/adaptor/argument_fwd.hpp>
Chris@16 15 #include <boost/range/adaptor/sliced.hpp>
Chris@16 16 #include <boost/range/size_type.hpp>
Chris@16 17 #include <boost/range/iterator_range.hpp>
Chris@101 18 #include <boost/range/concepts.hpp>
Chris@16 19
Chris@16 20 namespace boost
Chris@16 21 {
Chris@16 22 namespace adaptors
Chris@16 23 {
Chris@16 24 struct copied
Chris@16 25 {
Chris@16 26 copied(std::size_t t_, std::size_t u_)
Chris@16 27 : t(t_), u(u_) {}
Chris@16 28
Chris@16 29 std::size_t t;
Chris@16 30 std::size_t u;
Chris@16 31 };
Chris@16 32
Chris@101 33 template<class CopyableRandomAccessRange>
Chris@101 34 inline CopyableRandomAccessRange
Chris@101 35 operator|(const CopyableRandomAccessRange& r, const copied& f)
Chris@16 36 {
Chris@101 37 BOOST_RANGE_CONCEPT_ASSERT((
Chris@101 38 RandomAccessRangeConcept<const CopyableRandomAccessRange>));
Chris@101 39
Chris@16 40 iterator_range<
Chris@101 41 BOOST_DEDUCED_TYPENAME range_iterator<
Chris@101 42 const CopyableRandomAccessRange
Chris@101 43 >::type
Chris@101 44 > temp(adaptors::slice(r, f.t, f.u));
Chris@101 45
Chris@101 46 return CopyableRandomAccessRange(temp.begin(), temp.end());
Chris@16 47 }
Chris@16 48
Chris@16 49 template<class CopyableRandomAccessRange>
Chris@16 50 inline CopyableRandomAccessRange
Chris@16 51 copy(const CopyableRandomAccessRange& rng, std::size_t t, std::size_t u)
Chris@16 52 {
Chris@101 53 BOOST_RANGE_CONCEPT_ASSERT((
Chris@101 54 RandomAccessRangeConcept<const CopyableRandomAccessRange>));
Chris@101 55
Chris@16 56 iterator_range<
Chris@101 57 BOOST_DEDUCED_TYPENAME range_iterator<
Chris@101 58 const CopyableRandomAccessRange
Chris@101 59 >::type
Chris@101 60 > temp(adaptors::slice(rng, t, u));
Chris@16 61
Chris@16 62 return CopyableRandomAccessRange( temp.begin(), temp.end() );
Chris@16 63 }
Chris@16 64 } // 'adaptors'
Chris@16 65
Chris@16 66 }
Chris@16 67
Chris@101 68 #endif // include guard