From ec58d739eb3e69345fa56193de725b5faa9ae1cb Mon Sep 17 00:00:00 2001 From: Neil Groves Date: Wed, 28 Apr 2010 16:29:11 +0000 Subject: [PATCH] Boost.Range documentation iteration. [SVN r61650] --- doc/html/range/library_headers/adaptors.html | 232 ++++++ doc/html/range/library_headers/algorithm.html | 683 ++++++++++++++++++ .../library_headers/algorithm_extensions.html | 172 +++++ doc/html/range/library_headers/general.html | 551 ++++++++++++++ .../adaptors/reference/adjacent_filtered.html | 151 ++++ .../reference/adaptors/reference/copied.html | 151 ++++ .../adaptors/reference/filtered.html | 155 ++++ .../reference/adaptors/reference/indexed.html | 185 +++++ .../adaptors/reference/indirected.html | 145 ++++ .../adaptors/reference/map_keys.html | 145 ++++ .../adaptors/reference/map_values.html | 145 ++++ .../adaptors/reference/replaced.html | 160 ++++ .../adaptors/reference/replaced_if.html | 165 +++++ .../adaptors/reference/reversed.html | 139 ++++ .../reference/adaptors/reference/sliced.html | 149 ++++ .../reference/adaptors/reference/strided.html | 146 ++++ .../adaptors/reference/tokenized.html | 142 ++++ .../adaptors/reference/transformed.html | 156 ++++ .../reference/adaptors/reference/uniqued.html | 141 ++++ 19 files changed, 3913 insertions(+) create mode 100644 doc/html/range/library_headers/adaptors.html create mode 100644 doc/html/range/library_headers/algorithm.html create mode 100644 doc/html/range/library_headers/algorithm_extensions.html create mode 100644 doc/html/range/library_headers/general.html create mode 100644 doc/html/range/reference/adaptors/reference/adjacent_filtered.html create mode 100644 doc/html/range/reference/adaptors/reference/copied.html create mode 100644 doc/html/range/reference/adaptors/reference/filtered.html create mode 100644 doc/html/range/reference/adaptors/reference/indexed.html create mode 100644 doc/html/range/reference/adaptors/reference/indirected.html create mode 100644 doc/html/range/reference/adaptors/reference/map_keys.html create mode 100644 doc/html/range/reference/adaptors/reference/map_values.html create mode 100644 doc/html/range/reference/adaptors/reference/replaced.html create mode 100644 doc/html/range/reference/adaptors/reference/replaced_if.html create mode 100644 doc/html/range/reference/adaptors/reference/reversed.html create mode 100644 doc/html/range/reference/adaptors/reference/sliced.html create mode 100644 doc/html/range/reference/adaptors/reference/strided.html create mode 100644 doc/html/range/reference/adaptors/reference/tokenized.html create mode 100644 doc/html/range/reference/adaptors/reference/transformed.html create mode 100644 doc/html/range/reference/adaptors/reference/uniqued.html diff --git a/doc/html/range/library_headers/adaptors.html b/doc/html/range/library_headers/adaptors.html new file mode 100644 index 0000000..f8810a4 --- /dev/null +++ b/doc/html/range/library_headers/adaptors.html @@ -0,0 +1,232 @@ + + + +Adaptors + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Header +

+
+

+ Includes +

+
+

+ <boost/range/adaptor/adjacent_filtered.hpp> +

+
+

+ adjacent_filtered +

+
+

+ <boost/range/adaptor/copied.hpp> +

+
+

+ copied +

+
+

+ <boost/range/adaptor/filtered.hpp> +

+
+

+ filtered +

+
+

+ <boost/range/adaptor/indexed.hpp> +

+
+

+ indexed +

+
+

+ <boost/range/adaptor/indirected.hpp. +

+
+

+ indirected +

+
+

+ <boost/range/adaptor/map.hpp> +

+
+

+ map_keys + map_values +

+
+

+ <boost/range/adaptor/replaced.hpp> +

+
+

+ replaced +

+
+

+ <boost/range/adaptor/replaced_if.hpp> +

+
+

+ replaced_if +

+
+

+ <boost/range/adaptor/reversed.hpp> +

+
+

+ reversed +

+
+

+ <boost/range/adaptor/sliced.hpp> +

+
+

+ sliced +

+
+

+ <boost/range/adaptor/strided.hpp> +

+
+

+ strided +

+
+

+ <boost/range/adaptor/tokenized.hpp> +

+
+

+ tokenized +

+
+

+ <boost/range/adaptor/transformed.hpp> +

+
+

+ transformed +

+
+

+ <boost/range/adaptor/uniqued.hpp> +

+
+

+ uniqued +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/library_headers/algorithm.html b/doc/html/range/library_headers/algorithm.html new file mode 100644 index 0000000..6beb47e --- /dev/null +++ b/doc/html/range/library_headers/algorithm.html @@ -0,0 +1,683 @@ + + + +Algorithm + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Header +

+
+

+ Includes +

+
+

+ <boost/range/algorithm/adjacent_find.hpp> +

+
+

+ adjacent_find +

+
+

+ <boost/range/algorithm/binary_search.hpp> +

+
+

+ binary_search +

+
+

+ <boost/range/algorithm/copy.hpp> +

+
+

+ copy +

+
+

+ <boost/range/algorithm/copy_backward.hpp> +

+
+

+ copy_backward +

+
+

+ <boost/range/algorithm/count.hpp> +

+
+

+ count +

+
+

+ <boost/range/algorithm/count_if.hpp> +

+
+

+ count_if +

+
+

+ <boost/range/algorithm/equal.hpp> +

+
+

+ equal +

+
+

+ <boost/range/algorithm/equal_range.hpp> +

+
+

+ equal_range +

+
+

+ <boost/range/algorithm/fill.hpp> +

+
+

+ fill +

+
+

+ <boost/range/algorithm/fill_n.hpp> +

+
+

+ fill_n +

+
+

+ <boost/range/algorithm/find.hpp> +

+
+

+ find +

+
+

+ <boost/range/algorithm/find_end.hpp> +

+
+

+ find_end +

+
+

+ <boost/range/algorithm/find_first_of.hpp> +

+
+

+ find_first_of +

+
+

+ <boost/range/algorithm/find_if.hpp> +

+
+

+ find_if +

+
+

+ <boost/range/algorithm/for_each.hpp> +

+
+

+ for_each +

+
+

+ <boost/range/algorithm/generate.hpp> +

+
+

+ generate +

+
+

+ <boost/range/algorithm/heap_algorithm.hpp> +

+
+

+ push_heap + pop_heap + make_heap + sort_heap +

+
+

+ <boost/range/algorithm/inplace_merge.hpp> +

+
+

+ inplace_merge +

+
+

+ <boost/range/algorithm/lexicographical_compare.hpp> +

+
+

+ lexicographical_compare +

+
+

+ <boost/range/algorithm/lower_bound.hpp> +

+
+

+ lower_bound +

+
+

+ <boost/range/algorithm/max_element.hpp> +

+
+

+ max_element +

+
+

+ <boost/range/algorithm/merge.hpp> +

+
+

+ merge +

+
+

+ <boost/range/algorithm/min_element.hpp> +

+
+

+ min_element +

+
+

+ <boost/range/algorithm/mismatch.hpp> +

+
+

+ mismatch +

+
+

+ <boost/range/algorithm/nth_element.hpp> +

+
+

+ nth_element +

+
+

+ <boost/range/algorithm/partial_sort.hpp> +

+
+

+ partial_sort +

+
+

+ <boost/range/algorithm/partition.hpp> +

+
+

+ partition +

+
+

+ <boost/range/algorithm/permutation.hpp> +

+
+

+ next_permutation + prev_permutation +

+
+

+ <boost/range/algorithm/random_shuffle.hpp> +

+
+

+ random_shuffle +

+
+

+ <boost/range/algorithm/remove.hpp> +

+
+

+ remove +

+
+

+ <boost/range/algorithm/remove_copy.hpp> +

+
+

+ remove_copy +

+
+

+ <boost/range/algorithm/remove_copy_if.hpp> +

+
+

+ remove_copy_if +

+
+

+ <boost/range/algorithm/remove_if.hpp> +

+
+

+ remove_if +

+
+

+ <boost/range/algorithm/replace.hpp> +

+
+

+ replace +

+
+

+ <boost/range/algorithm/replace_copy.hpp> +

+
+

+ replace_copy +

+
+

+ <boost/range/algorithm/replace_copy_if.hpp> +

+
+

+ replace_copy_if +

+
+

+ <boost/range/algorithm/replace_if.hpp> +

+
+

+ replace_if +

+
+

+ <boost/range/algorithm/reverse.hpp> +

+
+

+ reverse +

+
+

+ <boost/range/algorithm/reverse_copy.hpp> +

+
+

+ reverse_copy +

+
+

+ <boost/range/algorithm/rotate.hpp> +

+
+

+ rotate +

+
+

+ <boost/range/algorithm/rotate_copy.hpp> +

+
+

+ rotate_copy +

+
+

+ <boost/range/algorithm/search.hpp> +

+
+

+ search +

+
+

+ <boost/range/algorithm/search_n.hpp> +

+
+

+ search_n +

+
+

+ <boost/range/algorithm/set_algorithm.hpp> +

+
+

+ includes + set_union + set_intersection + set_difference + set_symmetric_difference +

+
+

+ <boost/range/algorithm/sort.hpp> +

+
+

+ sort +

+
+

+ <boost/range/algorithm/stable_partition.hpp> +

+
+

+ stable_partition +

+
+

+ <boost/range/algorithm/swap_ranges.hpp> +

+
+

+ swap_ranges +

+
+

+ <boost/range/algorithm/transform.hpp> +

+
+

+ transform +

+
+

+ <boost/range/algorithm/unique.hpp> +

+
+

+ unique +

+
+

+ <boost/range/algorithm/unique_copy.hpp> +

+
+

+ unique_copy +

+
+

+ <boost/range/algorithm/upper_bound.hpp> +

+
+

+ upper_bound +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/library_headers/algorithm_extensions.html b/doc/html/range/library_headers/algorithm_extensions.html new file mode 100644 index 0000000..f3dd061 --- /dev/null +++ b/doc/html/range/library_headers/algorithm_extensions.html @@ -0,0 +1,172 @@ + + + +Algorithm Extensions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Header +

+
+

+ Includes +

+
+

+ <boost/range/algorithm_ext/copy_n.hpp> +

+
+

+ copy_n +

+
+

+ <boost/range/algorithm_ext/erase.hpp> +

+
+

+ erase +

+
+

+ <boost/range/algorithm_ext/for_each.hpp> +

+
+

+ for_each +

+
+

+ <boost/range/algorithm_ext/insert.hpp> +

+
+

+ insert +

+
+

+ <boost/range/algorithm_ext/iota.hpp> +

+
+

+ iota +

+
+

+ <boost/range/algorithm_ext/is_sorted.hpp> +

+
+

+ is_sorted +

+
+

+ <boost/range/algorithm_ext/overwrite.hpp> +

+
+

+ overwrite +

+
+

+ <boost/range/algorithm_ext/push_back.hpp> +

+
+

+ push_back +

+
+

+ <boost/range/algorithm_ext/push_front.hpp> +

+
+

+ push_front +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/library_headers/general.html b/doc/html/range/library_headers/general.html new file mode 100644 index 0000000..382215d --- /dev/null +++ b/doc/html/range/library_headers/general.html @@ -0,0 +1,551 @@ + + + +General + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Header +

+
+

+ Includes +

+
+

+ Related Concept +

+
+

+ <boost/range.hpp> +

+
+

+ everything from Boost.Range version 1 (Boost versions 1.42 and + below). Includes the core range functions and metafunctinos, but + excludes Range Adaptors and Range Algorithms. +

+
+

+ - +

+
+

+ <boost/range/metafunctions.hpp> +

+
+

+ every metafunction +

+
+

+ - +

+
+

+ <boost/range/functions.hpp> +

+
+

+ every function +

+
+

+ - +

+
+

+ <boost/range/value_type.hpp> +

+
+

+ range_value +

+
+

+ Single Pass Range +

+
+

+ <boost/range/iterator.hpp> +

+
+

+ range_iterator +

+
+

+ Single Pass Range +

+
+

+ <boost/range/difference_type.hpp> +

+
+

+ range_difference +

+
+

+ Forward Range +

+
+

+ <boost/range/pointer.hpp> +

+
+

+ range_pointer +

+
+

+ - +

+
+

+ <boost/range/category.hpp> +

+
+

+ range_category +

+
+

+ - +

+
+

+ <boost/range/reverse_iterator.hpp> +

+
+

+ range_reverse_iterator +

+
+

+ Bidirectional + Range +

+
+

+ <boost/range/begin.hpp> +

+
+

+ begin and const_begin +

+
+

+ Single Pass Range +

+
+

+ <boost/range/end.hpp> +

+
+

+ end and const_end +

+
+

+ Single Pass Range +

+
+

+ <boost/range/empty.hpp> +

+
+

+ empty +

+
+

+ Single Pass Range +

+
+

+ <boost/range/distance.hpp> +

+
+

+ distance +

+
+

+ Forward Range +

+
+

+ <boost/range/size.hpp> +

+
+

+ size +

+
+

+ Random Access + Range +

+
+

+ <boost/range/rbegin.hpp> +

+
+

+ rbegin and const_rbegin +

+
+

+ Bidirectional + Range +

+
+

+ <boost/range/rend.hpp> +

+
+

+ rend and const_rend +

+
+

+ Bidirectional + Range +

+
+

+ <boost/range/as_array.hpp> +

+
+

+ as_array +

+
+

+ - +

+
+

+ <boost/range/as_literal.hpp> +

+
+

+ as_literal +

+
+

+ - +

+
+

+ <boost/range/iterator_range.hpp> +

+
+

+ iterator_range +

+
+

+ - +

+
+

+ <boost/range/sub_range.hpp> +

+
+

+ sub_range +

+
+

+ - +

+
+

+ <boost/range/concepts.hpp> +

+
+

+ Range concepts +

+
+

+ - +

+
+

+ <boost/range/adaptors.hpp> +

+
+

+ every range adaptor +

+
+

+ - +

+
+

+ <boost/range/algorithm.hpp> +

+
+

+ every range equivalent of an STL algorithm +

+
+

+ - +

+
+

+ <boost/range/algorithm_ext.hpp> +

+
+

+ every range algorithm that is an extension of the STL algorithms +

+
+

+ - +

+
+

+ <boost/range/counting_range.hpp> +

+
+

+ counting_range +

+
+

+ - +

+
+

+ <boost/range/istream_range.hpp> +

+
+

+ istream_range +

+
+

+ - +

+
+

+ <boost/range/irange.hpp> +

+
+

+ irange +

+
+

+ - +

+
+

+ <boost/range/join.hpp> +

+
+

+ join +

+
+

+ - +

+
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/adjacent_filtered.html b/doc/html/range/reference/adaptors/reference/adjacent_filtered.html new file mode 100644 index 0000000..e229ed4 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/adjacent_filtered.html @@ -0,0 +1,151 @@ + + + +adjacent_filtered + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::adjacent_filtered(bi_pred) +

+
+

+ Function +

+
+

+ boost::adaptors::adjacent_filter(rng, + bi_pred) +

+
+
    +
  • +Precondition: The value_type + of the range is convertible to both argument types of bi_pred. +
  • +
  • +Postcondition: For all adjacent elements + [x,y] in the returned range, bi_pred(x,y) + is true. +
  • +
  • +Throws: Whatever the copy constructor + of bi_pred might throw. +
  • +
  • +Range Category:SinglePassRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/adjacent_filtered.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <functional>
+#include <iostream>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 1,1,2,2,2,3,4,5,6;
+
+    boost::copy(
+        input | adjacent_filtered(std::not_equal_to<int>()),
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
1,2,3,4,5,6
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/copied.html b/doc/html/range/reference/adaptors/reference/copied.html new file mode 100644 index 0000000..52ba608 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/copied.html @@ -0,0 +1,151 @@ + + + +copied + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::copied(n, + m) +

+
+

+ Function +

+
+

+ boost::adaptors::copy(rng, + n, + m) +

+
+
    +
  • +Precondition:0 + <= n + && n + <= m + && m + < distance(rng) +
  • +
  • +Returns: A new iterator_range + that holds the sliced range [n,m) + of the original range. +
  • +
  • +Range Category:RandomAccessRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/copied.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9,10;
+
+    boost::copy(
+        input | copied(1, 5),
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
2,3,4,5
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/filtered.html b/doc/html/range/reference/adaptors/reference/filtered.html new file mode 100644 index 0000000..b130702 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/filtered.html @@ -0,0 +1,155 @@ + + + +filtered + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::filtered(pred) +

+
+

+ Function +

+
+

+ boost::adaptors::filter(rng, + pred) +

+
+
    +
  • +Precondition: The value_type + of the range is convertible to the argument type of pred. +
  • +
  • +Postcondition: For all adjacent elements + [x] in the returned range, pred(x) + is true. +
  • +
  • +Throws: Whatever the copy constructor + of pred might throw. +
  • +
  • +Range Category:ForwardRange +
  • +
  • +Returned Range Category:ForwardRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/filtered.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+struct is_even
+{
+    bool operator()( int x ) const { return x % 2 == 0; }
+};
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+
+    boost::copy(
+        input | filtered(is_even()),
+        std::ostream_iterator<int>(std::cout, ","));
+}
+
+

+

+
+

+ This would produce the output: +

+
2,4,6,8
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/indexed.html b/doc/html/range/reference/adaptors/reference/indexed.html new file mode 100644 index 0000000..90ae2a0 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/indexed.html @@ -0,0 +1,185 @@ + + + +indexed + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::indexed +

+
+

+ Function +

+
+

+ boost::adaptors::index(rng) +

+
+
    +
  • +Returns: A range adapted to return + both the element and the associated index. The returned range consists + of iterators that have in addition to the usual iterator member functions + an index() + member function that returns the appropriate index for the element + in the sequence corresponding with the iterator. +
  • +
  • +Range Category:SinglePassRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/indexed.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+template<class Iterator>
+void display_element_and_index(Iterator first, Iterator last)
+{
+    for (Iterator it = first; it != last; ++it)
+    {
+        std::cout << "Element = " << *it << " Index = " << it.index() << std::endl;
+    }
+}
+
+template<class SinglePassRange>
+void display_element_and_index(const SinglePassRange& rng)
+{
+    display_element_and_index(boost::begin(rng), boost::end(rng));
+}
+
+template<class Iterator1, class Iterator2>
+void check_element_and_index(
+        Iterator1 test_first,
+        Iterator1 test_last,
+        Iterator2 reference_first,
+        Iterator2 reference_last)
+{
+    BOOST_CHECK_EQUAL( std::distance(test_first, test_last),
+                       std::distance(reference_first, reference_last) );
+
+    int reference_index = 0;
+
+    Iterator1 test_it = test_first;
+    Iterator2 reference_it = reference_first;
+    for (; test_it != test_last; ++test_it, ++reference_it, ++reference_index)
+    {
+        BOOST_CHECK_EQUAL( *test_it, *reference_it );
+        BOOST_CHECK_EQUAL( test_it.index(), reference_index );
+    }
+}
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 10,20,30,40,50,60,70,80,90;
+
+    display_element_and_index( input | indexed(0) );
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
Element = 10 Index = 0
+Element = 20 Index = 1
+Element = 30 Index = 2
+Element = 40 Index = 3
+Element = 50 Index = 4
+Element = 60 Index = 5
+Element = 70 Index = 6
+Element = 80 Index = 7
+Element = 90 Index = 8
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/indirected.html b/doc/html/range/reference/adaptors/reference/indirected.html new file mode 100644 index 0000000..5313ed1 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/indirected.html @@ -0,0 +1,145 @@ + + + +indirected + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::indirected +

+
+

+ Function +

+
+

+ boost::adaptors::indirect(rng) +

+
+
    +
  • +Precondition: The value_type + of the range defines unary operator*() +
  • +
  • +Postcondition: For all elements x in the returned range, x is the result of *y + where y is the corresponding + element in the original range. +
  • +
  • +Range Category:SinglePassRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/indirected.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/shared_ptr.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+
+    std::vector<boost::shared_ptr<int> > input;
+
+    for (int i = 0; i < 10; ++i)
+        input.push_back(boost::shared_ptr<int>(new int(i)));
+
+    boost::copy(
+        input | indirected,
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
0,1,2,3,4,5,6,7,8,9
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/map_keys.html b/doc/html/range/reference/adaptors/reference/map_keys.html new file mode 100644 index 0000000..2b46c98 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/map_keys.html @@ -0,0 +1,145 @@ + + + +map_keys + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::map_keys +

+
+

+ Function +

+
+

+ boost::adaptors::keys(rng) +

+
+
    +
  • +Precondition: The value_type + of the range is an instantiation of std::pair. +
  • +
  • +Postcondition: For all elements x in the returned range, x is the result of y.first where y + is the corresponding element in the original range. +
  • +
  • +Range Category:SinglePassRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/map.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <map>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::map<int,int> input;
+    for (int i = 0; i < 10; ++i)
+        input.insert(std::make_pair(i, i * 10));
+
+    boost::copy(
+        input | map_keys,
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
0,1,2,3,4,5,6,7,8,9
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/map_values.html b/doc/html/range/reference/adaptors/reference/map_values.html new file mode 100644 index 0000000..8b3761f --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/map_values.html @@ -0,0 +1,145 @@ + + + +map_values + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::map_values +

+
+

+ Function +

+
+

+ boost::adaptors::values(rng) +

+
+
    +
  • +Precondition: The value_type + of the range is an instantiation of std::pair. +
  • +
  • +Postcondition: For all elements x in the returned range, x is the result of y.second where y + is the corresponding element in the original range. +
  • +
  • +Range Category:SinglePassRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/map.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <map>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::map<int,int> input;
+    for (int i = 0; i < 10; ++i)
+        input.insert(std::make_pair(i, i * 10));
+
+    boost::copy(
+        input | map_values,
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
0,10,20,30,40,50,60,70,80,90
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/replaced.html b/doc/html/range/reference/adaptors/reference/replaced.html new file mode 100644 index 0000000..61de327 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/replaced.html @@ -0,0 +1,160 @@ + + + +replaced + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::replaced(new_value, + old_value) +

+
+

+ Function +

+
+

+ boost::adaptors::replace(rng, + new_value, + old_value) +

+
+
    +
  • +Precondition:
      +
    • +new_value is convertible + to the value_type + of the range. +
    • +
    • +old_value is convertible + to the value_type + of the range. +
    • +
    +
  • +
  • +Postcondition: For all elements x in the returned range, the value + x is equal to the value + of (y + == old_value) ? new_value : + y where y + is the corresponding element in the original range. +
  • +
  • +Range Category:ForwardRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/replaced.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,2,5,2,7,2,9;
+
+    boost::copy(
+        input | replaced(2, 10),
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
1,10,3,10,5,10,7,10,9
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/replaced_if.html b/doc/html/range/reference/adaptors/reference/replaced_if.html new file mode 100644 index 0000000..b64a538 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/replaced_if.html @@ -0,0 +1,165 @@ + + + +replaced_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::replaced_if(pred, + new_value) +

+
+

+ Function +

+
+

+ boost::adaptors::replace_if(rng, + pred, + new_value) +

+
+
    +
  • +Precondition:
      +
    • + The range value_type + is convertible to the argument type of pred. +
    • +
    • +new_value is convertible + to the value_type + of the range. +
    • +
    +
  • +
  • +Postconditions: For all elements + x in the returned range, + the value x is equal + to the value of pred(y) ? new_value : + y where y + is the corresponding element in the original range. +
  • +
  • +Range Category:ForwardRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/replaced_if.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+struct is_even
+{
+    bool operator()(int x) const { return x % 2 == 0; }
+};
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+
+    boost::copy(
+        input | replaced_if(is_even(), 10),
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
1,10,3,10,5,10,7,10,9
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/reversed.html b/doc/html/range/reference/adaptors/reference/reversed.html new file mode 100644 index 0000000..3a9c619 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/reversed.html @@ -0,0 +1,139 @@ + + + +reversed + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::reversed +

+
+

+ Function +

+
+

+ boost::adaptors::reverse(rng) +

+
+
    +
  • +Returns: A range whose iterators behave + as if they were the original iterators wrapped in reverse_iterator. +
  • +
  • +Range Category:BidirectionalRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/reversed.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+void reversed_example_test()
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+
+    boost::copy(
+        input | reversed,
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
9,8,7,6,5,4,3,2,1
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/sliced.html b/doc/html/range/reference/adaptors/reference/sliced.html new file mode 100644 index 0000000..e4a1298 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/sliced.html @@ -0,0 +1,149 @@ + + + +sliced + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::sliced(n, + m) +

+
+

+ Function +

+
+

+ boost::adaptors::slice(rng, + n, + m) +

+
+
    +
  • +Precondition:0 + <= n + && n + <= m + && m + < distance(rng) +
  • +
  • +Returns:make_range(rng, n, m) +
  • +
  • +Range Category:RandomAccessRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/sliced.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9;
+
+    boost::copy(
+        input | sliced(2, 5),
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
3,4,5
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/strided.html b/doc/html/range/reference/adaptors/reference/strided.html new file mode 100644 index 0000000..793123c --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/strided.html @@ -0,0 +1,146 @@ + + + +strided + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::strided(n) +

+
+

+ Function +

+
+

+ boost::adaptors::stride(rng, + n) +

+
+
    +
  • +Precondition:0 + <= n + && n + < distance(rng) +
  • +
  • +Returns: A new range based on rng where traversal is performed + in steps of n. +
  • +
  • +Range Category:RandomAccessRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/strided.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9,10;
+
+    boost::copy(
+        input | strided(2),
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
1,3,5,7,9
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/tokenized.html b/doc/html/range/reference/adaptors/reference/tokenized.html new file mode 100644 index 0000000..a83f316 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/tokenized.html @@ -0,0 +1,142 @@ + + + +tokenized + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ +

+
rng | boost::adaptors::tokenized(regex)
+rng | boost::adaptors::tokenized(regex, i)
+rng | boost::adaptors::tokenized(regex, rndRng)
+rng | boost::adaptors::tokenized(regex, i, flags)
+rng | boost::adaptors::tokenized(regex, rndRng, flags)
+
+

+

+
+

+ Function +

+
+

+ +

+
boost::adaptors::tokenize(rng, regex)
+boost::adaptors::tokenize(rng, regex, i)
+boost::adaptors::tokenize(rng, regex, rndRng)
+boost::adaptors::tokenize(rng, regex, i, flags)
+boost::adaptors::tokenize(rng, regex, rndRng, flags)
+
+

+

+
+
    +
  • +Precondition:
      +
    • + Let T denote typename range_value<decltype(rng)>::type, + then regex has + the type basic_regex<T> or is implicitly convertible + to one of these types. +
    • +
    • +i has the type + int. +
    • +
    • + the value_type + of rndRng is int. +
    • +
    • +flags has the type + regex_constants::syntax_option_type. +
    • +
    +
  • +
  • +Returns: A range whose iterators behave + as if they were the original iterators wrapped in regex_token_iterator. + The first iterator in the range would be constructed by forwarding + all the arguments of tokenized() to the regex_token_iterator + constructor. +
  • +
  • +Throws: Whatever constructing and + copying equivalent regex_token_iterators + might throw. +
  • +
  • +Range Category:RandomAccessRange +
  • +
+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/transformed.html b/doc/html/range/reference/adaptors/reference/transformed.html new file mode 100644 index 0000000..7cad586 --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/transformed.html @@ -0,0 +1,156 @@ + + + +transformed + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::transformed(fun) +

+
+

+ Function +

+
+

+ boost::adaptors::transform(rng, + fun) +

+
+
    +
  • +Precondition: The value_type + of the range is convertible to the argument type of fun. +
  • +
  • +Postcondition: For all elements x in the returned range, x is the result of fun(y) + where y is the corresponding + element in the original range. +
  • +
  • +Throws: Whatever the copy-constructor + of fun might throw. +
  • +
  • +Range Category:SinglePassRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/transformed.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+struct double_int
+{
+    typedef int result_type;
+    int operator()(int x) const { return x * 2; }
+};
+
+int main(int argc, const char* argv[])
+{
+    using namespace boost::adaptors;
+    using namespace boost::assign;
+
+    std::vector<int> input;
+    input += 1,2,3,4,5,6,7,8,9,10;
+
+    boost::copy(
+        input | transformed(double_int()),
+        std::ostream_iterator<int>(std::cout, ","));
+
+    return 0;
+}
+
+

+

+
+

+ This would produce the output: +

+
2,4,6,8,10,12,14,16,18,20
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/adaptors/reference/uniqued.html b/doc/html/range/reference/adaptors/reference/uniqued.html new file mode 100644 index 0000000..6cd67eb --- /dev/null +++ b/doc/html/range/reference/adaptors/reference/uniqued.html @@ -0,0 +1,141 @@ + + + +uniqued + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +
++++ + + + + + + + + + + + + + + +
+

+ Syntax +

+
+

+ Code +

+
+

+ Pipe +

+
+

+ rng | + boost::adaptors::uniqued +

+
+

+ Function +

+
+

+ boost::adaptors::unique(rng) +

+
+
    +
  • +Precondition: The value_type + of the range is comparable with operator==(). +
  • +
  • +Postcondition: For all adjacent elements + [x,y] in the returned range, x==y is false. +
  • +
  • +Range Category:ForwardRange +
  • +
+
+ +

+ +

+
#include <boost/range/adaptor/uniqued.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign.hpp>
+#include <algorithm>
+#include <iostream>
+#include <vector>
+
+void uniqued_example_test()
+{
+    using namespace boost::assign;
+    using namespace boost::adaptors;
+
+    std::vector<int> input;
+    input += 1,1,2,2,2,3,4,5,6;
+
+    boost::copy(
+        input | uniqued,
+        std::ostream_iterator<int>(std::cout, ","));
+}
+
+

+

+
+

+ This would produce the output: +

+
1,2,3,4,5,6
+
+

+

+
+ + + +
+
+
+PrevUpHomeNext +
+ +