stlab.adobe.com Adobe Systems Incorporated
iota.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_ALGORITHM_IOTA_HPP
10 #define ADOBE_ALGORITHM_IOTA_HPP
11 
12 #include <adobe/config.hpp>
13 
14 #include <adobe/functional.hpp>
15 
16 #include <boost/range/begin.hpp>
17 #include <boost/range/end.hpp>
18 
19 #include <algorithm>
20 
21 /*************************************************************************************************/
22 
23 namespace adobe {
24 
25 /*************************************************************************************************/
45 /*************************************************************************************************/
51 template <class ForwardIterator, class T>
52 void iota (ForwardIterator first, ForwardIterator last, const T& value)
53 {
54  std::generate(first, last, adobe::sequence_t<T>(value));
55 }
56 
62 template <class ForwardRange, class T>
63 void iota (ForwardRange& range, const T& value)
64 {
65  adobe::iota(boost::begin(range), boost::end(range), value);
66 }
67 
68 /*************************************************************************************************/
69 
70 } // namespace adobe
71 
72 /*************************************************************************************************/
73 
74 #endif
75 
76 /*************************************************************************************************/
void generate(ForwardRange &range, Generator gen)
generate implementation
Definition: generate.hpp:38
void iota(ForwardIterator first, ForwardIterator last, const T &value)
iota implementation
Definition: iota.hpp:52
A function object for sequence generation within a domain.
Definition: functional.hpp:338

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google