Michele De Stefano's C++ Utilities
incr_seq.hpp
1 // incr_seq.hpp
2 //
3 // Copyright (c) 2012 - Michele De Stefano (micdestefano@users.sourceforge.net)
4 //
5 // Distributed under the MIT License (See accompanying file LICENSE)
6 
7 #ifndef INCR_SEQ_HPP_INCLUDED
8 #define INCR_SEQ_HPP_INCLUDED
9 
10 #include <algorithm>
11 #include <boost/lambda/lambda.hpp>
12 #include <boost/lambda/casts.hpp>
13 
14 template<class InIt>
15 void incr_seq(InIt b,InIt e) {
16  using namespace std;
17  using namespace boost::lambda;
18 
19  typedef typename std::iterator_traits<InIt>::value_type T;
20 
21  transform(b,e,b,ll_static_cast<T>(_1) + 1.0);
22 }
23 
24 #endif