Range.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 #ifndef HH_SENF_Utils_Range_
18 #define HH_SENF_Utils_Range_ 1
19 
20 // Custom includes
21 #include <boost/range/iterator_range.hpp>
22 #include <boost/iterator/transform_iterator.hpp>
23 
24 //#include "Range.mpp"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 
34  template <class Range, class Fn>
35  boost::iterator_range<
36  boost::transform_iterator< Fn,
37  typename boost::range_const_iterator<Range>::type > >
38  make_transform_range(Range const & range, Fn const & fn);
39 
40  template <class Range, class Fn>
41  boost::iterator_range<
42  boost::transform_iterator< Fn,
43  typename boost::range_iterator<Range>::type > >
44  make_transform_range(Range & range, Fn const & fn);
45 
46  template <class Range, class Iterator>
47  void copy_range(Range const & range, Iterator const & i);
48 
49  template <class Range, class Iterator>
50  void copy_range(Range & range, Iterator const & i);
51 
52  template <class Range>
53  bool has_one_elt(Range r);
54 }
55 
56 //-/////////////////////////////////////////////////////////////////////////////////////////////////
57 //#include "Range.cci"
58 //#include "Range.ct"
59 #include "Range.cti"
60 #endif
61 
62 
63 // Local Variables:
64 // mode: c++
65 // fill-column: 100
66 // comment-column: 40
67 // c-file-style: "senf"
68 // indent-tabs-mode: nil
69 // ispell-local-dictionary: "american"
70 // compile-command: "scons -u test"
71 // End:
boost::iterator_range< boost::transform_iterator< Fn, typename boost::range_const_iterator< Range >::type > > make_transform_range(Range const &range, Fn const &fn)
Make a boost::iterator_range from boost::trasform_iterator.
void copy_range(Range const &range, Iterator const &i)
bool has_one_elt(Range r)