diff --git a/doc/counting_range.html b/doc/counting_range.html deleted file mode 100755 index c44edcc..0000000 --- a/doc/counting_range.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - Boost.Range Utilities - - - - - - - - - -

Boost.Range

-

Function counting_range

-

- The intention of the counting_range function is to construct - a new range with iterators that are wrapped in a - counting_iterator (from Boost.Iterator) -

- -

Synopsis

- -
namespace boost
-{
-    template< class Incrementable > inline
-    range< counting_iterator<Incrementable> >
-    counting_range(Incrementable first, Incrementable last);
-
-    template< class SinglePassRange > inline
-    range< counting_iterator<typename range_iterator<SinglePassRange>::type >
-    counting_range(const Range& rng);
-
-    template< class SinglePassRange > inline
-    range< counting_iterator<typename range_iterator<SinglePassRange>::type >
-    counting_range(Range& rng);
-            
-} // namespace 'boost'
-    
- -

- © Copyright Neil Groves 2009. -

- -

- Distributed under the Boost Software License, Version 1.0. (See - accompanying file LICENSE_1_0.txt or copy - at www.boost.org/LICENSE_1_0.txt) -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - - - diff --git a/doc/headers.qbk b/doc/headers.qbk index 6edefbd..9e29745 100644 --- a/doc/headers.qbk +++ b/doc/headers.qbk @@ -2,7 +2,7 @@ [table [[Header ] [Includes ] [Related Concept ]] - [[`` ] [everything ] [- ]] + [[`` ] [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. ] [- ]] [[`` ] [every metafunction ] [- ]] [[`` ] [every function ] [- ]] [[`` ] [__range_value__ ] [__single_pass_range__ ]] diff --git a/doc/html/index.html b/doc/html/index.html index f5bb91c..27ee9ba 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ Chapter 1. Range 2.0 - + @@ -30,7 +30,7 @@
-

+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

@@ -135,7 +135,7 @@

- +

Last revised: April 05, 2010 at 17:25:33 GMT

Last revised: April 11, 2010 at 21:49:16 GMT


diff --git a/doc/html/quickbook_HTML.manifest b/doc/html/quickbook_HTML.manifest index 67e69fa..df8f151 100644 --- a/doc/html/quickbook_HTML.manifest +++ b/doc/html/quickbook_HTML.manifest @@ -39,6 +39,7 @@ range/reference/algorithms/range_algorithm_mutating_algorithms.html range/reference/algorithms/range_algorithm_mutating_algorithms/copy.html range/reference/algorithms/range_algorithm_mutating_algorithms/copy_backward.html range/reference/algorithms/range_algorithm_mutating_algorithms/fill.html +range/reference/algorithms/range_algorithm_mutating_algorithms/fill_n.html range/reference/algorithms/range_algorithm_mutating_algorithms/generate.html range/reference/algorithms/range_algorithm_mutating_algorithms/inplace_merge.html range/reference/algorithms/range_algorithm_mutating_algorithms/merge.html @@ -84,6 +85,7 @@ range/reference/algorithms/heap_algorithms.html range/reference/algorithms/heap_algorithms/push_heap.html range/reference/algorithms/heap_algorithms/pop_heap.html range/reference/algorithms/heap_algorithms/make_heap.html +range/reference/algorithms/heap_algorithms/sort_heap.html range/reference/algorithms/permutation_algorithms.html range/reference/algorithms/permutation_algorithms/next_permutation.html range/reference/algorithms/permutation_algorithms/prev_permutation.html diff --git a/doc/html/range/concepts.html b/doc/html/range/concepts.html index c43b67c..c384122 100644 --- a/doc/html/range/concepts.html +++ b/doc/html/range/concepts.html @@ -3,7 +3,7 @@ Range Concepts - + diff --git a/doc/html/range/concepts/bidirectional_range.html b/doc/html/range/concepts/bidirectional_range.html index 0fc965b..e3ae956 100644 --- a/doc/html/range/concepts/bidirectional_range.html +++ b/doc/html/range/concepts/bidirectional_range.html @@ -3,7 +3,7 @@ Bidirectional Range - + @@ -27,7 +27,7 @@ Bidirectional Range
- + Notation
@@ -65,7 +65,7 @@
- + Description

@@ -75,7 +75,7 @@ Traversal Iterator.

- + Refinement of
@@ -83,7 +83,7 @@ Forward Range

- + Associated types
@@ -136,7 +136,7 @@
- + Valid expressions
@@ -221,7 +221,7 @@
- + Complexity guarantees
@@ -232,7 +232,7 @@ Forward Range.

- + Invariants
@@ -272,7 +272,7 @@
- + See also

diff --git a/doc/html/range/concepts/concept_checking.html b/doc/html/range/concepts/concept_checking.html index a4aa1d9..b5d5407 100644 --- a/doc/html/range/concepts/concept_checking.html +++ b/doc/html/range/concepts/concept_checking.html @@ -3,7 +3,7 @@ Concept Checking - + @@ -79,7 +79,7 @@

- + See also

diff --git a/doc/html/range/concepts/forward_range.html b/doc/html/range/concepts/forward_range.html index f82d8c5..919f6dd 100644 --- a/doc/html/range/concepts/forward_range.html +++ b/doc/html/range/concepts/forward_range.html @@ -3,7 +3,7 @@ Forward Range - + @@ -27,7 +27,7 @@ Forward Range

- + Notation
@@ -65,7 +65,7 @@
- + Description

@@ -73,14 +73,14 @@ Traversal Iterator.

- + Refinement of

Single Pass Range

- + Associated types
@@ -132,7 +132,7 @@
- + See also

diff --git a/doc/html/range/concepts/overview.html b/doc/html/range/concepts/overview.html index c2bb4d1..7cd19e8 100644 --- a/doc/html/range/concepts/overview.html +++ b/doc/html/range/concepts/overview.html @@ -3,7 +3,7 @@ Overview - + diff --git a/doc/html/range/concepts/random_access_range.html b/doc/html/range/concepts/random_access_range.html index cc5d88e..a695e97 100644 --- a/doc/html/range/concepts/random_access_range.html +++ b/doc/html/range/concepts/random_access_range.html @@ -3,7 +3,7 @@ Random Access Range - + @@ -27,7 +27,7 @@ Random Access Range

- + Description

@@ -35,7 +35,7 @@ Access Traversal Iterator.

- + Refinement of
@@ -43,7 +43,7 @@ Bidirectional Range

- + Valid expressions
@@ -89,7 +89,7 @@
- + Expression semantics
@@ -139,7 +139,7 @@
- + Complexity guarantees
@@ -147,7 +147,7 @@ boost::size(a) completes in amortized constant time.

- + Invariants
diff --git a/doc/html/range/concepts/single_pass_range.html b/doc/html/range/concepts/single_pass_range.html index 9cb3123..5588147 100644 --- a/doc/html/range/concepts/single_pass_range.html +++ b/doc/html/range/concepts/single_pass_range.html @@ -3,7 +3,7 @@ Single Pass Range - + @@ -27,7 +27,7 @@ Single Pass Range
- + Notation
@@ -65,7 +65,7 @@
- + Description

@@ -73,7 +73,7 @@ Pass Iterator.

- + Associated types
@@ -126,7 +126,7 @@
- + Valid expressions
@@ -198,7 +198,7 @@
- + Expression semantics
@@ -266,7 +266,7 @@
- + Complexity guarantees
@@ -276,7 +276,7 @@ constant time.

- + Invariants
@@ -316,7 +316,7 @@
- + See also

diff --git a/doc/html/range/examples.html b/doc/html/range/examples.html index f517040..b272df8 100644 --- a/doc/html/range/examples.html +++ b/doc/html/range/examples.html @@ -3,7 +3,7 @@ Examples - + diff --git a/doc/html/range/faq.html b/doc/html/range/faq.html index a5ea15d..0c9d40b 100644 --- a/doc/html/range/faq.html +++ b/doc/html/range/faq.html @@ -3,7 +3,7 @@ FAQ - + diff --git a/doc/html/range/history_ack.html b/doc/html/range/history_ack.html index 2401db3..930b6b6 100644 --- a/doc/html/range/history_ack.html +++ b/doc/html/range/history_ack.html @@ -3,7 +3,7 @@ History and Acknowledgement - + diff --git a/doc/html/range/introduction.html b/doc/html/range/introduction.html index e41a60c..7bedc97 100644 --- a/doc/html/range/introduction.html +++ b/doc/html/range/introduction.html @@ -3,7 +3,7 @@ Introduction - + diff --git a/doc/html/range/library_headers.html b/doc/html/range/library_headers.html index 8f28283..58ddcff 100644 --- a/doc/html/range/library_headers.html +++ b/doc/html/range/library_headers.html @@ -3,7 +3,7 @@ Library Headers - + @@ -58,7 +58,9 @@

- everything + 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.

diff --git a/doc/html/range/mfc_atl.html b/doc/html/range/mfc_atl.html index 338e860..63558aa 100644 --- a/doc/html/range/mfc_atl.html +++ b/doc/html/range/mfc_atl.html @@ -3,7 +3,7 @@ MFC/ATL (courtesy of Shunsuke Sogame) - + @@ -34,7 +34,7 @@
References
- + Introduction

@@ -100,7 +100,7 @@

- + Overview

diff --git a/doc/html/range/mfc_atl/atl_ranges.html b/doc/html/range/mfc_atl/atl_ranges.html index 766375d..65ee355 100644 --- a/doc/html/range/mfc_atl/atl_ranges.html +++ b/doc/html/range/mfc_atl/atl_ranges.html @@ -3,7 +3,7 @@ ATL Ranges - + diff --git a/doc/html/range/mfc_atl/const_ranges.html b/doc/html/range/mfc_atl/const_ranges.html index 222c6d8..2e047f6 100644 --- a/doc/html/range/mfc_atl/const_ranges.html +++ b/doc/html/range/mfc_atl/const_ranges.html @@ -3,7 +3,7 @@ const Ranges - + diff --git a/doc/html/range/mfc_atl/mfc_ranges.html b/doc/html/range/mfc_atl/mfc_ranges.html index 9e6d001..af0c6e9 100644 --- a/doc/html/range/mfc_atl/mfc_ranges.html +++ b/doc/html/range/mfc_atl/mfc_ranges.html @@ -3,7 +3,7 @@ MFC Ranges - + diff --git a/doc/html/range/mfc_atl/references.html b/doc/html/range/mfc_atl/references.html index 8afe82a..124a538 100644 --- a/doc/html/range/mfc_atl/references.html +++ b/doc/html/range/mfc_atl/references.html @@ -3,7 +3,7 @@ References - + diff --git a/doc/html/range/mfc_atl/requirements.html b/doc/html/range/mfc_atl/requirements.html index c49ac8c..131433f 100644 --- a/doc/html/range/mfc_atl/requirements.html +++ b/doc/html/range/mfc_atl/requirements.html @@ -3,7 +3,7 @@ Requirements - + diff --git a/doc/html/range/portability.html b/doc/html/range/portability.html index 63e3621..901e0b1 100644 --- a/doc/html/range/portability.html +++ b/doc/html/range/portability.html @@ -3,7 +3,7 @@ Portability - + diff --git a/doc/html/range/reference.html b/doc/html/range/reference.html index a76673a..70c17dc 100644 --- a/doc/html/range/reference.html +++ b/doc/html/range/reference.html @@ -3,7 +3,7 @@ Reference - + diff --git a/doc/html/range/reference/adaptors.html b/doc/html/range/reference/adaptors.html index bc68382..5ab0ecd 100644 --- a/doc/html/range/reference/adaptors.html +++ b/doc/html/range/reference/adaptors.html @@ -3,7 +3,7 @@ Range Adaptors - + diff --git a/doc/html/range/reference/adaptors/adaptors_general_requirements.html b/doc/html/range/reference/adaptors/adaptors_general_requirements.html index ce2b17b..a815bae 100644 --- a/doc/html/range/reference/adaptors/adaptors_general_requirements.html +++ b/doc/html/range/reference/adaptors/adaptors_general_requirements.html @@ -3,7 +3,7 @@ General Requirements - + diff --git a/doc/html/range/reference/adaptors/adaptors_introduction.html b/doc/html/range/reference/adaptors/adaptors_introduction.html index 3d61175..e1e4e26 100644 --- a/doc/html/range/reference/adaptors/adaptors_introduction.html +++ b/doc/html/range/reference/adaptors/adaptors_introduction.html @@ -3,7 +3,7 @@ Introduction and motivation - + @@ -122,7 +122,7 @@ situations, you will really appreciate the succinctness of operator|().

- + Composition of Adaptors
@@ -159,7 +159,7 @@ is the design solution to this problem.

- + Range Adaptor alternative to copy_if algorithm
@@ -176,7 +176,7 @@

- + Range Adaptor alternative to count_if algorithm
diff --git a/doc/html/range/reference/adaptors/adaptors_reference.html b/doc/html/range/reference/adaptors/adaptors_reference.html index 5a3dae6..d284888 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference.html +++ b/doc/html/range/reference/adaptors/adaptors_reference.html @@ -3,7 +3,7 @@ Reference - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/adjacent_filtered.html b/doc/html/range/reference/adaptors/adaptors_reference/adjacent_filtered.html index df72e28..fa763c8 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/adjacent_filtered.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/adjacent_filtered.html @@ -3,7 +3,7 @@ adjacent_filtered - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/copied.html b/doc/html/range/reference/adaptors/adaptors_reference/copied.html index b488800..650e29a 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/copied.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/copied.html @@ -3,7 +3,7 @@ copied - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/filtered.html b/doc/html/range/reference/adaptors/adaptors_reference/filtered.html index 04d418d..1551a9f 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/filtered.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/filtered.html @@ -3,7 +3,7 @@ filtered - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/indexed.html b/doc/html/range/reference/adaptors/adaptors_reference/indexed.html index 03ec01b..d8c8674 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/indexed.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/indexed.html @@ -3,7 +3,7 @@ indexed - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/indirected.html b/doc/html/range/reference/adaptors/adaptors_reference/indirected.html index 391abcc..adcd57a 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/indirected.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/indirected.html @@ -3,7 +3,7 @@ indirected - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/map_keys.html b/doc/html/range/reference/adaptors/adaptors_reference/map_keys.html index 7af39c9..95c1746 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/map_keys.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/map_keys.html @@ -3,7 +3,7 @@ map_keys - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/map_values.html b/doc/html/range/reference/adaptors/adaptors_reference/map_values.html index 810ba7a..553a8f3 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/map_values.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/map_values.html @@ -3,7 +3,7 @@ map_values - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/replaced.html b/doc/html/range/reference/adaptors/adaptors_reference/replaced.html index 6af8257..0990ede 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/replaced.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/replaced.html @@ -3,7 +3,7 @@ replaced - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/replaced_if.html b/doc/html/range/reference/adaptors/adaptors_reference/replaced_if.html index f916472..abcf00f 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/replaced_if.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/replaced_if.html @@ -3,7 +3,7 @@ replaced_if - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/reversed.html b/doc/html/range/reference/adaptors/adaptors_reference/reversed.html index 2ef6d5d..52f4cda 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/reversed.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/reversed.html @@ -3,7 +3,7 @@ reversed - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/sliced.html b/doc/html/range/reference/adaptors/adaptors_reference/sliced.html index 8901fa0..9793092 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/sliced.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/sliced.html @@ -3,7 +3,7 @@ sliced - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/strided.html b/doc/html/range/reference/adaptors/adaptors_reference/strided.html index ca37e60..6fcc281 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/strided.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/strided.html @@ -3,7 +3,7 @@ strided - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/tokenized.html b/doc/html/range/reference/adaptors/adaptors_reference/tokenized.html index 0b294b2..fc4bc42 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/tokenized.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/tokenized.html @@ -3,7 +3,7 @@ tokenized - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/transformed.html b/doc/html/range/reference/adaptors/adaptors_reference/transformed.html index 1947b6d..56a6170 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/transformed.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/transformed.html @@ -3,7 +3,7 @@ transformed - + diff --git a/doc/html/range/reference/adaptors/adaptors_reference/uniqued.html b/doc/html/range/reference/adaptors/adaptors_reference/uniqued.html index 1f7d9fb..3b314ab 100644 --- a/doc/html/range/reference/adaptors/adaptors_reference/uniqued.html +++ b/doc/html/range/reference/adaptors/adaptors_reference/uniqued.html @@ -3,7 +3,7 @@ uniqued - + diff --git a/doc/html/range/reference/adaptors/adaptors_synopsis.html b/doc/html/range/reference/adaptors/adaptors_synopsis.html index 202a114..d0fea59 100644 --- a/doc/html/range/reference/adaptors/adaptors_synopsis.html +++ b/doc/html/range/reference/adaptors/adaptors_synopsis.html @@ -3,7 +3,7 @@ Synopsis - + diff --git a/doc/html/range/reference/algorithms.html b/doc/html/range/reference/algorithms.html index 99e1dad..fc70d02 100644 --- a/doc/html/range/reference/algorithms.html +++ b/doc/html/range/reference/algorithms.html @@ -3,7 +3,7 @@ Range Algorithm - + diff --git a/doc/html/range/reference/algorithms/heap_algorithms.html b/doc/html/range/reference/algorithms/heap_algorithms.html index 2cdbaaa..018906e 100644 --- a/doc/html/range/reference/algorithms/heap_algorithms.html +++ b/doc/html/range/reference/algorithms/heap_algorithms.html @@ -3,7 +3,7 @@ Heap algorithms - + @@ -33,6 +33,8 @@ pop_heap
make_heap
+
+ sort_heap
diff --git a/doc/html/range/reference/algorithms/heap_algorithms/make_heap.html b/doc/html/range/reference/algorithms/heap_algorithms/make_heap.html index 083df4a..f261c6a 100644 --- a/doc/html/range/reference/algorithms/heap_algorithms/make_heap.html +++ b/doc/html/range/reference/algorithms/heap_algorithms/make_heap.html @@ -3,11 +3,11 @@ make_heap - + - +
@@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext
@@ -28,28 +28,28 @@ make_heap
- + Prototype

template<class RandomAccessRange>
-void make_heap(RandomAccessRange& rng);
+RandomAccessRange& make_heap(RandomAccessRange& rng);
 
 template<class RandomAccessRange>
-void make_heap(const RandomAccessRange& rng);
+const RandomAccessRange& make_heap(const RandomAccessRange& rng);
 
 template<class RandomAccessRange, class Compare>
-void make_heap(RandomAccessRange& rng, Compare pred);
+RandomAccessRange& make_heap(RandomAccessRange& rng, Compare pred);
 
 template<class RandomAccessRange, class Compare>
-void make_heap(const RandomAccessRange& rng, Compare pred);
+const RandomAccessRange& make_heap(const RandomAccessRange& rng, Compare pred);
 

- + Description

@@ -61,14 +61,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/heap_algorithm.hpp

- + Requirements

@@ -119,7 +119,7 @@

- + Complexity

@@ -138,7 +138,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/heap_algorithms/pop_heap.html b/doc/html/range/reference/algorithms/heap_algorithms/pop_heap.html index 2e45c55..3759ef1 100644 --- a/doc/html/range/reference/algorithms/heap_algorithms/pop_heap.html +++ b/doc/html/range/reference/algorithms/heap_algorithms/pop_heap.html @@ -3,7 +3,7 @@ pop_heap - + @@ -28,28 +28,28 @@ pop_heap
- + Prototype

template<class RandomAccessRange>
-void pop_heap(RandomAccessRange& rng);
+RandomAccessRange& pop_heap(RandomAccessRange& rng);
 
 template<class RandomAccessRange>
-void pop_heap(const RandomAccessRange& rng);
+const RandomAccessRange& pop_heap(const RandomAccessRange& rng);
 
 template<class RandomAccessRange, class Compare>
-void pop_heap(RandomAccessRange& rng, Compare pred);
+RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare pred);
 
 template<class RandomAccessRange, class Compare>
-void pop_heap(const RandomAccessRange& rng, Compare pred);
+const RandomAccessRange& pop_heap(const RandomAccessRange& rng, Compare pred);
 

- + Description

@@ -63,14 +63,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/heap_algorithm.hpp

- + Requirements

@@ -121,7 +121,7 @@

- + Precondition:
    @@ -131,7 +131,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/heap_algorithms/push_heap.html b/doc/html/range/reference/algorithms/heap_algorithms/push_heap.html index 9bcf219..9857d21 100644 --- a/doc/html/range/reference/algorithms/heap_algorithms/push_heap.html +++ b/doc/html/range/reference/algorithms/heap_algorithms/push_heap.html @@ -3,7 +3,7 @@ push_heap - + @@ -28,28 +28,28 @@ push_heap

- + Prototype

template<class RandomAccessRange>
-void push_heap(RandomAccessRange& rng);
+RandomAccessRange& push_heap(RandomAccessRange& rng);
 
 template<class RandomAccessRange>
-void push_heap(const RandomAccessRange& rng);
+const RandomAccessRange& push_heap(const RandomAccessRange& rng);
 
 template<class RandomAccessRange, class Compare>
-void push_heap(RandomAccessRange& rng, Compare pred);
+RandomAccessRange& push_heap(RandomAccessRange& rng, Compare pred);
 
 template<class RandomAccessRange, class Compare>
-void push_heap(const RandomAccessRange& rng, Compare pred);
+const RandomAccessRange& push_heap(const RandomAccessRange& rng, Compare pred);
 

- + Description

@@ -63,14 +63,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/heap_algorithm.hpp

- + Requirements

@@ -121,7 +121,7 @@

- + Precondition:
    @@ -131,7 +131,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/heap_algorithms/sort_heap.html b/doc/html/range/reference/algorithms/heap_algorithms/sort_heap.html new file mode 100644 index 0000000..c9c5746 --- /dev/null +++ b/doc/html/range/reference/algorithms/heap_algorithms/sort_heap.html @@ -0,0 +1,153 @@ + + + +sort_heap + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+


+
+PrevUpHomeNext +
+
+ +
+ + Prototype +
+

+ +

+
template<class RandomAccessRange>
+RandomAccessRange& sort_heap(RandomAccessRange& rng);
+
+template<class RandomAccessRange>
+const RandomAccessRange& sort_heap(const RandomAccessRange& rng);
+
+template<class RandomAccessRange, class Compare>
+RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare pred);
+
+template<class RandomAccessRange, class Compare>
+const RandomAccessRange& sort_heap(const RandomAccessRange& rng, Compare pred);
+
+

+

+
+ + Description +
+

+ sort_heap turns a heap + into a sorted range. +

+

+ The ordering relationship is determined by using operator< in the non-predicate versions, and + by evaluating pred in + the predicate versions. +

+
+ + Definition +
+

+ Defined in the header file boost/range/algorithm/heap_algorithm.hpp +

+
+ + Requirements +
+

+ For the non-predicate versions: +

+
    +
  • +RandomAccessRange is + a model of the Random + Access Range Concept. +
  • +
  • +RandomAccessRange is + mutable. +
  • +
  • +RandomAccessRange's + value type is a model of the LessThanComparableConcept. +
  • +
  • + The ordering of objects of type RandomAccessRange's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • +
+

+ For the predicate versions: +

+
    +
  • +RandomAccessRange is + a model of the Random + Access Range Concept. +
  • +
  • +RandomAccessRange is + mutable. +
  • +
  • +Compare is a model + of the StrictWeakOrderingConcept. +
  • +
  • +RandomAccessRange's + value type is convertible to both of Compare's + argument types. +
  • +
+
+ + Precondition: +
+

+ rng is a heap. +

+
+ + Complexity +
+

+ At most N * + log(N) + comparisons, where N + is distance(rng). +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/algorithms/permutation_algorithms.html b/doc/html/range/reference/algorithms/permutation_algorithms.html index a9e2392..16bd254 100644 --- a/doc/html/range/reference/algorithms/permutation_algorithms.html +++ b/doc/html/range/reference/algorithms/permutation_algorithms.html @@ -3,10 +3,10 @@ Permutation algorithms - + - + @@ -20,7 +20,7 @@
-PrevUpHomeNext +PrevUpHomeNext

@@ -44,7 +44,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/permutation_algorithms/next_permutation.html b/doc/html/range/reference/algorithms/permutation_algorithms/next_permutation.html index 0a212cf..8691969 100644 --- a/doc/html/range/reference/algorithms/permutation_algorithms/next_permutation.html +++ b/doc/html/range/reference/algorithms/permutation_algorithms/next_permutation.html @@ -3,7 +3,7 @@ next_permutation - + @@ -28,28 +28,28 @@ next_permutation

- + Prototype

template<class BidirectionalRange>
-void next_permutation(BidirectionalRange& rng);
+bool next_permutation(BidirectionalRange& rng);
 
 template<class BidirectionalRange>
-void next_permutation(const BidirectionalRange& rng);
+bool next_permutation(const BidirectionalRange& rng);
 
 template<class BidirectionalRange, class Compare>
-void next_permutation(BidirectionalRange& rng, Compare pred);
+bool next_permutation(BidirectionalRange& rng, Compare pred);
 
 template<class BidirectionalRange, class Compare>
-void next_permutation(const BidirectionalRange& rng, Compare pred);
+bool next_permutation(const BidirectionalRange& rng, Compare pred);
 

- + Description

@@ -67,14 +67,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/permutation.hpp

- + Requirements

@@ -125,7 +125,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/permutation_algorithms/prev_permutation.html b/doc/html/range/reference/algorithms/permutation_algorithms/prev_permutation.html index 06b9d1d..2521275 100644 --- a/doc/html/range/reference/algorithms/permutation_algorithms/prev_permutation.html +++ b/doc/html/range/reference/algorithms/permutation_algorithms/prev_permutation.html @@ -3,7 +3,7 @@ prev_permutation - + @@ -28,28 +28,28 @@ prev_permutation

- + Prototype

template<class BidirectionalRange>
-void prev_permutation(BidirectionalRange& rng);
+bool prev_permutation(BidirectionalRange& rng);
 
 template<class BidirectionalRange>
-void prev_permutation(const BidirectionalRange& rng);
+bool prev_permutation(const BidirectionalRange& rng);
 
 template<class BidirectionalRange, class Compare>
-void prev_permutation(BidirectionalRange& rng, Compare pred);
+bool prev_permutation(BidirectionalRange& rng, Compare pred);
 
 template<class BidirectionalRange, class Compare>
-void prev_permutation(const BidirectionalRange& rng, Compare pred);
+bool prev_permutation(const BidirectionalRange& rng, Compare pred);
 

- + Description

@@ -67,14 +67,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/permutation.hpp

- + Requirements

@@ -125,7 +125,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_introduction.html b/doc/html/range/reference/algorithms/range_algorithm_introduction.html index f0aa6c4..9f15ed5 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_introduction.html +++ b/doc/html/range/reference/algorithms/range_algorithm_introduction.html @@ -3,7 +3,7 @@ Introduction and motivation - + diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms.html index fcd52d1..a69db43 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms.html @@ -3,7 +3,7 @@ Mutating algorithms - + @@ -34,6 +34,8 @@ Range Algorithm - copy_backward

Range Algorithm - fill
+
+ Range Algorithm - fill_n
Range Algorithm - generate
diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy.html index e88c627..7050fd9 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy.html @@ -3,7 +3,7 @@ Range Algorithm - copy - + @@ -28,7 +28,7 @@ Range Algorithm - copy
- + Prototype

@@ -40,7 +40,7 @@

- + Description

@@ -51,14 +51,14 @@ distance(source_rng)

- + Definition

Defined in the header file boost/range/algorithm/copy.hpp

- + Requirements
    @@ -79,7 +79,7 @@
- + Precondition:
    @@ -93,7 +93,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy_backward.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy_backward.html index 14d13c6..5047d02 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy_backward.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/copy_backward.html @@ -3,7 +3,7 @@ Range Algorithm - copy_backward - + @@ -28,7 +28,7 @@ Range Algorithm - copy_backward

- + Prototype

@@ -42,7 +42,7 @@

- + Description

@@ -60,14 +60,14 @@ denotes the end of the output sequence.

- + Definition

Defined in the header file boost/range/algorithm/copy_backward.hpp

- + Requirements
    @@ -88,7 +88,7 @@
- + Precondition:
    @@ -102,7 +102,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/fill.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/fill.html index f28518c..30c1bc4 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/fill.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/fill.html @@ -3,11 +3,11 @@ Range Algorithm - fill - + - + @@ -20,7 +20,7 @@


-PrevUpHomeNext +PrevUpHomeNext
@@ -28,22 +28,19 @@ Range Algorithm - fill
- + Prototype

template<class ForwardRange, class Value>
-void fill( ForwardRange& rng, const Value& val );
-
-template<class ForwardRange, class Value>
-void fill( const ForwardRange& rng, const Value& val );
+ForwardRange& fill( ForwardRange& rng, const Value& val );
 

- + Description

@@ -52,14 +49,14 @@ in the range rng.

- + Definition

Defined in the header file boost/range/algorithm/fill.hpp

- + Requirements
    @@ -82,7 +79,7 @@
- + Complexity

@@ -99,7 +96,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/fill_n.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/fill_n.html new file mode 100644 index 0000000..a202dea --- /dev/null +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/fill_n.html @@ -0,0 +1,102 @@ + + + +Range Algorithm - fill_n + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Prototype +
+

+ +

+
template<class ForwardRange, class Size, class Value>
+ForwardRange& fill( ForwardRange& rng, Size n, const Value& val );
+
+

+

+
+ + Description +
+

+ fill_n assigns the value + val to n elements in the range rng begining with boost::begin(rng). +

+
+ + Definition +
+

+ Defined in the header file boost/range/algorithm/fill_n.hpp +

+
+ + Requirements +
+
    +
  • +ForwardRange is a model + of the Forward Range + Concept. +
  • +
  • +ForwardRange is mutable. +
  • +
  • +Value is a model of + the AssignableConcept. +
  • +
  • +Value is convertible + to ForwardRange's value + type. +
  • +
+
+ + Complexity +
+

+ Linear. Exactly n assignments + are performed. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/generate.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/generate.html index 68efa6a..a76b480 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/generate.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/generate.html @@ -3,10 +3,10 @@ Range Algorithm - generate - + - + @@ -20,7 +20,7 @@
-PrevUpHomeNext +PrevUpHomeNext
@@ -28,7 +28,7 @@ Range Algorithm - generate
- + Prototype

@@ -43,7 +43,7 @@

- + Description

@@ -53,14 +53,14 @@ Returns the resultant range.

- + Definition

Defined in the header file boost/range/algorithm/generate.hpp

- + Requirements
    @@ -84,7 +84,7 @@
- + Precondition:
    @@ -98,7 +98,7 @@
- + Complexity

@@ -115,7 +115,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/inplace_merge.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/inplace_merge.html index 46ef629..e0aa7fc 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/inplace_merge.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/inplace_merge.html @@ -3,7 +3,7 @@ Range Algorithm - inplace_merge - + @@ -28,7 +28,7 @@ Range Algorithm - inplace_merge
- + Prototype

@@ -59,7 +59,7 @@

- + Description

@@ -72,14 +72,14 @@ input range is preserved.

- + Definition

Defined in the header file boost/range/algorithm/inplace_merge.hpp

- + Requirements

@@ -116,11 +116,11 @@ argument types.

- + Precondition:
- + For the non-predicate version:
@@ -143,7 +143,7 @@
- + For the predicate version:
@@ -164,7 +164,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/merge.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/merge.html index 5747eef..e2b5d56 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/merge.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/merge.html @@ -3,7 +3,7 @@ Range Algorithm - merge - + @@ -28,7 +28,7 @@ Range Algorithm - merge

- + Prototype

@@ -57,7 +57,7 @@

- + Description

@@ -76,14 +76,14 @@ version uses the predicate instead of operator<().

- + Definition

Defined in the header file boost/range/algorithm/merge.hpp

- + Requirements

@@ -151,11 +151,11 @@

- + Precondition:
- + For the non-predicate version:
@@ -190,7 +190,7 @@
- + For the predicate version:
@@ -221,7 +221,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/nth_element.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/nth_element.html index 75f8d71..5b42602 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/nth_element.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/nth_element.html @@ -3,7 +3,7 @@ Range Algorithm - nth_element - + @@ -28,34 +28,38 @@ Range Algorithm - nth_element

- + Prototype

template<class RandomAccessRange>
-void nth_element(RandomAccessRange& rng,
-                 typename range_iterator<RandomAccessRange>::type nth);
-                 
+RandomAccessRange& nth_element(
+    RandomAccessRange& rng,
+    typename range_iterator<RandomAccessRange>::type nth);
+
 template<class RandomAccessRange>
-void nth_element(const RandomAccessRange& rng,
-                 typename range_iterator<const RandomAccessRange>::type nth);
-                 
+const RandomAccessRange& nth_element(
+    const RandomAccessRange& rng,
+    typename range_iterator<const RandomAccessRange>::type nth);
+
 template<class RandomAccessRange>
-void nth_element(RandomAccessRange& rng,
-                 typename range_iterator<RandomAccessRange>::type nth,
-                 BinaryPredicate sort_pred);
-                 
+RandomAccessRange& nth_element(
+    RandomAccessRange& rng,
+    typename range_iterator<RandomAccessRange>::type nth,
+    BinaryPredicate sort_pred);
+
 template<class RandomAccessRange>
-void nth_element(const RandomAccessRange& rng,
-                 typename range_iterator<const RandomAccessRange>::type nth,
-                 BinaryPredicate sort_pred);
+const RandomAccessRange& nth_element(
+    const RandomAccessRange& rng,
+    typename range_iterator<const RandomAccessRange>::type nth,
+    BinaryPredicate sort_pred);
 

- + Description

@@ -66,14 +70,14 @@ is the same as the element that would be in that position if rng has been sorted.

- + Definition

Defined in the header file boost/range/algorithm/nth_element.hpp

- + Requirements

@@ -124,7 +128,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partial_sort.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partial_sort.html index 1112ef2..a202f53 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partial_sort.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partial_sort.html @@ -3,7 +3,7 @@ Range Algorithm - partial_sort - + @@ -28,34 +28,38 @@ Range Algorithm - partial_sort

- + Prototype

template<class RandomAccessRange>
-void partial_sort(RandomAccessRange& rng,
-                  typename range_iterator<RandomAccessRange>::type middle);
-                 
+RandomAccessRange& partial_sort(
+    RandomAccessRange& rng,
+    typename range_iterator<RandomAccessRange>::type middle);
+
 template<class RandomAccessRange>
-void partial_sort(const RandomAccessRange& rng,
-                  typename range_iterator<const RandomAccessRange>::type middle);
-                 
+const RandomAccessRange& partial_sort(
+    const RandomAccessRange& rng,
+    typename range_iterator<const RandomAccessRange>::type middle);
+
 template<class RandomAccessRange>
-void partial_sort(RandomAccessRange& rng,
-                  typename range_iterator<RandomAccessRange>::type middle,
-                  BinaryPredicate sort_pred);
-                 
+RandomAccessRange& partial_sort(
+    RandomAccessRange& rng,
+    typename range_iterator<RandomAccessRange>::type middle,
+    BinaryPredicate sort_pred);
+
 template<class RandomAccessRange>
-void partial_sort(const RandomAccessRange& rng,
-                  typename range_iterator<const RandomAccessRange>::type middle,
-                  BinaryPredicate sort_pred);
+const RandomAccessRange& partial_sort(
+    const RandomAccessRange& rng,
+    typename range_iterator<const RandomAccessRange>::type middle,
+    BinaryPredicate sort_pred);
 

- + Description

@@ -71,14 +75,14 @@ predicate instead.

- + Definition

Defined in the header file boost/range/algorithm/partial_sort.hpp

- + Requirements

@@ -129,7 +133,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partition.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partition.html index 50b7b16..e2d73d7 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partition.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/partition.html @@ -3,7 +3,7 @@ Range Algorithm - partition - + @@ -28,7 +28,7 @@ Range Algorithm - partition

- + Prototype

@@ -67,7 +67,7 @@

- + Description

@@ -81,14 +81,14 @@ corresponds to the middle iterator.

- + Definition

Defined in the header file boost/range/algorithm/partition.hpp

- + Requirements
    @@ -108,7 +108,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/random_shuffle.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/random_shuffle.html index 023d799..64643c5 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/random_shuffle.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/random_shuffle.html @@ -3,7 +3,7 @@ Range Algorithm - random_shuffle - + @@ -28,7 +28,7 @@ Range Algorithm - random_shuffle

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -61,14 +61,14 @@ the shuffles range.

- + Definition

Defined in the header file boost/range/algorithm/random_shuffle.hpp

- + Requirements

@@ -99,7 +99,7 @@

- + Precondition:
  • @@ -108,7 +108,7 @@ maximum value.
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove.html index 65ab605..016b1aa 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove.html @@ -3,7 +3,7 @@ Range Algorithm - remove - + @@ -28,7 +28,7 @@ Range Algorithm - remove

- + Prototype

@@ -67,7 +67,7 @@

- + Description

@@ -84,14 +84,14 @@ are dereferenceable, but the elements are unspecified.

- + Definition

Defined in the header file boost/range/algorithm/remove.hpp

- + Requirements
    @@ -114,7 +114,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove_if.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove_if.html index 227aeb0..51cb94c 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove_if.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/remove_if.html @@ -3,7 +3,7 @@ Range Algorithm - remove_if - + @@ -28,7 +28,7 @@ Range Algorithm - remove_if

- + Prototype

@@ -67,7 +67,7 @@

- + Description

@@ -83,14 +83,14 @@ are unspecified.

- + Definition

Defined in the header file boost/range/algorithm/remove_if.hpp

- + Requirements
    @@ -113,7 +113,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace.html index e07aebb..dab9ee6 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace.html @@ -3,7 +3,7 @@ Range Algorithm - replace - + @@ -28,7 +28,7 @@ Range Algorithm - replace

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -58,14 +58,14 @@ Return a reference to rng.

- + Definition

Defined in the header file boost/range/algorithm/replace.hpp

- + Requirements
    @@ -94,7 +94,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace_if.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace_if.html index fcf01b9..946b18c 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace_if.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/replace_if.html @@ -3,7 +3,7 @@ Range Algorithm - replace_if - + @@ -28,7 +28,7 @@ Range Algorithm - replace_if

- + Prototype

@@ -43,7 +43,7 @@

- + Description

@@ -52,14 +52,14 @@ Returns a reference to rng.

- + Definition

Defined in the header file boost/range/algorithm/replace_if.hpp

- + Requirements
    @@ -91,7 +91,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/rotate.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/rotate.html index e4c574f..2660663 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/rotate.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/rotate.html @@ -3,7 +3,7 @@ Range Algorithm - rotate - + @@ -28,7 +28,7 @@ Range Algorithm - rotate

- + Prototype

@@ -45,7 +45,7 @@

- + Description

@@ -54,14 +54,14 @@ and [middle, end(rng)). Returns a reference to rng.

- + Definition

Defined in the header file boost/range/algorithm/rotate.hpp

- + Requirements
    @@ -75,7 +75,7 @@
- + Precondition:
    @@ -87,7 +87,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/sort.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/sort.html index 31adcdf..0fc2893 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/sort.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/sort.html @@ -3,7 +3,7 @@ Range Algorithm - sort - + @@ -28,7 +28,7 @@ Range Algorithm - sort

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -72,14 +72,14 @@ [x,y], pred(y, x) == false.

- + Definition

Defined in the header file boost/range/algorithm/sort.hpp

- + Requirements

@@ -130,7 +130,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_partition.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_partition.html index a549bc5..d4178a2 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_partition.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_partition.html @@ -3,7 +3,7 @@ Range Algorithm - stable_partition - + @@ -28,7 +28,7 @@ Range Algorithm - stable_partition

- + Prototype

@@ -61,7 +61,7 @@

- + Description

@@ -83,14 +83,14 @@ the iterator to the first element that fails to satisfy pred.

- + Definition

Defined in the header file boost/range/algorithm/stable_partition.hpp

- + Requirements
    @@ -108,7 +108,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_sort.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_sort.html index e02cfa3..d0e3ddf 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_sort.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/stable_sort.html @@ -3,7 +3,7 @@ Range Algorithm - stable_sort - + @@ -28,7 +28,7 @@ Range Algorithm - stable_sort

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -72,14 +72,14 @@ [x,y], pred(y,x) == false.

- + Definition

Defined in the header file boost/range/algorithm/stable_sort.hpp

- + Requirements

@@ -130,7 +130,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/transform.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/transform.html index 82c53ea..110d48d 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/transform.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/transform.html @@ -3,7 +3,7 @@ Range Algorithm - transform - + @@ -28,7 +28,7 @@ Range Algorithm - transform

- + Prototype

@@ -57,7 +57,7 @@

- + Description

@@ -93,14 +93,14 @@ The return value is out + min(distance(rng1), distance(rng2)).

- + Definition

Defined in the header file boost/range/algorithm/transform.hpp

- + Requirements

@@ -170,7 +170,7 @@

- + Precondition:

@@ -202,7 +202,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/unique.html b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/unique.html index 13f388f..ec4bf26 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/unique.html +++ b/doc/html/range/reference/algorithms/range_algorithm_mutating_algorithms/unique.html @@ -3,7 +3,7 @@ Range Algorithm - unique - + @@ -28,7 +28,7 @@ Range Algorithm - unique

- + Prototype

@@ -69,7 +69,7 @@

- + Description

@@ -87,14 +87,14 @@ type.

- + Definition

Defined in the header file boost/range/algorithm/unique.hpp

- + Requirements

@@ -138,7 +138,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms.html index 7976d61..5182eaf 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms.html @@ -3,7 +3,7 @@ New algorithms - + diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/erase.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/erase.html index e3d64a6..6d13233 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/erase.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/erase.html @@ -3,7 +3,7 @@ erase - + @@ -28,23 +28,21 @@ erase

- + Prototype

-
template<
-    class Container,
-    class SinglePassRange
-    >
-void erase(Container& target,
-           iterator_range<typename Container::iterator> to_erase);
+
template<class Container>
+Container& erase(
+    Container& target,
+    iterator_range<typename Container::iterator> to_erase);
 

- + Description

@@ -52,15 +50,23 @@ to_erase from the container target.

+

+ remove_erase performs + the frequently used combination equivalent to target.erase(std::remove(target.begin(), target.end(), value), target.end()); +

+

+ remove_erase_if performs + the frequently used combination equivalent to target.erase(std::remove_if(target.begin(), target.end(), pred), target.end()); +

- + Definition

Defined in the header file boost/range/algorithm_ext/erase.hpp

- + Requirements
  1. @@ -68,7 +74,7 @@ erase of an iterator range.
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/for_each.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/for_each.html index dfe62c3..2577357 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/for_each.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/for_each.html @@ -3,7 +3,7 @@ for_each - + @@ -28,7 +28,7 @@ for_each

- + Prototype

@@ -73,7 +73,7 @@

- + Description

@@ -89,14 +89,14 @@ It is safe to call this function with unequal length ranges.

- + Definition

Defined in the header file boost/range/algorithm_ext/for_each.hpp

- + Requirements
    @@ -126,7 +126,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/insert.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/insert.html index e0aa512..7321ce8 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/insert.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/insert.html @@ -3,7 +3,7 @@ insert - + @@ -28,7 +28,7 @@ insert

- + Prototype

@@ -38,14 +38,14 @@ class Container, class SinglePassRange > -void insert(Container& target, - typename Container::iterator before, - const SinglePassRange& from); +Container& insert(Container& target, + typename Container::iterator before, + const SinglePassRange& from);

- + Description

@@ -55,14 +55,14 @@ target.

- + Definition

Defined in the header file boost/range/algorithm_ext/insert.hpp

- + Requirements
    @@ -82,7 +82,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/iota.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/iota.html index c36f96d..ea0a6f4 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/iota.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/iota.html @@ -3,7 +3,7 @@ iota - + @@ -28,19 +28,19 @@ iota

- + Prototype

-
template<class SinglePassRange, class Value>
-iota(SinglePassRange& rng, Value x);
+
template<class ForwardRange, class Value>
+ForwardRange& iota(ForwardRange& rng, Value x);
 

- + Description

@@ -51,21 +51,21 @@ + boost::distance(boost::begin(rng), it)

- + Definition

Defined in the header file boost/range/algorithm_ext/iota.hpp

- + Requirements
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. +ForwardRange is a model + of the Forward Range + Concept.
  2. Value is a model of @@ -73,7 +73,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/overwrite.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/overwrite.html index 189151b..d0a5b5e 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/overwrite.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/overwrite.html @@ -3,7 +3,7 @@ overwrite - + @@ -28,7 +28,7 @@ overwrite

- + Prototype

@@ -44,7 +44,7 @@

- + Description

@@ -53,14 +53,14 @@ into the range to.

- + Definition

Defined in the header file boost/range/algorithm_ext/overwrite.hpp

- + Requirements
    @@ -87,7 +87,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_back.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_back.html index 1357275..8029406 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_back.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_back.html @@ -3,7 +3,7 @@ push_back - + @@ -28,7 +28,7 @@ push_back

- + Prototype

@@ -38,13 +38,13 @@ class Container, class SinglePassRange > -void push_back(Container& target, - const SinglePassRange& from); +Container& push_back(Container& target, + const SinglePassRange& from);

- + Description

@@ -53,14 +53,14 @@ to the back of the container target.

- + Definition

Defined in the header file boost/range/algorithm_ext/push_back.hpp

- + Requirements
    @@ -80,7 +80,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_front.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_front.html index d91db73..462cc72 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_front.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/push_front.html @@ -3,7 +3,7 @@ push_front - + @@ -28,7 +28,7 @@ push_front

- + Prototype

@@ -38,13 +38,13 @@ class Container, class SinglePassRange > -void push_front(Container& target, - const SinglePassRange& from); +Container& push_front(Container& target, + const SinglePassRange& from);

- + Description

@@ -53,14 +53,14 @@ to the front of the container target.

- + Definition

Defined in the header file boost/range/algorithm_ext/push_front.hpp

- + Requirements
    @@ -80,7 +80,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase.html index 5963cab..c268e1a 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase.html @@ -3,7 +3,7 @@ remove_erase - + @@ -28,40 +28,37 @@ remove_erase

- + Prototype

-
template<
-    class Container,
-    class T
-    >
-void remove_erase(Container& target,
-                  const T& val);
+
template<class Container, class Value>
+Container& remove_erase(Container& target,
+                        const Value& value);
 

- + Description

remove_erase actually - eliminates the elements equal to val + eliminates the elements equal to value from the container. This is in contrast to the remove algorithm which merely rearranges elements.

- + Definition

Defined in the header file boost/range/algorithm_ext/erase.hpp

- + Requirements
  1. @@ -69,7 +66,7 @@ erase of an iterator range.
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase_if.html b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase_if.html index 4469f02..0dd87cd 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase_if.html +++ b/doc/html/range/reference/algorithms/range_algorithm_new_algorithms/remove_erase_if.html @@ -3,7 +3,7 @@ remove_erase_if - + @@ -28,23 +28,20 @@ remove_erase_if

- + Prototype

-
template<
-    class Container,
-    class Pred
-    >
-void remove_erase(Container& target,
-                  Pred pred);
+
template<class Container, class Pred>
+Container& remove_erase_if(Container& target,
+                           Pred pred);
 

- + Description

@@ -55,14 +52,14 @@ algorithm which merely rearranges elements.

- + Definition

Defined in the header file boost/range/algorithm_ext/erase.hpp

- + Requirements
    @@ -76,7 +73,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms.html index 2e8a2d1..87820b8 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms.html @@ -3,7 +3,7 @@ Non-mutating algorithms - + diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/adjacent_find.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/adjacent_find.html index d14634a..f71cc25 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/adjacent_find.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/adjacent_find.html @@ -3,7 +3,7 @@ Range Algorithm - adjacent_find - + @@ -28,7 +28,7 @@ Range Algorithm - adjacent_find

- + Prototype

@@ -77,7 +77,7 @@

- + Description

@@ -98,14 +98,14 @@ is true.

- + Definition

Defined in the header file boost/range/algorithm/adjacent_find.hpp

- + Requirements

@@ -143,7 +143,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/binary_search.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/binary_search.html index e87ccbe..64a95a8 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/binary_search.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/binary_search.html @@ -3,7 +3,7 @@ binary_search - + @@ -28,7 +28,7 @@ binary_search

- + Prototype

@@ -43,7 +43,7 @@

- + Description

@@ -53,14 +53,14 @@ range rng.

- + Definition

Defined in the header file boost/range/algorithm/binary_search.hpp

- + Requirements

@@ -111,7 +111,7 @@

- + Precondition:

@@ -129,7 +129,7 @@ order according to the function object pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/count.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/count.html index 3e36aa5..73a26b8 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/count.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/count.html @@ -3,7 +3,7 @@ count - + @@ -28,7 +28,7 @@ count

- + Prototype

@@ -45,7 +45,7 @@

- + Description

@@ -55,14 +55,14 @@ is true.

- + Definition

Defined in the header file boost/range/algorithm/count.hpp

- + Requirements
    @@ -85,7 +85,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal.html index bb6187c..d581af7 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal.html @@ -3,7 +3,7 @@ equal - + @@ -28,7 +28,7 @@ equal

- + Prototype

@@ -53,7 +53,7 @@

- + Description

@@ -71,14 +71,14 @@ considered equal in the predicate version if pred(x,y) is true.

- + Definition

Defined in the header file boost/range/algorithm/equal.hpp

- + Requirements

@@ -139,7 +139,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal_range.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal_range.html index 8ba9948..88d3af6 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal_range.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/equal_range.html @@ -3,7 +3,7 @@ equal_range - + @@ -28,7 +28,7 @@ equal_range

- + Prototype

@@ -71,7 +71,7 @@

- + Description

@@ -85,14 +85,14 @@ is determined by pred.

- + Definition

Defined in the header file boost/range/algorithm/equal_range.hpp

- + Requirements

@@ -143,7 +143,7 @@

- + Precondition:

@@ -155,7 +155,7 @@ is ordered in ascending order according to pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find.html index 05db375..f9fff13 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find.html @@ -3,7 +3,7 @@ find - + @@ -28,7 +28,7 @@ find

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -60,14 +60,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/find.hpp

- + Requirements
    @@ -88,7 +88,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_end.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_end.html index b5ab6b0..f6a9b8b 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_end.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_end.html @@ -3,7 +3,7 @@ find_end - + @@ -28,7 +28,7 @@ find_end

- + Prototype

@@ -66,7 +66,7 @@

- + Description

@@ -81,14 +81,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/find_end.hpp

- + Requirements

@@ -148,7 +148,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_first_of.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_first_of.html index a8de6a4..cb3cc79 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_first_of.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_first_of.html @@ -3,7 +3,7 @@ find_first_of - + @@ -28,7 +28,7 @@ find_first_of

- + Prototype

@@ -66,7 +66,7 @@

- + Description

@@ -86,14 +86,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/find_first_of.hpp

- + Requirements

@@ -147,7 +147,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_if.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_if.html index 07df166..44cdde4 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_if.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/find_if.html @@ -3,7 +3,7 @@ find_if - + @@ -28,7 +28,7 @@ find_if

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -64,14 +64,14 @@ defines found in the same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/find_if.hpp

- + Requirements
    @@ -90,7 +90,7 @@
- + Precondition:

@@ -98,7 +98,7 @@ rng, *i is in the domain of UnaryPredicate.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/for_each.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/for_each.html index f90bdc6..0ea9130 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/for_each.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/for_each.html @@ -3,7 +3,7 @@ for_each - + @@ -28,7 +28,7 @@ for_each

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -59,14 +59,14 @@ fun(x).

- + Definition

Defined in the header file boost/range/algorithm/for_each.hpp

- + Requirements
    @@ -90,7 +90,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lexicographical_compare.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lexicographical_compare.html index d10629d..0978050 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lexicographical_compare.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lexicographical_compare.html @@ -3,7 +3,7 @@ lexicographical_compare - + @@ -28,7 +28,7 @@ lexicographical_compare

- + Prototype

@@ -53,7 +53,7 @@

- + Description

@@ -73,14 +73,14 @@ predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/lexicographical_compare.hpp

- + Requirements

@@ -145,7 +145,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lower_bound.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lower_bound.html index 3eaa4e3..3a5a05d 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lower_bound.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/lower_bound.html @@ -3,7 +3,7 @@ lower_bound - + @@ -28,7 +28,7 @@ lower_bound

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -72,14 +72,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/lower_bound.hpp

- + Requirements

@@ -130,7 +130,7 @@

- + Precondition:

@@ -148,7 +148,7 @@ order according to pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/max_element.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/max_element.html index 552d3af..0e042fd 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/max_element.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/max_element.html @@ -3,7 +3,7 @@ max_element - + @@ -28,7 +28,7 @@ max_element

- + Prototype

@@ -84,7 +84,7 @@

- + Description

@@ -98,14 +98,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/max_element.hpp

- + Requirements

@@ -142,7 +142,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/min_element.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/min_element.html index 675196b..4752df4 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/min_element.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/min_element.html @@ -3,7 +3,7 @@ min_element - + @@ -28,7 +28,7 @@ min_element

- + Prototype

@@ -84,7 +84,7 @@

- + Description

@@ -98,14 +98,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/min_element.hpp

- + Requirements

@@ -142,7 +142,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/mismatch.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/mismatch.html index 572dd69..3af4682 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/mismatch.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/mismatch.html @@ -3,7 +3,7 @@ mismatch - + @@ -28,7 +28,7 @@ mismatch

- + Prototype

@@ -106,7 +106,7 @@

- + Description

@@ -124,14 +124,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/mismatch.hpp

- + Requirements

@@ -192,14 +192,14 @@

- + Precondition:

distance(rng2) >= distance(rng1)

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/search.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/search.html index 03b528c..93994e9 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/search.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/search.html @@ -3,7 +3,7 @@ search - + @@ -28,7 +28,7 @@ search

- + Prototype

@@ -96,7 +96,7 @@

- + Description

@@ -115,14 +115,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/search.hpp

- + Requirements

@@ -183,7 +183,7 @@

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/upper_bound.html b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/upper_bound.html index e73149f..14f5248 100644 --- a/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/upper_bound.html +++ b/doc/html/range/reference/algorithms/range_algorithm_non_mutating_algorithms/upper_bound.html @@ -3,7 +3,7 @@ upper_bound - + @@ -28,7 +28,7 @@ upper_bound

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -71,14 +71,14 @@ same manner as the returned iterator described above.

- + Definition

Defined in the header file boost/range/algorithm/upper_bound.hpp

- + Requirements

@@ -129,7 +129,7 @@

- + Precondition:

@@ -147,7 +147,7 @@ order according to pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_numeric.html b/doc/html/range/reference/algorithms/range_numeric.html index 9da4d83..c6c6767 100644 --- a/doc/html/range/reference/algorithms/range_numeric.html +++ b/doc/html/range/reference/algorithms/range_numeric.html @@ -3,7 +3,7 @@ Numeric algorithms - + diff --git a/doc/html/range/reference/algorithms/range_numeric/accumulate.html b/doc/html/range/reference/algorithms/range_numeric/accumulate.html index 9351f90..26970d8 100644 --- a/doc/html/range/reference/algorithms/range_numeric/accumulate.html +++ b/doc/html/range/reference/algorithms/range_numeric/accumulate.html @@ -3,7 +3,7 @@ accumulate - + @@ -28,7 +28,7 @@ accumulate

- + Prototype

@@ -53,7 +53,7 @@

- + Description

@@ -64,18 +64,18 @@ The return value is the resultant value of the above algorithm.

- + Definition

Defined in the header file boost/range/numeric.hpp

- + Requirements
- + For the first version
@@ -100,7 +100,7 @@
- + For the second version
@@ -134,7 +134,7 @@
- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_numeric/adjacent_difference.html b/doc/html/range/reference/algorithms/range_numeric/adjacent_difference.html index 6680e82..9358698 100644 --- a/doc/html/range/reference/algorithms/range_numeric/adjacent_difference.html +++ b/doc/html/range/reference/algorithms/range_numeric/adjacent_difference.html @@ -3,7 +3,7 @@ adjacent_difference - + @@ -28,7 +28,7 @@ adjacent_difference

- + Prototype

@@ -55,7 +55,7 @@

- + Description

@@ -69,18 +69,18 @@ instead of operator-().

- + Definition

Defined in the header file boost/range/numeric.hpp

- + Requirements
- + For the first version
@@ -111,7 +111,7 @@
- + For the second version
@@ -146,7 +146,7 @@
- + Precondition:

@@ -154,7 +154,7 @@ + distance(rng)) is a valid range.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_numeric/inner_product.html b/doc/html/range/reference/algorithms/range_numeric/inner_product.html index d2591e2..a040134 100644 --- a/doc/html/range/reference/algorithms/range_numeric/inner_product.html +++ b/doc/html/range/reference/algorithms/range_numeric/inner_product.html @@ -3,7 +3,7 @@ inner_product - + @@ -28,7 +28,7 @@ inner_product

- + Prototype

@@ -54,7 +54,7 @@

- + Description

@@ -67,18 +67,18 @@ algorithm please see inner_product.

- + Definition

Defined in the header file boost/range/numeric.hpp

- + Requirements
- + For the first version
@@ -113,7 +113,7 @@
- + For the second version
@@ -162,14 +162,14 @@
- + Precondition:

distance(rng2) >= distance(rng1) is a valid range.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/range_numeric/partial_sum.html b/doc/html/range/reference/algorithms/range_numeric/partial_sum.html index b1aa0bf..e1ce532 100644 --- a/doc/html/range/reference/algorithms/range_numeric/partial_sum.html +++ b/doc/html/range/reference/algorithms/range_numeric/partial_sum.html @@ -3,7 +3,7 @@ partial_sum - + @@ -28,7 +28,7 @@ partial_sum

- + Prototype

@@ -49,7 +49,7 @@

- + Description

@@ -58,18 +58,18 @@ in the same manner as std::partial_sum(boost::begin(rng), boost::end(rng), out_it). See partial_sum.

- + Definition

Defined in the header file boost/range/numeric.hpp

- + Requirements
- + For the first version
@@ -99,7 +99,7 @@
- + For the second version
@@ -128,7 +128,7 @@
- + Precondition:

@@ -136,7 +136,7 @@ + distance(rng)) is a valid range.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/set_algorithms.html b/doc/html/range/reference/algorithms/set_algorithms.html index 447b470..b9888f5 100644 --- a/doc/html/range/reference/algorithms/set_algorithms.html +++ b/doc/html/range/reference/algorithms/set_algorithms.html @@ -3,7 +3,7 @@ Set algorithms - + diff --git a/doc/html/range/reference/algorithms/set_algorithms/includes.html b/doc/html/range/reference/algorithms/set_algorithms/includes.html index b8fabe5..0c538d9 100644 --- a/doc/html/range/reference/algorithms/set_algorithms/includes.html +++ b/doc/html/range/reference/algorithms/set_algorithms/includes.html @@ -3,7 +3,7 @@ includes - + @@ -28,7 +28,7 @@ includes

- + Prototype

@@ -48,7 +48,7 @@

- + Description

@@ -60,14 +60,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/set_algorithm.hpp

- + Requirements

@@ -145,7 +145,7 @@

- + Precondition:

@@ -163,7 +163,7 @@ according to pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/set_algorithms/set_difference.html b/doc/html/range/reference/algorithms/set_algorithms/set_difference.html index 95531ed..e02ebe2 100644 --- a/doc/html/range/reference/algorithms/set_algorithms/set_difference.html +++ b/doc/html/range/reference/algorithms/set_algorithms/set_difference.html @@ -3,7 +3,7 @@ set_difference - + @@ -28,7 +28,7 @@ set_difference

- + Prototype

@@ -57,7 +57,7 @@

- + Description

@@ -71,14 +71,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/set_algorithm.hpp

- + Requirements

@@ -164,7 +164,7 @@

- + Precondition:

@@ -182,7 +182,7 @@ according to pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/set_algorithms/set_intersection.html b/doc/html/range/reference/algorithms/set_algorithms/set_intersection.html index 7367d86..ce4af10 100644 --- a/doc/html/range/reference/algorithms/set_algorithms/set_intersection.html +++ b/doc/html/range/reference/algorithms/set_algorithms/set_intersection.html @@ -3,7 +3,7 @@ set_intersection - + @@ -28,7 +28,7 @@ set_intersection

- + Prototype

@@ -57,7 +57,7 @@

- + Description

@@ -71,14 +71,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/set_algorithm.hpp

- + Requirements

@@ -164,7 +164,7 @@

- + Precondition:

@@ -182,7 +182,7 @@ according to pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/set_algorithms/set_symmetric_difference.html b/doc/html/range/reference/algorithms/set_algorithms/set_symmetric_difference.html index 52b58b7..c33f771 100644 --- a/doc/html/range/reference/algorithms/set_algorithms/set_symmetric_difference.html +++ b/doc/html/range/reference/algorithms/set_algorithms/set_symmetric_difference.html @@ -3,7 +3,7 @@ set_symmetric_difference - + @@ -28,7 +28,7 @@ set_symmetric_difference

- + Prototype

@@ -59,7 +59,7 @@

- + Description

@@ -75,14 +75,14 @@ the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/set_algorithm.hpp

- + Requirements

@@ -168,7 +168,7 @@

- + Precondition:

@@ -186,7 +186,7 @@ according to pred.

- + Complexity

diff --git a/doc/html/range/reference/algorithms/set_algorithms/set_union.html b/doc/html/range/reference/algorithms/set_algorithms/set_union.html index 3a8abe3..93ec40f 100644 --- a/doc/html/range/reference/algorithms/set_algorithms/set_union.html +++ b/doc/html/range/reference/algorithms/set_algorithms/set_union.html @@ -3,7 +3,7 @@ set_union - + @@ -28,7 +28,7 @@ set_union

- + Prototype

@@ -57,7 +57,7 @@

- + Description

@@ -70,14 +70,14 @@ in the predicate versions.

- + Definition

Defined in the header file boost/range/algorithm/set_algorithm.hpp

- + Requirements

@@ -163,7 +163,7 @@

- + Precondition:

@@ -181,7 +181,7 @@ according to pred.

- + Complexity

diff --git a/doc/html/range/reference/extending.html b/doc/html/range/reference/extending.html index 37f4882..fc32e83 100644 --- a/doc/html/range/reference/extending.html +++ b/doc/html/range/reference/extending.html @@ -3,7 +3,7 @@ Extending the library - + diff --git a/doc/html/range/reference/extending/method_1.html b/doc/html/range/reference/extending/method_1.html index d9f66a7..632687b 100644 --- a/doc/html/range/reference/extending/method_1.html +++ b/doc/html/range/reference/extending/method_1.html @@ -3,7 +3,7 @@ Method 1: provide member functions and nested types - + diff --git a/doc/html/range/reference/extending/method_2.html b/doc/html/range/reference/extending/method_2.html index eae4cbd..f4f3524 100644 --- a/doc/html/range/reference/extending/method_2.html +++ b/doc/html/range/reference/extending/method_2.html @@ -3,7 +3,7 @@ Method 2: provide free-standing functions and specialize metafunctions - + diff --git a/doc/html/range/reference/extending/method_3.html b/doc/html/range/reference/extending/method_3.html index 3594ff8..f841237 100644 --- a/doc/html/range/reference/extending/method_3.html +++ b/doc/html/range/reference/extending/method_3.html @@ -3,7 +3,7 @@ Method 3: provide range adaptor implementations - + diff --git a/doc/html/range/reference/extending/method_3/method_3_1.html b/doc/html/range/reference/extending/method_3/method_3_1.html index 9370d65..e995bee 100644 --- a/doc/html/range/reference/extending/method_3/method_3_1.html +++ b/doc/html/range/reference/extending/method_3/method_3_1.html @@ -3,7 +3,7 @@ Method 3.1: Implement a Range Adaptor without arguments - + diff --git a/doc/html/range/reference/extending/method_3/method_3_2.html b/doc/html/range/reference/extending/method_3/method_3_2.html index f153d0e..f0bae90 100644 --- a/doc/html/range/reference/extending/method_3/method_3_2.html +++ b/doc/html/range/reference/extending/method_3/method_3_2.html @@ -3,7 +3,7 @@ Method 3.2: Implement a Range Adaptor with arguments - + diff --git a/doc/html/range/reference/overview.html b/doc/html/range/reference/overview.html index 8db874f..ae0bbf0 100644 --- a/doc/html/range/reference/overview.html +++ b/doc/html/range/reference/overview.html @@ -3,7 +3,7 @@ Overview - + diff --git a/doc/html/range/reference/ranges.html b/doc/html/range/reference/ranges.html index 6e4ad0a..2e16372 100644 --- a/doc/html/range/reference/ranges.html +++ b/doc/html/range/reference/ranges.html @@ -3,7 +3,7 @@ Provided Ranges - + diff --git a/doc/html/range/reference/ranges/counting_range.html b/doc/html/range/reference/ranges/counting_range.html index e2ccb2c..7bc2c80 100644 --- a/doc/html/range/reference/ranges/counting_range.html +++ b/doc/html/range/reference/ranges/counting_range.html @@ -3,7 +3,7 @@ counting_range - + @@ -27,7 +27,7 @@ counting_range

- + Prototype

@@ -48,7 +48,7 @@

- + Description

@@ -58,14 +58,14 @@ (from Boost.Iterator).

- + Definition

Defined in header file boost/range/counting_range.hpp

- + Requirements
  1. diff --git a/doc/html/range/reference/ranges/irange.html b/doc/html/range/reference/ranges/irange.html index cd481f0..fc88a82 100644 --- a/doc/html/range/reference/ranges/irange.html +++ b/doc/html/range/reference/ranges/irange.html @@ -3,7 +3,7 @@ irange - + @@ -27,7 +27,7 @@ irange
- + Prototype

@@ -44,7 +44,7 @@

- + Description

@@ -58,14 +58,14 @@ parameters denoted a half-open range.

- + Definition

Defined in the header file boost/range/irange.hpp

- + Requirements
    @@ -79,7 +79,7 @@
- + Complexity

diff --git a/doc/html/range/reference/ranges/istream_range.html b/doc/html/range/reference/ranges/istream_range.html index 063204d..db454bc 100644 --- a/doc/html/range/reference/ranges/istream_range.html +++ b/doc/html/range/reference/ranges/istream_range.html @@ -3,7 +3,7 @@ istream_range - + @@ -27,7 +27,7 @@ istream_range

- + Prototype

@@ -40,7 +40,7 @@

- + Description

@@ -49,7 +49,7 @@ wrapping a std::istream_iterator.

- + Definition

diff --git a/doc/html/range/reference/semantics.html b/doc/html/range/reference/semantics.html index 4fa0645..5ab20fe 100644 --- a/doc/html/range/reference/semantics.html +++ b/doc/html/range/reference/semantics.html @@ -3,7 +3,7 @@ Semantics - + @@ -31,7 +31,7 @@

Functions
- + notation
diff --git a/doc/html/range/reference/semantics/functions.html b/doc/html/range/reference/semantics/functions.html index 16bb7fb..232b680 100644 --- a/doc/html/range/reference/semantics/functions.html +++ b/doc/html/range/reference/semantics/functions.html @@ -3,7 +3,7 @@ Functions - + diff --git a/doc/html/range/reference/semantics/metafunctions.html b/doc/html/range/reference/semantics/metafunctions.html index cc2f4bd..6df4902 100644 --- a/doc/html/range/reference/semantics/metafunctions.html +++ b/doc/html/range/reference/semantics/metafunctions.html @@ -3,7 +3,7 @@ Metafunctions - + diff --git a/doc/html/range/reference/synopsis.html b/doc/html/range/reference/synopsis.html index c950490..248e8c1 100644 --- a/doc/html/range/reference/synopsis.html +++ b/doc/html/range/reference/synopsis.html @@ -3,7 +3,7 @@ Synopsis - + diff --git a/doc/html/range/style_guide.html b/doc/html/range/style_guide.html index 48043c4..b3e147a 100644 --- a/doc/html/range/style_guide.html +++ b/doc/html/range/style_guide.html @@ -3,7 +3,7 @@ Terminology and style guidelines - + diff --git a/doc/html/range/upgrade.html b/doc/html/range/upgrade.html index 27ddd2b..ad53c37 100644 --- a/doc/html/range/upgrade.html +++ b/doc/html/range/upgrade.html @@ -3,7 +3,7 @@ Upgrade version of Boost.Range - + diff --git a/doc/html/range/upgrade/upgrade_from_1_34.html b/doc/html/range/upgrade/upgrade_from_1_34.html index 587555c..dfc4c52 100644 --- a/doc/html/range/upgrade/upgrade_from_1_34.html +++ b/doc/html/range/upgrade/upgrade_from_1_34.html @@ -3,7 +3,7 @@ Upgrade from version 1.34 - + diff --git a/doc/html/range/upgrade/upgrade_from_1_42.html b/doc/html/range/upgrade/upgrade_from_1_42.html index 74059e4..3fbc2d2 100644 --- a/doc/html/range/upgrade/upgrade_from_1_42.html +++ b/doc/html/range/upgrade/upgrade_from_1_42.html @@ -3,7 +3,7 @@ Upgrade from version 1.42 - + diff --git a/doc/html/range/utilities.html b/doc/html/range/utilities.html index 0ccd47c..6c16a00 100644 --- a/doc/html/range/utilities.html +++ b/doc/html/range/utilities.html @@ -3,7 +3,7 @@ Utilities - + diff --git a/doc/html/range/utilities/iterator_range.html b/doc/html/range/utilities/iterator_range.html index 7956363..0902337 100644 --- a/doc/html/range/utilities/iterator_range.html +++ b/doc/html/range/utilities/iterator_range.html @@ -3,7 +3,7 @@ Class iterator_range - + @@ -47,7 +47,7 @@ limitation is simply propogated from the underlying iterator type.

- + Synopsis

@@ -187,7 +187,7 @@ iterators from the same container.

- + Details member functions
@@ -218,7 +218,7 @@

- + Details functions
diff --git a/doc/html/range/utilities/join.html b/doc/html/range/utilities/join.html index d430946..e73c51e 100644 --- a/doc/html/range/utilities/join.html +++ b/doc/html/range/utilities/join.html @@ -3,7 +3,7 @@ Function join - + @@ -39,7 +39,7 @@ if the end of a range has been reached internally during traversal.

- + Synposis

@@ -65,7 +65,7 @@

- + Example

diff --git a/doc/html/range/utilities/sub_range.html b/doc/html/range/utilities/sub_range.html index 517639f..e30fba7 100644 --- a/doc/html/range/utilities/sub_range.html +++ b/doc/html/range/utilities/sub_range.html @@ -3,7 +3,7 @@ Class sub_range - + @@ -35,7 +35,7 @@ is.

- + Synopsis

diff --git a/doc/reference/algorithm/fill.qbk b/doc/reference/algorithm/fill.qbk index e8419ab..9e16492 100644 --- a/doc/reference/algorithm/fill.qbk +++ b/doc/reference/algorithm/fill.qbk @@ -4,10 +4,7 @@ `` template -void fill( ForwardRange& rng, const Value& val ); - -template -void fill( const ForwardRange& rng, const Value& val ); +ForwardRange& fill( ForwardRange& rng, const Value& val ); `` [heading Description] diff --git a/doc/reference/algorithm/fill_n.qbk b/doc/reference/algorithm/fill_n.qbk new file mode 100644 index 0000000..a17695c --- /dev/null +++ b/doc/reference/algorithm/fill_n.qbk @@ -0,0 +1,31 @@ +[section:fill_n Range Algorithm - fill_n] + +[heading Prototype] + +`` +template +ForwardRange& fill( ForwardRange& rng, Size n, const Value& val ); +`` + +[heading Description] + +`fill_n` assigns the value `val` to `n` elements in the range `rng` begining with `boost::begin(rng)`. + +[heading Definition] + +Defined in the header file `boost/range/algorithm/fill_n.hpp` + +[heading Requirements] + +* `ForwardRange` is a model of the __forward_range__ Concept. +* `ForwardRange` is mutable. +* `Value` is a model of the `AssignableConcept`. +* `Value` is convertible to `ForwardRange`'s value type. + +[heading Complexity] + +Linear. Exactly `n` assignments are performed. + +[endsect] + + diff --git a/doc/reference/algorithm/make_heap.qbk b/doc/reference/algorithm/make_heap.qbk index 6f54a15..13238fc 100644 --- a/doc/reference/algorithm/make_heap.qbk +++ b/doc/reference/algorithm/make_heap.qbk @@ -4,16 +4,16 @@ `` template -void make_heap(RandomAccessRange& rng); +RandomAccessRange& make_heap(RandomAccessRange& rng); template -void make_heap(const RandomAccessRange& rng); +const RandomAccessRange& make_heap(const RandomAccessRange& rng); template -void make_heap(RandomAccessRange& rng, Compare pred); +RandomAccessRange& make_heap(RandomAccessRange& rng, Compare pred); template -void make_heap(const RandomAccessRange& rng, Compare pred); +const RandomAccessRange& make_heap(const RandomAccessRange& rng, Compare pred); `` [heading Description] @@ -21,7 +21,7 @@ void make_heap(const RandomAccessRange& rng, Compare pred); `make_heap` turns `rng` into a heap. The ordering relationship is determined by using `operator<` in the non-predicate versions, and by evaluating `pred` in the predicate versions. - + [heading Definition] Defined in the header file `boost/range/algorithm/heap_algorithm.hpp` diff --git a/doc/reference/algorithm/next_permutation.qbk b/doc/reference/algorithm/next_permutation.qbk index 37b901a..3da1383 100644 --- a/doc/reference/algorithm/next_permutation.qbk +++ b/doc/reference/algorithm/next_permutation.qbk @@ -4,16 +4,16 @@ `` template -void next_permutation(BidirectionalRange& rng); +bool next_permutation(BidirectionalRange& rng); template -void next_permutation(const BidirectionalRange& rng); +bool next_permutation(const BidirectionalRange& rng); template -void next_permutation(BidirectionalRange& rng, Compare pred); +bool next_permutation(BidirectionalRange& rng, Compare pred); template -void next_permutation(const BidirectionalRange& rng, Compare pred); +bool next_permutation(const BidirectionalRange& rng, Compare pred); `` [heading Description] @@ -21,7 +21,7 @@ void next_permutation(const BidirectionalRange& rng, Compare pred); `next_permutation` transforms the range of elements `rng` into the lexicographically next greater permutation of the elements if such a permutation exists. If one does not exist then the range is transformed into the lexicographically smallest permutation and `false` is returned. `true` is returned when the next greater permutation is successfully generated. The ordering relationship is determined by using `operator<` in the non-predicate versions, and by evaluating `pred` in the predicate versions. - + [heading Definition] Defined in the header file `boost/range/algorithm/permutation.hpp` diff --git a/doc/reference/algorithm/nth_element.qbk b/doc/reference/algorithm/nth_element.qbk index 69c87a8..9b888b6 100644 --- a/doc/reference/algorithm/nth_element.qbk +++ b/doc/reference/algorithm/nth_element.qbk @@ -4,22 +4,26 @@ `` template -void nth_element(RandomAccessRange& rng, - typename range_iterator::type nth); - +RandomAccessRange& nth_element( + RandomAccessRange& rng, + typename range_iterator::type nth); + template -void nth_element(const RandomAccessRange& rng, - typename range_iterator::type nth); - +const RandomAccessRange& nth_element( + const RandomAccessRange& rng, + typename range_iterator::type nth); + template -void nth_element(RandomAccessRange& rng, - typename range_iterator::type nth, - BinaryPredicate sort_pred); - +RandomAccessRange& nth_element( + RandomAccessRange& rng, + typename range_iterator::type nth, + BinaryPredicate sort_pred); + template -void nth_element(const RandomAccessRange& rng, - typename range_iterator::type nth, - BinaryPredicate sort_pred); +const RandomAccessRange& nth_element( + const RandomAccessRange& rng, + typename range_iterator::type nth, + BinaryPredicate sort_pred); `` [heading Description] diff --git a/doc/reference/algorithm/partial_sort.qbk b/doc/reference/algorithm/partial_sort.qbk index 298c16f..794415a 100644 --- a/doc/reference/algorithm/partial_sort.qbk +++ b/doc/reference/algorithm/partial_sort.qbk @@ -4,22 +4,26 @@ `` template -void partial_sort(RandomAccessRange& rng, - typename range_iterator::type middle); - +RandomAccessRange& partial_sort( + RandomAccessRange& rng, + typename range_iterator::type middle); + template -void partial_sort(const RandomAccessRange& rng, - typename range_iterator::type middle); - +const RandomAccessRange& partial_sort( + const RandomAccessRange& rng, + typename range_iterator::type middle); + template -void partial_sort(RandomAccessRange& rng, - typename range_iterator::type middle, - BinaryPredicate sort_pred); - +RandomAccessRange& partial_sort( + RandomAccessRange& rng, + typename range_iterator::type middle, + BinaryPredicate sort_pred); + template -void partial_sort(const RandomAccessRange& rng, - typename range_iterator::type middle, - BinaryPredicate sort_pred); +const RandomAccessRange& partial_sort( + const RandomAccessRange& rng, + typename range_iterator::type middle, + BinaryPredicate sort_pred); `` [heading Description] diff --git a/doc/reference/algorithm/pop_heap.qbk b/doc/reference/algorithm/pop_heap.qbk index 4479d46..8b3d900 100644 --- a/doc/reference/algorithm/pop_heap.qbk +++ b/doc/reference/algorithm/pop_heap.qbk @@ -4,16 +4,16 @@ `` template -void pop_heap(RandomAccessRange& rng); +RandomAccessRange& pop_heap(RandomAccessRange& rng); template -void pop_heap(const RandomAccessRange& rng); +const RandomAccessRange& pop_heap(const RandomAccessRange& rng); template -void pop_heap(RandomAccessRange& rng, Compare pred); +RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare pred); template -void pop_heap(const RandomAccessRange& rng, Compare pred); +const RandomAccessRange& pop_heap(const RandomAccessRange& rng, Compare pred); `` [heading Description] @@ -21,7 +21,7 @@ void pop_heap(const RandomAccessRange& rng, Compare pred); `pop_heap` removes the largest element from the heap. It is assumed that `begin(rng), prior(end(rng))` is already a heap and that the element to be added is `*prior(end(rng))`. The ordering relationship is determined by using `operator<` in the non-predicate versions, and by evaluating `pred` in the predicate versions. - + [heading Definition] Defined in the header file `boost/range/algorithm/heap_algorithm.hpp` diff --git a/doc/reference/algorithm/prev_permutation.qbk b/doc/reference/algorithm/prev_permutation.qbk index 11642a4..d40eb6a 100644 --- a/doc/reference/algorithm/prev_permutation.qbk +++ b/doc/reference/algorithm/prev_permutation.qbk @@ -4,16 +4,16 @@ `` template -void prev_permutation(BidirectionalRange& rng); +bool prev_permutation(BidirectionalRange& rng); template -void prev_permutation(const BidirectionalRange& rng); +bool prev_permutation(const BidirectionalRange& rng); template -void prev_permutation(BidirectionalRange& rng, Compare pred); +bool prev_permutation(BidirectionalRange& rng, Compare pred); template -void prev_permutation(const BidirectionalRange& rng, Compare pred); +bool prev_permutation(const BidirectionalRange& rng, Compare pred); `` [heading Description] @@ -21,7 +21,7 @@ void prev_permutation(const BidirectionalRange& rng, Compare pred); `prev_permutation` transforms the range of elements `rng` into the lexicographically next smaller permutation of the elements if such a permutation exists. If one does not exist then the range is transformed into the lexicographically largest permutation and `false` is returned. `true` is returned when the next smaller permutation is successfully generated. The ordering relationship is determined by using `operator<` in the non-predicate versions, and by evaluating `pred` in the predicate versions. - + [heading Definition] Defined in the header file `boost/range/algorithm/permutation.hpp` diff --git a/doc/reference/algorithm/push_heap.qbk b/doc/reference/algorithm/push_heap.qbk index eae2466..ddc7df2 100644 --- a/doc/reference/algorithm/push_heap.qbk +++ b/doc/reference/algorithm/push_heap.qbk @@ -4,16 +4,16 @@ `` template -void push_heap(RandomAccessRange& rng); +RandomAccessRange& push_heap(RandomAccessRange& rng); template -void push_heap(const RandomAccessRange& rng); +const RandomAccessRange& push_heap(const RandomAccessRange& rng); template -void push_heap(RandomAccessRange& rng, Compare pred); +RandomAccessRange& push_heap(RandomAccessRange& rng, Compare pred); template -void push_heap(const RandomAccessRange& rng, Compare pred); +const RandomAccessRange& push_heap(const RandomAccessRange& rng, Compare pred); `` [heading Description] @@ -21,7 +21,7 @@ void push_heap(const RandomAccessRange& rng, Compare pred); `push_heap` adds an element to a heap. It is assumed that `begin(rng)`, `prior(end(rng))` is already a heap and that the element to be added is `*prior(end(rng))`. The ordering relationship is determined by using `operator<` in the non-predicate versions, and by evaluating `pred` in the predicate versions. - + [heading Definition] Defined in the header file `boost/range/algorithm/heap_algorithm.hpp` diff --git a/doc/reference/algorithm/sort_heap.qbk b/doc/reference/algorithm/sort_heap.qbk index 9a24887..13e4133 100644 --- a/doc/reference/algorithm/sort_heap.qbk +++ b/doc/reference/algorithm/sort_heap.qbk @@ -4,16 +4,16 @@ `` template -void sort_heap(RandomAccessRange& rng); +RandomAccessRange& sort_heap(RandomAccessRange& rng); template -void sort_heap(const RandomAccessRange& rng); +const RandomAccessRange& sort_heap(const RandomAccessRange& rng); template -void sort_heap(RandomAccessRange& rng, Compare pred); +RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare pred); template -void sort_heap(const RandomAccessRange& rng, Compare pred); +const RandomAccessRange& sort_heap(const RandomAccessRange& rng, Compare pred); `` [heading Description] @@ -21,7 +21,7 @@ void sort_heap(const RandomAccessRange& rng, Compare pred); `sort_heap` turns a heap into a sorted range. The ordering relationship is determined by using `operator<` in the non-predicate versions, and by evaluating `pred` in the predicate versions. - + [heading Definition] Defined in the header file `boost/range/algorithm/heap_algorithm.hpp` diff --git a/doc/reference/algorithm_ext/erase.qbk b/doc/reference/algorithm_ext/erase.qbk index 64c48a8..5e8c746 100644 --- a/doc/reference/algorithm_ext/erase.qbk +++ b/doc/reference/algorithm_ext/erase.qbk @@ -3,18 +3,20 @@ [heading Prototype] `` -template< - class Container, - class SinglePassRange - > -void erase(Container& target, - iterator_range to_erase); +template +Container& erase( + Container& target, + iterator_range to_erase); `` [heading Description] `erase` the iterator range `to_erase` from the container `target`. +`remove_erase` performs the frequently used combination equivalent to `target.erase(std::remove(target.begin(), target.end(), value), target.end());` + +`remove_erase_if` performs the frequently used combination equivalent to `target.erase(std::remove_if(target.begin(), target.end(), pred), target.end());` + [heading Definition] Defined in the header file `boost/range/algorithm_ext/erase.hpp` diff --git a/doc/reference/algorithm_ext/insert.qbk b/doc/reference/algorithm_ext/insert.qbk index 1d9c567..4d5dc39 100644 --- a/doc/reference/algorithm_ext/insert.qbk +++ b/doc/reference/algorithm_ext/insert.qbk @@ -7,9 +7,9 @@ template< class Container, class SinglePassRange > -void insert(Container& target, - typename Container::iterator before, - const SinglePassRange& from); +Container& insert(Container& target, + typename Container::iterator before, + const SinglePassRange& from); `` [heading Description] diff --git a/doc/reference/algorithm_ext/iota.qbk b/doc/reference/algorithm_ext/iota.qbk index c098708..36cd7ab 100644 --- a/doc/reference/algorithm_ext/iota.qbk +++ b/doc/reference/algorithm_ext/iota.qbk @@ -3,8 +3,8 @@ [heading Prototype] `` -template -iota(SinglePassRange& rng, Value x); +template +ForwardRange& iota(ForwardRange& rng, Value x); `` [heading Description] @@ -18,7 +18,7 @@ Defined in the header file `boost/range/algorithm_ext/iota.hpp` [heading Requirements] -# `SinglePassRange` is a model of the __single_pass_range__ Concept. +# `ForwardRange` is a model of the __forward_range__ Concept. # `Value` is a model of the `Incrementable` Concept. [heading Complexity] diff --git a/doc/reference/algorithm_ext/push_back.qbk b/doc/reference/algorithm_ext/push_back.qbk index f3c8952..101fd30 100644 --- a/doc/reference/algorithm_ext/push_back.qbk +++ b/doc/reference/algorithm_ext/push_back.qbk @@ -7,8 +7,8 @@ template< class Container, class SinglePassRange > -void push_back(Container& target, - const SinglePassRange& from); +Container& push_back(Container& target, + const SinglePassRange& from); `` [heading Description] diff --git a/doc/reference/algorithm_ext/push_front.qbk b/doc/reference/algorithm_ext/push_front.qbk index d827105..edb540c 100644 --- a/doc/reference/algorithm_ext/push_front.qbk +++ b/doc/reference/algorithm_ext/push_front.qbk @@ -7,8 +7,8 @@ template< class Container, class SinglePassRange > -void push_front(Container& target, - const SinglePassRange& from); +Container& push_front(Container& target, + const SinglePassRange& from); `` [heading Description] diff --git a/doc/reference/algorithm_ext/remove_erase.qbk b/doc/reference/algorithm_ext/remove_erase.qbk index 0164768..25fb564 100644 --- a/doc/reference/algorithm_ext/remove_erase.qbk +++ b/doc/reference/algorithm_ext/remove_erase.qbk @@ -3,17 +3,14 @@ [heading Prototype] `` -template< - class Container, - class T - > -void remove_erase(Container& target, - const T& val); +template +Container& remove_erase(Container& target, + const Value& value); `` [heading Description] -`remove_erase` actually eliminates the elements equal to `val` from the container. This +`remove_erase` actually eliminates the elements equal to `value` from the container. This is in contrast to the `remove` algorithm which merely rearranges elements. [heading Definition] diff --git a/doc/reference/algorithm_ext/remove_erase_if.qbk b/doc/reference/algorithm_ext/remove_erase_if.qbk index f0ae749..0b8648e 100644 --- a/doc/reference/algorithm_ext/remove_erase_if.qbk +++ b/doc/reference/algorithm_ext/remove_erase_if.qbk @@ -3,12 +3,9 @@ [heading Prototype] `` -template< - class Container, - class Pred - > -void remove_erase(Container& target, - Pred pred); +template +Container& remove_erase_if(Container& target, + Pred pred); `` [heading Description] diff --git a/doc/reference/algorithms.qbk b/doc/reference/algorithms.qbk index 00b3edb..dca35d4 100644 --- a/doc/reference/algorithms.qbk +++ b/doc/reference/algorithms.qbk @@ -82,6 +82,7 @@ and there is no need to worry about generating an invalid range. Furthermore, if [include algorithm/copy.qbk] [include algorithm/copy_backward.qbk] [include algorithm/fill.qbk] +[include algorithm/fill_n.qbk] [include algorithm/generate.qbk] [include algorithm/inplace_merge.qbk] [include algorithm/merge.qbk] @@ -133,6 +134,7 @@ and there is no need to worry about generating an invalid range. Furthermore, if [include algorithm/push_heap.qbk] [include algorithm/pop_heap.qbk] [include algorithm/make_heap.qbk] +[include algorithm/sort_heap.qbk] [endsect] [section:permutation_algorithms Permutation algorithms] diff --git a/include/boost/range/adaptor/adjacent_filtered.hpp b/include/boost/range/adaptor/adjacent_filtered.hpp index 5f66711..c01f1c1 100644 --- a/include/boost/range/adaptor/adjacent_filtered.hpp +++ b/include/boost/range/adaptor/adjacent_filtered.hpp @@ -28,11 +28,11 @@ namespace boost { - namespace range_detail - { - template< class Iter, class Pred, bool default_pass > - class skip_iterator - : public boost::iterator_adaptor< + namespace range_detail + { + template< class Iter, class Pred, bool default_pass > + class skip_iterator + : public boost::iterator_adaptor< skip_iterator, Iter, BOOST_DEDUCED_TYPENAME std::iterator_traits::value_type, @@ -40,10 +40,10 @@ namespace boost BOOST_DEDUCED_TYPENAME std::iterator_traits::reference, BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type > - , private Pred - { - private: - typedef boost::iterator_adaptor< + , private Pred + { + private: + typedef boost::iterator_adaptor< skip_iterator, Iter, BOOST_DEDUCED_TYPENAME std::iterator_traits::value_type, @@ -52,9 +52,9 @@ namespace boost BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type > base_t; - public: + public: typedef Pred pred_t; - typedef Iter iter_t; + typedef Iter iter_t; skip_iterator() : m_last() {} @@ -66,169 +66,169 @@ namespace boost move_to_next_valid(); } - template - skip_iterator( const skip_iterator& other ) - : base_t(other.base()) - , pred_t(other) - , m_last(other.m_last) {} + template + skip_iterator( const skip_iterator& other ) + : base_t(other.base()) + , pred_t(other) + , m_last(other.m_last) {} void move_to_next_valid() - { - iter_t& it = this->base_reference(); - pred_t& bi_pred = *this; - if (it != m_last) - { - if (default_pass) - { - iter_t nxt = ::boost::next(it); - while (nxt != m_last && !bi_pred(*it, *nxt)) - { - ++it; - ++nxt; - } - } - else - { - iter_t nxt = ::boost::next(it); - for(; nxt != m_last; ++it, ++nxt) - { - if (bi_pred(*it, *nxt)) - { - break; - } - } - if (nxt == m_last) - { - it = m_last; - } - } - } - } + { + iter_t& it = this->base_reference(); + pred_t& bi_pred = *this; + if (it != m_last) + { + if (default_pass) + { + iter_t nxt = ::boost::next(it); + while (nxt != m_last && !bi_pred(*it, *nxt)) + { + ++it; + ++nxt; + } + } + else + { + iter_t nxt = ::boost::next(it); + for(; nxt != m_last; ++it, ++nxt) + { + if (bi_pred(*it, *nxt)) + { + break; + } + } + if (nxt == m_last) + { + it = m_last; + } + } + } + } - void increment() - { - iter_t& it = this->base_reference(); - BOOST_ASSERT( it != m_last ); - ++it; - move_to_next_valid(); - } + void increment() + { + iter_t& it = this->base_reference(); + BOOST_ASSERT( it != m_last ); + ++it; + move_to_next_valid(); + } iter_t m_last; - }; + }; - template< class P, class R, bool default_pass > - struct adjacent_filter_range - : iterator_range< skip_iterator< - BOOST_DEDUCED_TYPENAME range_iterator::type, - P, - default_pass + template< class P, class R, bool default_pass > + struct adjacent_filter_range + : iterator_range< skip_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + P, + default_pass > > - { - private: - typedef skip_iterator< + { + private: + typedef skip_iterator< BOOST_DEDUCED_TYPENAME range_iterator::type, P, default_pass > - skip_iter; + skip_iter; - typedef iterator_range - base_range; + typedef iterator_range + base_range; - typedef BOOST_DEDUCED_TYPENAME range_iterator::type raw_iterator; + typedef BOOST_DEDUCED_TYPENAME range_iterator::type raw_iterator; - public: - adjacent_filter_range( const P& p, R& r ) - : base_range( skip_iter( boost::begin(r), boost::end(r), p), - skip_iter( boost::end(r), boost::end(r), p) ) - { - } - }; + public: + adjacent_filter_range( const P& p, R& r ) + : base_range( skip_iter( boost::begin(r), boost::end(r), p), + skip_iter( boost::end(r), boost::end(r), p) ) + { + } + }; - template< class T > - struct adjacent_holder : holder - { - adjacent_holder( T r ) : holder(r) - { } - }; + template< class T > + struct adjacent_holder : holder + { + adjacent_holder( T r ) : holder(r) + { } + }; - template< class T > - struct adjacent_excl_holder : holder - { - adjacent_excl_holder( T r ) : holder(r) - { } - }; + template< class T > + struct adjacent_excl_holder : holder + { + adjacent_excl_holder( T r ) : holder(r) + { } + }; - template< class ForwardRng, class BinPredicate > - inline adjacent_filter_range - operator|( ForwardRng& r, - const adjacent_holder& f ) - { - return adjacent_filter_range( f.val, r ); - } + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( ForwardRng& r, + const adjacent_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } - template< class ForwardRng, class BinPredicate > - inline adjacent_filter_range - operator|( const ForwardRng& r, - const adjacent_holder& f ) - { - return adjacent_filter_range( f.val, r ); - } + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( const ForwardRng& r, + const adjacent_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } - template< class ForwardRng, class BinPredicate > - inline adjacent_filter_range - operator|( ForwardRng& r, - const adjacent_excl_holder& f ) - { - return adjacent_filter_range( f.val, r ); - } + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( ForwardRng& r, + const adjacent_excl_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } - template< class ForwardRng, class BinPredicate > - inline adjacent_filter_range - operator|( const ForwardRng& r, - const adjacent_excl_holder& f ) - { - return adjacent_filter_range( f.val, r ); - } + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( const ForwardRng& r, + const adjacent_excl_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } - } // 'range_detail' + } // 'range_detail' - // Bring adjacent_filter_range into the boost namespace so that users of - // this library may specify the return type of the '|' operator and - // adjacent_filter() - using range_detail::adjacent_filter_range; + // Bring adjacent_filter_range into the boost namespace so that users of + // this library may specify the return type of the '|' operator and + // adjacent_filter() + using range_detail::adjacent_filter_range; - namespace adaptors - { - namespace - { - const range_detail::forwarder + namespace adaptors + { + namespace + { + const range_detail::forwarder adjacent_filtered = range_detail::forwarder(); - const range_detail::forwarder - adjacent_filtered_excl = - range_detail::forwarder(); - } + const range_detail::forwarder + adjacent_filtered_excl = + range_detail::forwarder(); + } - template - inline adjacent_filter_range - adjacent_filter(ForwardRng& rng, BinPredicate filter_pred) - { - return adjacent_filter_range(filter_pred, rng); - } + template + inline adjacent_filter_range + adjacent_filter(ForwardRng& rng, BinPredicate filter_pred) + { + return adjacent_filter_range(filter_pred, rng); + } - template - inline adjacent_filter_range - adjacent_filter(const ForwardRng& rng, BinPredicate filter_pred) - { - return adjacent_filter_range(filter_pred, rng); - } + template + inline adjacent_filter_range + adjacent_filter(const ForwardRng& rng, BinPredicate filter_pred) + { + return adjacent_filter_range(filter_pred, rng); + } - } // 'adaptors' + } // 'adaptors' } diff --git a/include/boost/range/adaptor/argument_fwd.hpp b/include/boost/range/adaptor/argument_fwd.hpp index 357056b..fbfd40c 100755 --- a/include/boost/range/adaptor/argument_fwd.hpp +++ b/include/boost/range/adaptor/argument_fwd.hpp @@ -20,57 +20,57 @@ namespace boost { - namespace range_detail - { - template< class T > - struct holder - { - T val; - holder( T t ) : val(t) - { } - }; + namespace range_detail + { + template< class T > + struct holder + { + T val; + holder( T t ) : val(t) + { } + }; - template< class T > - struct holder2 - { - T val1, val2; - holder2( T t, T u ) : val1(t), val2(u) - { } - }; - - template< template class Holder > - struct forwarder - { - template< class T > - Holder operator()( T t ) const - { - return Holder(t); - } - }; + template< class T > + struct holder2 + { + T val1, val2; + holder2( T t, T u ) : val1(t), val2(u) + { } + }; + + template< template class Holder > + struct forwarder + { + template< class T > + Holder operator()( T t ) const + { + return Holder(t); + } + }; - template< template class Holder > - struct forwarder2 - { - template< class T > - Holder operator()( T t, T u ) const - { - return Holder(t,u); - } - }; + template< template class Holder > + struct forwarder2 + { + template< class T > + Holder operator()( T t, T u ) const + { + return Holder(t,u); + } + }; - template< template class Holder > - struct forwarder2TU - { - template< class T, class U > - Holder operator()( T t, U u ) const - { - return Holder(t, u); - } - }; + template< template class Holder > + struct forwarder2TU + { + template< class T, class U > + Holder operator()( T t, U u ) const + { + return Holder(t, u); + } + }; - } - + } + } #ifdef BOOST_MSVC diff --git a/include/boost/range/adaptor/copied.hpp b/include/boost/range/adaptor/copied.hpp index 1862b5f..f4cf2d1 100755 --- a/include/boost/range/adaptor/copied.hpp +++ b/include/boost/range/adaptor/copied.hpp @@ -18,40 +18,40 @@ namespace boost { - namespace adaptors - { - struct copied - { - copied(std::size_t t_, std::size_t u_) + namespace adaptors + { + struct copied + { + copied(std::size_t t_, std::size_t u_) : t(t_), u(u_) {} std::size_t t; std::size_t u; - }; + }; - template< class CopyableRandomAccessRng > - inline CopyableRandomAccessRng - operator|( const CopyableRandomAccessRng& r, const copied& f ) - { - iterator_range< - BOOST_DEDUCED_TYPENAME range_iterator::type > - temp( adaptors::slice( r, f.t, f.u ) ); - return CopyableRandomAccessRng( temp.begin(), temp.end() ); - } + template< class CopyableRandomAccessRng > + inline CopyableRandomAccessRng + operator|( const CopyableRandomAccessRng& r, const copied& f ) + { + iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > + temp( adaptors::slice( r, f.t, f.u ) ); + return CopyableRandomAccessRng( temp.begin(), temp.end() ); + } - template - inline CopyableRandomAccessRange - copy(const CopyableRandomAccessRange& rng, std::size_t t, std::size_t u) - { - iterator_range< - BOOST_DEDUCED_TYPENAME range_iterator::type> temp( - adaptors::slice(rng, t, u)); + template + inline CopyableRandomAccessRange + copy(const CopyableRandomAccessRange& rng, std::size_t t, std::size_t u) + { + iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type> temp( + adaptors::slice(rng, t, u)); return CopyableRandomAccessRange( temp.begin(), temp.end() ); - } - } // 'adaptors' + } + } // 'adaptors' } diff --git a/include/boost/range/adaptor/filtered.hpp b/include/boost/range/adaptor/filtered.hpp index 1bc4799..62888e7 100755 --- a/include/boost/range/adaptor/filtered.hpp +++ b/include/boost/range/adaptor/filtered.hpp @@ -17,84 +17,84 @@ namespace boost { - namespace range_detail - { - template< class P, class R > - struct filter_range : + namespace range_detail + { + template< class P, class R > + struct filter_range : boost::iterator_range< boost::filter_iterator< P, - BOOST_DEDUCED_TYPENAME range_iterator::type + BOOST_DEDUCED_TYPENAME range_iterator::type > > - { - private: - typedef boost::iterator_range< + { + private: + typedef boost::iterator_range< boost::filter_iterator< P, BOOST_DEDUCED_TYPENAME range_iterator::type > > base; - public: - filter_range( P p, R& r ) - : base( make_filter_iterator( p, boost::begin(r), boost::end(r) ), - make_filter_iterator( p, boost::end(r), boost::end(r) ) ) - { } - }; + public: + filter_range( P p, R& r ) + : base( make_filter_iterator( p, boost::begin(r), boost::end(r) ), + make_filter_iterator( p, boost::end(r), boost::end(r) ) ) + { } + }; - template< class T > - struct filter_holder : holder - { - filter_holder( T r ) : holder(r) - { } - }; + template< class T > + struct filter_holder : holder + { + filter_holder( T r ) : holder(r) + { } + }; - template< class InputRng, class Predicate > - inline filter_range - operator|( InputRng& r, - const filter_holder& f ) - { - return filter_range( f.val, r ); - } - - template< class InputRng, class Predicate > - inline filter_range - operator|( const InputRng& r, - const filter_holder& f ) - { - return filter_range( f.val, r ); - } - - } // 'range_detail' - - // Unusual use of 'using' is intended to bring filter_range into the boost namespace - // while leaving the mechanics of the '|' operator in range_detail and maintain - // argument dependent lookup. - // filter_range logically needs to be in the boost namespace to allow user of - // the library to define the return type for filter() - using range_detail::filter_range; - - namespace adaptors - { - namespace - { - const range_detail::forwarder - filtered = - range_detail::forwarder(); - } - - template - inline filter_range - filter(InputRange& rng, Predicate filter_pred) - { - return range_detail::filter_range( filter_pred, rng ); - } - - template - inline filter_range - filter(const InputRange& rng, Predicate filter_pred) - { - return range_detail::filter_range( filter_pred, rng ); + template< class InputRng, class Predicate > + inline filter_range + operator|( InputRng& r, + const filter_holder& f ) + { + return filter_range( f.val, r ); } - } // 'adaptors' + + template< class InputRng, class Predicate > + inline filter_range + operator|( const InputRng& r, + const filter_holder& f ) + { + return filter_range( f.val, r ); + } + + } // 'range_detail' + + // Unusual use of 'using' is intended to bring filter_range into the boost namespace + // while leaving the mechanics of the '|' operator in range_detail and maintain + // argument dependent lookup. + // filter_range logically needs to be in the boost namespace to allow user of + // the library to define the return type for filter() + using range_detail::filter_range; + + namespace adaptors + { + namespace + { + const range_detail::forwarder + filtered = + range_detail::forwarder(); + } + + template + inline filter_range + filter(InputRange& rng, Predicate filter_pred) + { + return range_detail::filter_range( filter_pred, rng ); + } + + template + inline filter_range + filter(const InputRange& rng, Predicate filter_pred) + { + return range_detail::filter_range( filter_pred, rng ); + } + } // 'adaptors' } diff --git a/include/boost/range/adaptor/indexed.hpp b/include/boost/range/adaptor/indexed.hpp index 7050185..5a523ce 100755 --- a/include/boost/range/adaptor/indexed.hpp +++ b/include/boost/range/adaptor/indexed.hpp @@ -40,56 +40,56 @@ namespace boost }; } - namespace range_detail - { - template< class Iter > - class indexed_iterator - : public boost::iterator_adaptor< indexed_iterator, Iter > - { - private: - typedef boost::iterator_adaptor< indexed_iterator, Iter > - base; + namespace range_detail + { + template< class Iter > + class indexed_iterator + : public boost::iterator_adaptor< indexed_iterator, Iter > + { + private: + typedef boost::iterator_adaptor< indexed_iterator, Iter > + base; - typedef BOOST_DEDUCED_TYPENAME base::difference_type index_type; + typedef BOOST_DEDUCED_TYPENAME base::difference_type index_type; - index_type m_index; + index_type m_index; - public: - explicit indexed_iterator( Iter i, index_type index ) - : base(i), m_index(index) - { - BOOST_ASSERT( m_index >= 0 && "Indexed Iterator out of bounds" ); - } + public: + explicit indexed_iterator( Iter i, index_type index ) + : base(i), m_index(index) + { + BOOST_ASSERT( m_index >= 0 && "Indexed Iterator out of bounds" ); + } - index_type index() const - { - return m_index; - } + index_type index() const + { + return m_index; + } - private: - friend class boost::iterator_core_access; + private: + friend class boost::iterator_core_access; - void increment() - { + void increment() + { ++m_index; ++(this->base_reference()); - } + } - void decrement() + void decrement() { BOOST_ASSERT( m_index > 0 && "Indexed Iterator out of bounds" ); --m_index; --(this->base_reference()); } - void advance( index_type n ) + void advance( index_type n ) { m_index += n; BOOST_ASSERT( m_index >= 0 && "Indexed Iterator out of bounds" ); this->base_reference() += n; } - }; + }; template< class Rng > struct indexed_range : @@ -107,45 +107,45 @@ namespace boost { } }; - } // 'range_detail' + } // 'range_detail' - // Make this available to users of this library. It will sometimes be - // required since it is the return type of operator '|' and - // index(). - using range_detail::indexed_range; + // Make this available to users of this library. It will sometimes be + // required since it is the return type of operator '|' and + // index(). + using range_detail::indexed_range; - namespace adaptors - { + namespace adaptors + { template< class SinglePassRange > - inline indexed_range - operator|( SinglePassRange& r, - const indexed& f ) - { - return indexed_range( f.val, r ); - } - - template< class SinglePassRange > - inline indexed_range - operator|( const SinglePassRange& r, - const indexed& f ) - { - return indexed_range( f.val, r ); - } - - template - inline indexed_range - index(SinglePassRange& rng, Index index_value) - { - return indexed_range(index_value, rng); - } - - template - inline indexed_range - index(const SinglePassRange& rng, Index index_value) - { - return indexed_range(index_value, rng); + inline indexed_range + operator|( SinglePassRange& r, + const indexed& f ) + { + return indexed_range( f.val, r ); } - } // 'adaptors' + + template< class SinglePassRange > + inline indexed_range + operator|( const SinglePassRange& r, + const indexed& f ) + { + return indexed_range( f.val, r ); + } + + template + inline indexed_range + index(SinglePassRange& rng, Index index_value) + { + return indexed_range(index_value, rng); + } + + template + inline indexed_range + index(const SinglePassRange& rng, Index index_value) + { + return indexed_range(index_value, rng); + } + } // 'adaptors' } diff --git a/include/boost/range/adaptor/indirected.hpp b/include/boost/range/adaptor/indirected.hpp index 5b13cfb..4abb3ec 100644 --- a/include/boost/range/adaptor/indirected.hpp +++ b/include/boost/range/adaptor/indirected.hpp @@ -16,72 +16,72 @@ namespace boost { - namespace range_detail - { - template< class R > - struct indirect_range : - public boost::iterator_range< + namespace range_detail + { + template< class R > + struct indirect_range : + public boost::iterator_range< boost::indirect_iterator< BOOST_DEDUCED_TYPENAME range_iterator::type > > - { - private: - typedef boost::iterator_range< + { + private: + typedef boost::iterator_range< boost::indirect_iterator< BOOST_DEDUCED_TYPENAME range_iterator::type > > - base; + base; - public: - explicit indirect_range( R& r ) + public: + explicit indirect_range( R& r ) : base( r ) - { } - }; + { } + }; - struct indirect_forwarder {}; + struct indirect_forwarder {}; - template< class InputRng > - inline indirect_range - operator|( InputRng& r, indirect_forwarder ) - { - return indirect_range( r ); - } + template< class InputRng > + inline indirect_range + operator|( InputRng& r, indirect_forwarder ) + { + return indirect_range( r ); + } - template< class InputRng > - inline indirect_range - operator|( const InputRng& r, indirect_forwarder ) - { - return indirect_range( r ); - } + template< class InputRng > + inline indirect_range + operator|( const InputRng& r, indirect_forwarder ) + { + return indirect_range( r ); + } - } // 'range_detail' + } // 'range_detail' - using range_detail::indirect_range; + using range_detail::indirect_range; - namespace adaptors - { - namespace - { - const range_detail::indirect_forwarder indirected = - range_detail::indirect_forwarder(); - } + namespace adaptors + { + namespace + { + const range_detail::indirect_forwarder indirected = + range_detail::indirect_forwarder(); + } - template - inline indirect_range - indirect(InputRange& rng) - { - return indirect_range(rng); - } + template + inline indirect_range + indirect(InputRange& rng) + { + return indirect_range(rng); + } - template - inline indirect_range - indirect(const InputRange& rng) - { - return indirect_range(rng); - } - } // 'adaptors' + template + inline indirect_range + indirect(const InputRange& rng) + { + return indirect_range(rng); + } + } // 'adaptors' } diff --git a/include/boost/range/adaptor/map.hpp b/include/boost/range/adaptor/map.hpp index f790e1a..a8a2c20 100755 --- a/include/boost/range/adaptor/map.hpp +++ b/include/boost/range/adaptor/map.hpp @@ -17,161 +17,161 @@ namespace boost { - namespace range_detail - { - struct map_keys_forwarder {}; - struct map_values_forwarder {}; + namespace range_detail + { + struct map_keys_forwarder {}; + struct map_values_forwarder {}; - template< class Map > - struct select_first - { - typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; - typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type& - result_type; + template< class Map > + struct select_first + { + typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; + typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type& + result_type; - result_type operator()( const pair_t& r ) const - { - return r.first; - } - }; + result_type operator()( const pair_t& r ) const + { + return r.first; + } + }; - template< class Map > - struct select_second_mutable - { - typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; - typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type; + template< class Map > + struct select_second_mutable + { + typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; + typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type; - result_type operator()( pair_t& r ) const - { - return r.second; - } - }; + result_type operator()( pair_t& r ) const + { + return r.second; + } + }; - template< class Map > - struct select_second_const - { - typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; - typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type& - result_type; - - result_type operator()( const pair_t& r ) const - { - return r.second; - } - }; - - template - class select_first_range - : public transform_range< - select_first, - const StdPairRng> - { - typedef transform_range, const StdPairRng> base; - public: - typedef select_first transform_fn_type; - typedef const StdPairRng source_range_type; + template< class Map > + struct select_second_const + { + typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; + typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type& + result_type; + + result_type operator()( const pair_t& r ) const + { + return r.second; + } + }; + + template + class select_first_range + : public transform_range< + select_first, + const StdPairRng> + { + typedef transform_range, const StdPairRng> base; + public: + typedef select_first transform_fn_type; + typedef const StdPairRng source_range_type; - select_first_range(transform_fn_type fn, source_range_type& rng) - : base(fn, rng) - { - } + select_first_range(transform_fn_type fn, source_range_type& rng) + : base(fn, rng) + { + } - select_first_range(const base& other) : base(other) {} - }; - - template - class select_second_mutable_range - : public transform_range< - select_second_mutable, - StdPairRng> - { - typedef transform_range, StdPairRng> base; - public: - typedef select_second_mutable transform_fn_type; - typedef StdPairRng source_range_type; + select_first_range(const base& other) : base(other) {} + }; + + template + class select_second_mutable_range + : public transform_range< + select_second_mutable, + StdPairRng> + { + typedef transform_range, StdPairRng> base; + public: + typedef select_second_mutable transform_fn_type; + typedef StdPairRng source_range_type; - select_second_mutable_range(transform_fn_type fn, source_range_type& rng) - : base(fn, rng) - { - } + select_second_mutable_range(transform_fn_type fn, source_range_type& rng) + : base(fn, rng) + { + } - select_second_mutable_range(const base& other) : base(other) {} - }; - - template - class select_second_const_range - : public transform_range< - select_second_const, - const StdPairRng> - { - typedef transform_range, const StdPairRng> base; - public: - typedef select_second_const transform_fn_type; - typedef const StdPairRng source_range_type; + select_second_mutable_range(const base& other) : base(other) {} + }; + + template + class select_second_const_range + : public transform_range< + select_second_const, + const StdPairRng> + { + typedef transform_range, const StdPairRng> base; + public: + typedef select_second_const transform_fn_type; + typedef const StdPairRng source_range_type; - select_second_const_range(transform_fn_type fn, source_range_type& rng) - : base(fn, rng) - { - } + select_second_const_range(transform_fn_type fn, source_range_type& rng) + : base(fn, rng) + { + } - select_second_const_range(const base& other) : base(other) {} - }; - - template< class StdPairRng > - inline select_first_range - operator|( const StdPairRng& r, map_keys_forwarder ) - { - return operator|( r, - boost::adaptors::transformed( select_first() ) ); - } + select_second_const_range(const base& other) : base(other) {} + }; + + template< class StdPairRng > + inline select_first_range + operator|( const StdPairRng& r, map_keys_forwarder ) + { + return operator|( r, + boost::adaptors::transformed( select_first() ) ); + } - template< class StdPairRng > - inline select_second_mutable_range - operator|( StdPairRng& r, map_values_forwarder ) - { - return operator|( r, - boost::adaptors::transformed( select_second_mutable() ) ); - } + template< class StdPairRng > + inline select_second_mutable_range + operator|( StdPairRng& r, map_values_forwarder ) + { + return operator|( r, + boost::adaptors::transformed( select_second_mutable() ) ); + } - template< class StdPairRng > - inline select_second_const_range - operator|( const StdPairRng& r, map_values_forwarder ) - { - return operator|( r, - boost::adaptors::transformed( select_second_const() ) ); - } - - } // 'range_detail' - - using range_detail::select_first_range; - using range_detail::select_second_mutable_range; - using range_detail::select_second_const_range; + template< class StdPairRng > + inline select_second_const_range + operator|( const StdPairRng& r, map_values_forwarder ) + { + return operator|( r, + boost::adaptors::transformed( select_second_const() ) ); + } + + } // 'range_detail' + + using range_detail::select_first_range; + using range_detail::select_second_mutable_range; + using range_detail::select_second_const_range; - namespace adaptors - { - namespace - { - const range_detail::map_keys_forwarder map_keys = - range_detail::map_keys_forwarder(); + namespace adaptors + { + namespace + { + const range_detail::map_keys_forwarder map_keys = + range_detail::map_keys_forwarder(); - const range_detail::map_values_forwarder map_values = - range_detail::map_values_forwarder(); - } - - template - inline select_first_range - keys(const StdPairRange& rng) - { - return select_first_range( - range_detail::select_first(), rng ); - } - - template - inline select_second_const_range - values(const StdPairRange& rng) - { - return select_second_const_range( - range_detail::select_second_const(), rng ); + const range_detail::map_values_forwarder map_values = + range_detail::map_values_forwarder(); + } + + template + inline select_first_range + keys(const StdPairRange& rng) + { + return select_first_range( + range_detail::select_first(), rng ); + } + + template + inline select_second_const_range + values(const StdPairRange& rng) + { + return select_second_const_range( + range_detail::select_second_const(), rng ); } template @@ -181,8 +181,8 @@ namespace boost return select_second_mutable_range( range_detail::select_second_mutable(), rng ); } - } // 'adaptors' - + } // 'adaptors' + } #endif diff --git a/include/boost/range/adaptor/replaced.hpp b/include/boost/range/adaptor/replaced.hpp index bdc0a2d..3c40918 100644 --- a/include/boost/range/adaptor/replaced.hpp +++ b/include/boost/range/adaptor/replaced.hpp @@ -22,99 +22,99 @@ namespace boost { - namespace range_detail - { - template< class Value > - class replace_value - { - public: - typedef const Value& result_type; - typedef const Value& first_argument_type; + namespace range_detail + { + template< class Value > + class replace_value + { + public: + typedef const Value& result_type; + typedef const Value& first_argument_type; - replace_value(const Value& from, const Value& to) - : m_from(from), m_to(to) - { - } + replace_value(const Value& from, const Value& to) + : m_from(from), m_to(to) + { + } - const Value& operator()(const Value& x) const - { - return (x == m_from) ? m_to : x; - } + const Value& operator()(const Value& x) const + { + return (x == m_from) ? m_to : x; + } - private: - Value m_from; - Value m_to; - }; + private: + Value m_from; + Value m_to; + }; - template< class R > - class replace_range : - public boost::iterator_range< - boost::transform_iterator< - replace_value< BOOST_DEDUCED_TYPENAME range_value::type >, - BOOST_DEDUCED_TYPENAME range_iterator::type > > - { - private: - typedef replace_value< BOOST_DEDUCED_TYPENAME range_value::type > Fn; + template< class R > + class replace_range : + public boost::iterator_range< + boost::transform_iterator< + replace_value< BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > + { + private: + typedef replace_value< BOOST_DEDUCED_TYPENAME range_value::type > Fn; - typedef boost::iterator_range< - boost::transform_iterator< - replace_value< BOOST_DEDUCED_TYPENAME range_value::type >, - BOOST_DEDUCED_TYPENAME range_iterator::type > > base_t; + typedef boost::iterator_range< + boost::transform_iterator< + replace_value< BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > base_t; - public: - typedef BOOST_DEDUCED_TYPENAME range_value::type value_type; + public: + typedef BOOST_DEDUCED_TYPENAME range_value::type value_type; - replace_range( R& r, value_type from, value_type to ) - : base_t( make_transform_iterator( boost::begin(r), Fn(from, to) ), - make_transform_iterator( boost::end(r), Fn(from, to) ) ) - { } - }; + replace_range( R& r, value_type from, value_type to ) + : base_t( make_transform_iterator( boost::begin(r), Fn(from, to) ), + make_transform_iterator( boost::end(r), Fn(from, to) ) ) + { } + }; - template< class T > - class replace_holder : public holder2 - { - public: - replace_holder( const T& from, const T& to ) - : holder2(from, to) - { } - private: - // not assignable - void operator=(const replace_holder&); - }; + template< class T > + class replace_holder : public holder2 + { + public: + replace_holder( const T& from, const T& to ) + : holder2(from, to) + { } + private: + // not assignable + void operator=(const replace_holder&); + }; - template< class InputRng > - inline replace_range - operator|( InputRng& r, - const replace_holder::type>& f ) - { - return replace_range(r, f.val1, f.val2); - } + template< class InputRng > + inline replace_range + operator|( InputRng& r, + const replace_holder::type>& f ) + { + return replace_range(r, f.val1, f.val2); + } - template< class InputRng > - inline replace_range - operator|( const InputRng& r, - const replace_holder::type>& f ) - { - return replace_range(r, f.val1, f.val2); - } - } // 'range_detail' + template< class InputRng > + inline replace_range + operator|( const InputRng& r, + const replace_holder::type>& f ) + { + return replace_range(r, f.val1, f.val2); + } + } // 'range_detail' using range_detail::replace_range; - namespace adaptors - { - namespace - { - const range_detail::forwarder2 - replaced = - range_detail::forwarder2(); - } + namespace adaptors + { + namespace + { + const range_detail::forwarder2 + replaced = + range_detail::forwarder2(); + } - template - inline replace_range - replace(InputRange& rng, - BOOST_DEDUCED_TYPENAME range_value::type from, - BOOST_DEDUCED_TYPENAME range_value::type to) + template + inline replace_range + replace(InputRange& rng, + BOOST_DEDUCED_TYPENAME range_value::type from, + BOOST_DEDUCED_TYPENAME range_value::type to) { return replace_range(rng, from, to); } @@ -128,7 +128,7 @@ namespace boost return replace_range(rng, from ,to); } - } // 'adaptors' + } // 'adaptors' } // 'boost' #endif // include guard diff --git a/include/boost/range/adaptor/replaced_if.hpp b/include/boost/range/adaptor/replaced_if.hpp index 22264a2..9353abd 100644 --- a/include/boost/range/adaptor/replaced_if.hpp +++ b/include/boost/range/adaptor/replaced_if.hpp @@ -22,115 +22,115 @@ namespace boost { - namespace range_detail - { - template< class Pred, class Value > - class replace_value_if - { - public: - typedef const Value& result_type; - typedef const Value& first_argument_type; + namespace range_detail + { + template< class Pred, class Value > + class replace_value_if + { + public: + typedef const Value& result_type; + typedef const Value& first_argument_type; - replace_value_if(const Pred& pred, const Value& to) - : m_pred(pred), m_to(to) - { - } + replace_value_if(const Pred& pred, const Value& to) + : m_pred(pred), m_to(to) + { + } - const Value& operator()(const Value& x) const - { - return m_pred(x) ? m_to : x; - } + const Value& operator()(const Value& x) const + { + return m_pred(x) ? m_to : x; + } - private: - Pred m_pred; - Value m_to; - }; + private: + Pred m_pred; + Value m_to; + }; - template< class Pred, class R > - class replace_if_range : - public boost::iterator_range< - boost::transform_iterator< - replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type >, - BOOST_DEDUCED_TYPENAME range_iterator::type > > - { - private: - typedef replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type > Fn; + template< class Pred, class R > + class replace_if_range : + public boost::iterator_range< + boost::transform_iterator< + replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > + { + private: + typedef replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type > Fn; - typedef boost::iterator_range< - boost::transform_iterator< - replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type >, - BOOST_DEDUCED_TYPENAME range_iterator::type > > base_t; + typedef boost::iterator_range< + boost::transform_iterator< + replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > base_t; - public: - typedef BOOST_DEDUCED_TYPENAME range_value::type value_type; + public: + typedef BOOST_DEDUCED_TYPENAME range_value::type value_type; - replace_if_range( R& r, const Pred& pred, value_type to ) - : base_t( make_transform_iterator( boost::begin(r), Fn(pred, to) ), - make_transform_iterator( boost::end(r), Fn(pred, to) ) ) - { } - }; + replace_if_range( R& r, const Pred& pred, value_type to ) + : base_t( make_transform_iterator( boost::begin(r), Fn(pred, to) ), + make_transform_iterator( boost::end(r), Fn(pred, to) ) ) + { } + }; - template< class Pred, class T > - class replace_if_holder - { - public: - replace_if_holder( const Pred& pred, const T& to ) - : m_pred(pred), m_to(to) - { } + template< class Pred, class T > + class replace_if_holder + { + public: + replace_if_holder( const Pred& pred, const T& to ) + : m_pred(pred), m_to(to) + { } - const Pred& pred() const { return m_pred; } - const T& to() const { return m_to; } + const Pred& pred() const { return m_pred; } + const T& to() const { return m_to; } - private: - Pred m_pred; - T m_to; - }; + private: + Pred m_pred; + T m_to; + }; - template< class Pred, class InputRng > - inline replace_if_range - operator|( InputRng& r, - const replace_if_holder::type>& f ) - { - return replace_if_range(r, f.pred(), f.to()); - } + template< class Pred, class InputRng > + inline replace_if_range + operator|( InputRng& r, + const replace_if_holder::type>& f ) + { + return replace_if_range(r, f.pred(), f.to()); + } - template< class Pred, class InputRng > - inline replace_if_range - operator|( const InputRng& r, - const replace_if_holder::type>& f ) - { - return replace_if_range(r, f.pred(), f.to()); - } - } // 'range_detail' + template< class Pred, class InputRng > + inline replace_if_range + operator|( const InputRng& r, + const replace_if_holder::type>& f ) + { + return replace_if_range(r, f.pred(), f.to()); + } + } // 'range_detail' using range_detail::replace_if_range; - namespace adaptors - { - namespace - { - const range_detail::forwarder2TU - replaced_if = - range_detail::forwarder2TU(); - } - - template - inline replace_if_range - replace_if(InputRange& rng, Pred pred, + namespace adaptors + { + namespace + { + const range_detail::forwarder2TU + replaced_if = + range_detail::forwarder2TU(); + } + + template + inline replace_if_range + replace_if(InputRange& rng, Pred pred, BOOST_DEDUCED_TYPENAME range_value::type to) - { - return range_detail::replace_if_range(rng, pred, to); - } + { + return range_detail::replace_if_range(rng, pred, to); + } - template - inline replace_if_range - replace_if(const InputRange& rng, Pred pred, - BOOST_DEDUCED_TYPENAME range_value::type to) - { - return range_detail::replace_if_range(rng, pred, to); - } - } // 'adaptors' - + template + inline replace_if_range + replace_if(const InputRange& rng, Pred pred, + BOOST_DEDUCED_TYPENAME range_value::type to) + { + return range_detail::replace_if_range(rng, pred, to); + } + } // 'adaptors' + } // 'boost' #endif // include guard diff --git a/include/boost/range/adaptor/reversed.hpp b/include/boost/range/adaptor/reversed.hpp index afe7517..229702b 100755 --- a/include/boost/range/adaptor/reversed.hpp +++ b/include/boost/range/adaptor/reversed.hpp @@ -16,75 +16,75 @@ namespace boost { - namespace range_detail - { - template< class R > - struct reverse_range : - public boost::iterator_range< - boost::reverse_iterator< - BOOST_DEDUCED_TYPENAME range_iterator::type - > - > - { - private: - typedef boost::iterator_range< - boost::reverse_iterator< - BOOST_DEDUCED_TYPENAME range_iterator::type - > - > - base; - - public: - typedef boost::reverse_iterator::type> iterator; + namespace range_detail + { + template< class R > + struct reverse_range : + public boost::iterator_range< + boost::reverse_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef boost::iterator_range< + boost::reverse_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + base; + + public: + typedef boost::reverse_iterator::type> iterator; - reverse_range( R& r ) - : base( iterator(boost::end(r)), iterator(boost::begin(r)) ) - { } - }; + reverse_range( R& r ) + : base( iterator(boost::end(r)), iterator(boost::begin(r)) ) + { } + }; - struct reverse_forwarder {}; - - template< class BidirectionalRng > - inline reverse_range - operator|( BidirectionalRng& r, reverse_forwarder ) - { - return reverse_range( r ); - } - - template< class BidirectionalRng > - inline reverse_range - operator|( const BidirectionalRng& r, reverse_forwarder ) - { - return reverse_range( r ); - } - - } // 'range_detail' - - using range_detail::reverse_range; - - namespace adaptors - { - namespace - { - const range_detail::reverse_forwarder reversed = - range_detail::reverse_forwarder(); - } - - template - inline reverse_range - reverse(BidirectionalRange& rng) - { - return reverse_range(rng); - } - - template - inline reverse_range - reverse(const BidirectionalRange& rng) - { - return reverse_range(rng); + struct reverse_forwarder {}; + + template< class BidirectionalRng > + inline reverse_range + operator|( BidirectionalRng& r, reverse_forwarder ) + { + return reverse_range( r ); } - } // 'adaptors' - + + template< class BidirectionalRng > + inline reverse_range + operator|( const BidirectionalRng& r, reverse_forwarder ) + { + return reverse_range( r ); + } + + } // 'range_detail' + + using range_detail::reverse_range; + + namespace adaptors + { + namespace + { + const range_detail::reverse_forwarder reversed = + range_detail::reverse_forwarder(); + } + + template + inline reverse_range + reverse(BidirectionalRange& rng) + { + return reverse_range(rng); + } + + template + inline reverse_range + reverse(const BidirectionalRange& rng) + { + return reverse_range(rng); + } + } // 'adaptors' + } // 'boost' #endif diff --git a/include/boost/range/adaptor/strided.hpp b/include/boost/range/adaptor/strided.hpp index 0c394b2..5f4c4fa 100755 --- a/include/boost/range/adaptor/strided.hpp +++ b/include/boost/range/adaptor/strided.hpp @@ -18,132 +18,132 @@ namespace boost { - namespace range_detail - { + namespace range_detail + { - template - class strided_iterator - : public iterator_adaptor< - strided_iterator, - BaseIterator> - { - friend class iterator_core_access; + template + class strided_iterator + : public iterator_adaptor< + strided_iterator, + BaseIterator> + { + friend class iterator_core_access; - typedef iterator_adaptor, BaseIterator> super_t; - - public: - typedef BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type difference_type; - - strided_iterator() : m_stride() { } - - strided_iterator(const strided_iterator& other) - : super_t(other), m_stride(other.m_stride) { } - - explicit strided_iterator(BaseIterator base_it, difference_type stride) - : super_t(base_it), m_stride(stride) { } - - strided_iterator& - operator=(const strided_iterator& other) - { - super_t::operator=(other); - - // Is the interoperation of the stride safe? - m_stride = other.m_stride; - return *this; - } - - void increment() { std::advance(this->base_reference(), m_stride); } - - void decrement() { std::advance(this->base_reference(), -m_stride); } - - void advance(difference_type n) { std::advance(this->base_reference(), n * m_stride); } - - difference_type - distance_to(const strided_iterator& other) const - { - return std::distance(this->base_reference(), other.base_reference()) / m_stride; - } + typedef iterator_adaptor, BaseIterator> super_t; + + public: + typedef BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type difference_type; + + strided_iterator() : m_stride() { } + + strided_iterator(const strided_iterator& other) + : super_t(other), m_stride(other.m_stride) { } + + explicit strided_iterator(BaseIterator base_it, difference_type stride) + : super_t(base_it), m_stride(stride) { } + + strided_iterator& + operator=(const strided_iterator& other) + { + super_t::operator=(other); + + // Is the interoperation of the stride safe? + m_stride = other.m_stride; + return *this; + } + + void increment() { std::advance(this->base_reference(), m_stride); } + + void decrement() { std::advance(this->base_reference(), -m_stride); } + + void advance(difference_type n) { std::advance(this->base_reference(), n * m_stride); } + + difference_type + distance_to(const strided_iterator& other) const + { + return std::distance(this->base_reference(), other.base_reference()) / m_stride; + } - // Using the compiler generated copy constructor and - // and assignment operator - - private: - difference_type m_stride; - }; - - template inline - strided_iterator - make_strided_iterator( - const BaseIterator& first, - BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type stride) - { - return strided_iterator(first, stride); - } + // Using the compiler generated copy constructor and + // and assignment operator + + private: + difference_type m_stride; + }; + + template inline + strided_iterator + make_strided_iterator( + const BaseIterator& first, + BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type stride) + { + return strided_iterator(first, stride); + } - template< class Rng > - class strided_range - : public iterator_range::type> > - { - typedef range_detail::strided_iterator::type> iter_type; - typedef iterator_range super_t; - public: - template< typename Difference > - strided_range(Difference stride, Rng& rng) + template< class Rng > + class strided_range + : public iterator_range::type> > + { + typedef range_detail::strided_iterator::type> iter_type; + typedef iterator_range super_t; + public: + template< typename Difference > + strided_range(Difference stride, Rng& rng) : super_t(make_strided_iterator(boost::begin(rng), stride), make_strided_iterator(boost::end(rng), stride)) - { - } - }; + { + } + }; - template - class strided_holder : public holder - { - public: - strided_holder(Difference value) : holder(value) {} - }; + template + class strided_holder : public holder + { + public: + strided_holder(Difference value) : holder(value) {} + }; - template - inline strided_range - operator|(Rng& rng, const strided_holder& stride) - { - return strided_range(stride.val, rng); - } + template + inline strided_range + operator|(Rng& rng, const strided_holder& stride) + { + return strided_range(stride.val, rng); + } - template - inline strided_range - operator|(const Rng& rng, const strided_holder& stride) - { - return strided_range(stride.val, rng); - } + template + inline strided_range + operator|(const Rng& rng, const strided_holder& stride) + { + return strided_range(stride.val, rng); + } - } // namespace range_detail - - using range_detail::strided_range; + } // namespace range_detail + + using range_detail::strided_range; - namespace adaptors - { - - namespace - { - const range_detail::forwarder - strided = range_detail::forwarder(); - } - - template - inline strided_range - stride(Range& rng, Difference step) - { - return strided_range(step, rng); - } - - template - inline strided_range - stride(const Range& rng, Difference step) - { - return strided_range(step, rng); + namespace adaptors + { + + namespace + { + const range_detail::forwarder + strided = range_detail::forwarder(); } - } // namespace 'adaptors' + template + inline strided_range + stride(Range& rng, Difference step) + { + return strided_range(step, rng); + } + + template + inline strided_range + stride(const Range& rng, Difference step) + { + return strided_range(step, rng); + } + + } // namespace 'adaptors' } // namespace 'boost' #endif diff --git a/include/boost/range/adaptor/tokenized.hpp b/include/boost/range/adaptor/tokenized.hpp index c81d515..6b6a6fa 100755 --- a/include/boost/range/adaptor/tokenized.hpp +++ b/include/boost/range/adaptor/tokenized.hpp @@ -16,122 +16,122 @@ namespace boost { - namespace range_detail - { + namespace range_detail + { - template< class R > - struct token_range : - public boost::iterator_range< - boost::regex_token_iterator< - BOOST_DEDUCED_TYPENAME range_iterator::type - > - > - { - private: - typedef - boost::regex_token_iterator< - BOOST_DEDUCED_TYPENAME range_iterator::type - > - regex_iter; - - typedef BOOST_DEDUCED_TYPENAME regex_iter::regex_type - regex_type; - - typedef boost::iterator_range - base; + template< class R > + struct token_range : + public boost::iterator_range< + boost::regex_token_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef + boost::regex_token_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + regex_iter; + + typedef BOOST_DEDUCED_TYPENAME regex_iter::regex_type + regex_type; + + typedef boost::iterator_range + base; - public: - template< class Regex, class Submatch, class Flag > - token_range( R& r, const Regex& re, const Submatch& sub, Flag f ) - : base( regex_iter( boost::begin(r), boost::end(r), - regex_type(re), sub, f ), - regex_iter() ) - { } - }; + public: + template< class Regex, class Submatch, class Flag > + token_range( R& r, const Regex& re, const Submatch& sub, Flag f ) + : base( regex_iter( boost::begin(r), boost::end(r), + regex_type(re), sub, f ), + regex_iter() ) + { } + }; - template< class T, class U, class V > - struct regex_holder - { - const T& re; - const U& sub; - V f; + template< class T, class U, class V > + struct regex_holder + { + const T& re; + const U& sub; + V f; - regex_holder( const T& rex, const U& subm, V flag ) : - re(rex), sub(subm), f(flag) - { } - private: - // Not assignable - void operator=(const regex_holder&); - }; + regex_holder( const T& rex, const U& subm, V flag ) : + re(rex), sub(subm), f(flag) + { } + private: + // Not assignable + void operator=(const regex_holder&); + }; - struct regex_forwarder - { - template< class Regex > - regex_holder - operator()( const Regex& re, - int submatch = 0, - regex_constants::match_flag_type f = - regex_constants::match_default ) const - { - return regex_holder( re, submatch, f ); - } - - template< class Regex, class Submatch > - regex_holder - operator()( const Regex& re, - const Submatch& sub, - regex_constants::match_flag_type f = - regex_constants::match_default ) const - { - return regex_holder( re, sub, f ); - } - }; - - template< class BidirectionalRng, class R, class S, class F > - inline token_range - operator|( BidirectionalRng& r, - const regex_holder& f ) - { - return token_range( r, f.re, f.sub, f.f ); - } + struct regex_forwarder + { + template< class Regex > + regex_holder + operator()( const Regex& re, + int submatch = 0, + regex_constants::match_flag_type f = + regex_constants::match_default ) const + { + return regex_holder( re, submatch, f ); + } + + template< class Regex, class Submatch > + regex_holder + operator()( const Regex& re, + const Submatch& sub, + regex_constants::match_flag_type f = + regex_constants::match_default ) const + { + return regex_holder( re, sub, f ); + } + }; + + template< class BidirectionalRng, class R, class S, class F > + inline token_range + operator|( BidirectionalRng& r, + const regex_holder& f ) + { + return token_range( r, f.re, f.sub, f.f ); + } - template< class BidirectionalRng, class R, class S, class F > - inline token_range - operator|( const BidirectionalRng& r, - const regex_holder& f ) - { - return token_range( r, f.re, f.sub, f.f ); - } - - } // 'range_detail' + template< class BidirectionalRng, class R, class S, class F > + inline token_range + operator|( const BidirectionalRng& r, + const regex_holder& f ) + { + return token_range( r, f.re, f.sub, f.f ); + } + + } // 'range_detail' using range_detail::token_range; - namespace adaptors - { - namespace - { - const range_detail::regex_forwarder tokenized = - range_detail::regex_forwarder(); - } - - template - inline token_range - tokenize(BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f) - { - return token_range(rng, reg, sub, f); - } - - template - inline token_range - tokenize(const BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f) - { - return token_range(rng, reg, sub, f); - } - } // 'adaptors' - + namespace adaptors + { + namespace + { + const range_detail::regex_forwarder tokenized = + range_detail::regex_forwarder(); + } + + template + inline token_range + tokenize(BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f) + { + return token_range(rng, reg, sub, f); + } + + template + inline token_range + tokenize(const BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f) + { + return token_range(rng, reg, sub, f); + } + } // 'adaptors' + } #endif diff --git a/include/boost/range/adaptor/transformed.hpp b/include/boost/range/adaptor/transformed.hpp index 0eeaee7..00297ca 100755 --- a/include/boost/range/adaptor/transformed.hpp +++ b/include/boost/range/adaptor/transformed.hpp @@ -17,87 +17,87 @@ namespace boost { - namespace range_detail - { + namespace range_detail + { - template< class F, class R > - struct transform_range : - public boost::iterator_range< - boost::transform_iterator< F, - BOOST_DEDUCED_TYPENAME range_iterator::type - > - > - { - private: - typedef boost::iterator_range< - boost::transform_iterator< F, - BOOST_DEDUCED_TYPENAME range_iterator::type - > - > - base; + template< class F, class R > + struct transform_range : + public boost::iterator_range< + boost::transform_iterator< F, + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef boost::iterator_range< + boost::transform_iterator< F, + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + base; - public: - typedef F transform_fn_type; - typedef R source_range_type; - - transform_range( F f, R& r ) - : base( make_transform_iterator( boost::begin(r), f ), - make_transform_iterator( boost::end(r), f ) ) - - { } - }; + public: + typedef F transform_fn_type; + typedef R source_range_type; + + transform_range( F f, R& r ) + : base( make_transform_iterator( boost::begin(r), f ), + make_transform_iterator( boost::end(r), f ) ) + + { } + }; - template< class T > - struct transform_holder : holder - { - transform_holder( T r ) : holder(r) - { } - }; - - template< class InputRng, class UnaryFunction > - inline transform_range - operator|( InputRng& r, - const transform_holder& f ) - { - return transform_range( f.val, r ); - } - - template< class InputRng, class UnaryFunction > - inline transform_range - operator|( const InputRng& r, - const transform_holder& f ) - { - return transform_range( f.val, r ); - } - - } // 'range_detail' + template< class T > + struct transform_holder : holder + { + transform_holder( T r ) : holder(r) + { } + }; + + template< class InputRng, class UnaryFunction > + inline transform_range + operator|( InputRng& r, + const transform_holder& f ) + { + return transform_range( f.val, r ); + } + + template< class InputRng, class UnaryFunction > + inline transform_range + operator|( const InputRng& r, + const transform_holder& f ) + { + return transform_range( f.val, r ); + } + + } // 'range_detail' - using range_detail::transform_range; - - namespace adaptors - { - namespace - { - const range_detail::forwarder - transformed = + using range_detail::transform_range; + + namespace adaptors + { + namespace + { + const range_detail::forwarder + transformed = range_detail::forwarder(); - } - - template - inline transform_range - transform(InputRange& rng, UnaryFunction fn) - { - return transform_range(fn, rng); - } - - template - inline transform_range - transform(const InputRange& rng, UnaryFunction fn) - { - return transform_range(fn, rng); - } - } // 'adaptors' - + } + + template + inline transform_range + transform(InputRange& rng, UnaryFunction fn) + { + return transform_range(fn, rng); + } + + template + inline transform_range + transform(const InputRange& rng, UnaryFunction fn) + { + return transform_range(fn, rng); + } + } // 'adaptors' + } #endif diff --git a/include/boost/range/adaptor/uniqued.hpp b/include/boost/range/adaptor/uniqued.hpp index ddaf3fe..ad6f7f4 100755 --- a/include/boost/range/adaptor/uniqued.hpp +++ b/include/boost/range/adaptor/uniqued.hpp @@ -16,74 +16,74 @@ namespace boost { - namespace range_detail - { - struct unique_forwarder { }; + namespace range_detail + { + struct unique_forwarder { }; - struct unique_not_equal_to - { - typedef bool result_type; + struct unique_not_equal_to + { + typedef bool result_type; - template< class T > - bool operator()( const T& l, const T& r ) const - { - return !(l == r); - } - }; + template< class T > + bool operator()( const T& l, const T& r ) const + { + return !(l == r); + } + }; - template - class unique_range : public adjacent_filter_range - { - typedef adjacent_filter_range base; - public: - explicit unique_range(ForwardRng& rng) - : base(unique_not_equal_to(), rng) - { - } - }; + template + class unique_range : public adjacent_filter_range + { + typedef adjacent_filter_range base; + public: + explicit unique_range(ForwardRng& rng) + : base(unique_not_equal_to(), rng) + { + } + }; - template< class ForwardRng > - inline unique_range - operator|( ForwardRng& r, - unique_forwarder ) - { - return unique_range(r); - } - - template< class ForwardRng > - inline unique_range - operator|( const ForwardRng& r, - unique_forwarder ) - { - return unique_range(r); - } - - } // 'range_detail' - - using range_detail::unique_range; - - namespace adaptors - { - namespace - { - const range_detail::unique_forwarder uniqued = - range_detail::unique_forwarder(); - } - - template - inline unique_range - unique(ForwardRange& rng) - { - return unique_range(rng); - } - - template - inline unique_range - unique(const ForwardRange& rng) - { - return unique_range(rng); + template< class ForwardRng > + inline unique_range + operator|( ForwardRng& r, + unique_forwarder ) + { + return unique_range(r); } - } // 'adaptors' + + template< class ForwardRng > + inline unique_range + operator|( const ForwardRng& r, + unique_forwarder ) + { + return unique_range(r); + } + + } // 'range_detail' + + using range_detail::unique_range; + + namespace adaptors + { + namespace + { + const range_detail::unique_forwarder uniqued = + range_detail::unique_forwarder(); + } + + template + inline unique_range + unique(ForwardRange& rng) + { + return unique_range(rng); + } + + template + inline unique_range + unique(const ForwardRange& rng) + { + return unique_range(rng); + } + } // 'adaptors' } diff --git a/include/boost/range/adaptors.hpp b/include/boost/range/adaptors.hpp index a1fad4f..92062a9 100755 --- a/include/boost/range/adaptors.hpp +++ b/include/boost/range/adaptors.hpp @@ -22,8 +22,9 @@ #include #include #include +#include #include #include #include -#endif +#endif diff --git a/include/boost/range/algorithm/equal.hpp b/include/boost/range/algorithm/equal.hpp index e210ef5..7226440 100755 --- a/include/boost/range/algorithm/equal.hpp +++ b/include/boost/range/algorithm/equal.hpp @@ -20,7 +20,7 @@ namespace boost { // An implementation of equality comparison that is optimized for iterator // traversal categories less than RandomAccessTraversal. - template< class SinglePassTraversalReadableIterator1, + template< class SinglePassTraversalReadableIterator1, class SinglePassTraversalReadableIterator2, class IteratorCategoryTag1, class IteratorCategoryTag2 > diff --git a/include/boost/range/algorithm/generate.hpp b/include/boost/range/algorithm/generate.hpp index 97a0d9d..bd63a48 100755 --- a/include/boost/range/algorithm/generate.hpp +++ b/include/boost/range/algorithm/generate.hpp @@ -33,15 +33,6 @@ inline ForwardRange& generate( ForwardRange& rng, Generator gen ) return rng; } -/// \overload -template< class ForwardRange, class Generator > -inline const ForwardRange& generate(const ForwardRange& rng, Generator gen) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - std::generate(boost::begin(rng), boost::end(rng), gen); - return rng; -} - } // namespace range using range::generate; } // namespace boost diff --git a/include/boost/range/algorithm/heap_algorithm.hpp b/include/boost/range/algorithm/heap_algorithm.hpp index 857a30f..64df3e9 100755 --- a/include/boost/range/algorithm/heap_algorithm.hpp +++ b/include/boost/range/algorithm/heap_algorithm.hpp @@ -27,34 +27,20 @@ namespace boost /// \pre RandomAccessRange is a model of the RandomAccessRangeConcept /// \pre Compare is a model of the BinaryPredicateConcept template -inline void push_heap(RandomAccessRange& rng) +inline RandomAccessRange& push_heap(RandomAccessRange& rng) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::push_heap(boost::begin(rng), boost::end(rng)); -} - -/// \overload -template -inline void push_heap(const RandomAccessRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::push_heap(boost::begin(rng), boost::end(rng)); + return rng; } /// \overload template -inline void push_heap(RandomAccessRange& rng, Compare comp_pred) +inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::push_heap(boost::begin(rng), boost::end(rng), comp_pred); -} - -/// \overload -template -inline void push_heap(const RandomAccessRange& rng, Compare comp_pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::push_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; } /// \brief template function pop_heap @@ -64,34 +50,20 @@ inline void push_heap(const RandomAccessRange& rng, Compare comp_pred) /// \pre RandomAccessRange is a model of the RandomAccessRangeConcept /// \pre Compare is a model of the BinaryPredicateConcept template -inline void pop_heap(RandomAccessRange& rng) +inline RandomAccessRange& pop_heap(RandomAccessRange& rng) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::pop_heap(boost::begin(rng), boost::end(rng)); -} - -/// \overload -template -inline void pop_heap(const RandomAccessRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::pop_heap(boost::begin(rng),boost::end(rng)); + return rng; } /// \overload template -inline void pop_heap(RandomAccessRange& rng, Compare comp_pred) +inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred); -} - -/// \overload -template -inline void pop_heap(const RandomAccessRange& rng, Compare comp_pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; } /// \brief template function make_heap @@ -101,34 +73,20 @@ inline void pop_heap(const RandomAccessRange& rng, Compare comp_pred) /// \pre RandomAccessRange is a model of the RandomAccessRangeConcept /// \pre Compare is a model of the BinaryPredicateConcept template -inline void make_heap(RandomAccessRange& rng) +inline RandomAccessRange& make_heap(RandomAccessRange& rng) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::make_heap(boost::begin(rng), boost::end(rng)); -} - -/// \overload -template -inline void make_heap(const RandomAccessRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::make_heap(boost::begin(rng),boost::end(rng)); + return rng; } /// \overload template -inline void make_heap(RandomAccessRange& rng, Compare comp_pred) +inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::make_heap(boost::begin(rng), boost::end(rng), comp_pred); -} - -/// \overload -template -inline void make_heap(const RandomAccessRange& rng, Compare comp_pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::make_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; } /// \brief template function sort_heap @@ -138,34 +96,20 @@ inline void make_heap(const RandomAccessRange& rng, Compare comp_pred) /// \pre RandomAccessRange is a model of the RandomAccessRangeConcept /// \pre Compare is a model of the BinaryPredicateConcept template -inline void sort_heap(RandomAccessRange& rng) +inline RandomAccessRange& sort_heap(RandomAccessRange& rng) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::sort_heap(boost::begin(rng), boost::end(rng)); -} - -/// \overload -template -inline void sort_heap(const RandomAccessRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::sort_heap(boost::begin(rng), boost::end(rng)); + return rng; } /// \overload template -inline void sort_heap(RandomAccessRange& rng, Compare comp_pred) +inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred); -} - -/// \overload -template -inline void sort_heap(const RandomAccessRange& rng, Compare comp_pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; } } // namespace range diff --git a/include/boost/range/algorithm/nth_element.hpp b/include/boost/range/algorithm/nth_element.hpp index 3e06baf..a605595 100755 --- a/include/boost/range/algorithm/nth_element.hpp +++ b/include/boost/range/algorithm/nth_element.hpp @@ -27,40 +27,44 @@ namespace boost /// \pre RandomAccessRange is a model of the RandomAccessRangeConcept /// \pre BinaryPredicate is a model of the BinaryPredicateConcept template -inline void nth_element(RandomAccessRange& rng, +inline RandomAccessRange& nth_element(RandomAccessRange& rng, BOOST_DEDUCED_TYPENAME range_iterator::type nth) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::nth_element(boost::begin(rng), nth, boost::end(rng)); + return rng; } /// \overload template -inline void nth_element(const RandomAccessRange& rng, +inline const RandomAccessRange& nth_element(const RandomAccessRange& rng, BOOST_DEDUCED_TYPENAME range_iterator::type nth) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::nth_element(boost::begin(rng),nth,boost::end(rng)); + std::nth_element(boost::begin(rng), nth, boost::end(rng)); + return rng; } /// \overload template -inline void nth_element(RandomAccessRange& rng, +inline RandomAccessRange& nth_element(RandomAccessRange& rng, BOOST_DEDUCED_TYPENAME range_iterator::type nth, BinaryPredicate sort_pred) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::nth_element(boost::begin(rng), nth, boost::end(rng), sort_pred); + return rng; } /// \overload template -inline void nth_element(const RandomAccessRange& rng, +inline const RandomAccessRange& nth_element(const RandomAccessRange& rng, BOOST_DEDUCED_TYPENAME range_iterator::type nth, BinaryPredicate sort_pred) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::nth_element(boost::begin(rng),nth,boost::end(rng), sort_pred); + std::nth_element(boost::begin(rng), nth, boost::end(rng), sort_pred); + return rng; } } // namespace range diff --git a/include/boost/range/algorithm/partial_sort.hpp b/include/boost/range/algorithm/partial_sort.hpp index e38c4be..1797c55 100755 --- a/include/boost/range/algorithm/partial_sort.hpp +++ b/include/boost/range/algorithm/partial_sort.hpp @@ -27,41 +27,24 @@ namespace boost /// \pre RandomAccessRange is a model of the RandomAccessRangeConcept /// \pre BinaryPredicate is a model of the BinaryPredicateConcept template -inline void partial_sort(RandomAccessRange& rng, +inline RandomAccessRange& partial_sort(RandomAccessRange& rng, BOOST_DEDUCED_TYPENAME range_iterator::type middle) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::partial_sort(boost::begin(rng), middle, boost::end(rng)); -} - -/// \overload -template -inline void partial_sort(const RandomAccessRange& rng, - BOOST_DEDUCED_TYPENAME range_iterator::type middle) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::partial_sort(boost::begin(rng), middle, boost::end(rng)); + return rng; } /// \overload template -inline void partial_sort(RandomAccessRange& rng, +inline RandomAccessRange& partial_sort(RandomAccessRange& rng, BOOST_DEDUCED_TYPENAME range_iterator::type middle, BinaryPredicate sort_pred) { BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); std::partial_sort(boost::begin(rng), middle, boost::end(rng), sort_pred); -} - -/// \overload -template -inline void partial_sort(const RandomAccessRange& rng, - BOOST_DEDUCED_TYPENAME range_iterator::type middle, - BinaryPredicate sort_pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::partial_sort(boost::begin(rng), middle, boost::end(rng), sort_pred); + return rng; } } // namespace range diff --git a/include/boost/range/algorithm/partial_sort_copy.hpp b/include/boost/range/algorithm/partial_sort_copy.hpp index 8cf3510..a2fe761 100755 --- a/include/boost/range/algorithm/partial_sort_copy.hpp +++ b/include/boost/range/algorithm/partial_sort_copy.hpp @@ -28,30 +28,24 @@ namespace boost /// \pre SinglePassRange is a model of the SinglePassRangeConcept /// \pre RandomAccessRange is a model of the Mutable_RandomAccessRangeConcept /// \pre BinaryPredicate is a model of the BinaryPredicateConcept -template -inline typename range_iterator::type +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2) { BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); - BOOST_RANGE_CONCEPT_ASSERT((WriteableRandomAccessRangeConcept)); - BOOST_RANGE_CONCEPT_ASSERT((range_detail::SameTypeConcept::type, typename range_value::type>)); - BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept::type>)); return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1), boost::begin(rng2), boost::end(rng2)); } /// \overload -template -inline typename range_iterator::type +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); - BOOST_RANGE_CONCEPT_ASSERT((WriteableRandomAccessRangeConcept)); - BOOST_RANGE_CONCEPT_ASSERT((range_detail::SameTypeConcept::type, typename range_value::type>)); - BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, typename range_value::type>)); return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1), boost::begin(rng2), boost::end(rng2), pred); diff --git a/include/boost/range/algorithm/partition.hpp b/include/boost/range/algorithm/partition.hpp index 05f41da..6404918 100755 --- a/include/boost/range/algorithm/partition.hpp +++ b/include/boost/range/algorithm/partition.hpp @@ -34,15 +34,6 @@ partition(ForwardRange& rng, UnaryPredicate pred) return std::partition(boost::begin(rng),boost::end(rng),pred); } -/// \overload -template -inline BOOST_DEDUCED_TYPENAME range_iterator::type -partition(const ForwardRange& rng, UnaryPredicate pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return std::partition(boost::begin(rng),boost::end(rng),pred); -} - // range_return overloads /// \overload @@ -56,17 +47,6 @@ partition(ForwardRange& rng, UnaryPredicate pred) pack(std::partition(boost::begin(rng), boost::end(rng), pred), rng); } -/// \overload -template< range_return_value re, class ForwardRange, - class UnaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_return::type -partition(const ForwardRange& rng, UnaryPredicate pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return boost::range_return:: - pack(std::partition(boost::begin(rng), boost::end(rng), pred), rng); -} - } // namespace range using range::partition; } // namespace boost diff --git a/include/boost/range/algorithm/random_shuffle.hpp b/include/boost/range/algorithm/random_shuffle.hpp index eeae3d7..0b17333 100755 --- a/include/boost/range/algorithm/random_shuffle.hpp +++ b/include/boost/range/algorithm/random_shuffle.hpp @@ -34,15 +34,6 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng) return rng; } -/// \overload -template -inline const RandomAccessRange& random_shuffle(const RandomAccessRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::random_shuffle(boost::begin(rng),boost::end(rng)); - return rng; -} - /// \overload template inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen) @@ -52,15 +43,6 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen) return rng; } -/// \overload -template -inline const RandomAccessRange& random_shuffle(const RandomAccessRange& rng, Generator& gen) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::random_shuffle(boost::begin(rng), boost::end(rng), gen); - return rng; -} - } // namespace range using range::random_shuffle; } // namespace boost diff --git a/include/boost/range/algorithm/remove.hpp b/include/boost/range/algorithm/remove.hpp index 699a7cd..638dff2 100755 --- a/include/boost/range/algorithm/remove.hpp +++ b/include/boost/range/algorithm/remove.hpp @@ -34,15 +34,6 @@ remove(ForwardRange& rng, const Value& val) return std::remove(boost::begin(rng),boost::end(rng),val); } -/// \overload -template< class ForwardRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_iterator::type -remove(const ForwardRange& rng, const Value& val) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return std::remove(boost::begin(rng),boost::end(rng),val); -} - // range_return overloads /// \overload @@ -56,17 +47,6 @@ remove(ForwardRange& rng, const Value& val) rng); } -/// \overload -template< range_return_value re, class ForwardRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_return::type -remove(const ForwardRange& rng, const Value& val) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return range_return::pack( - std::remove(boost::begin(rng), boost::end(rng), val), - rng); -} - } // namespace range using range::remove; } // namespace boost diff --git a/include/boost/range/algorithm/remove_copy_if.hpp b/include/boost/range/algorithm/remove_copy_if.hpp index 665b359..791a38f 100755 --- a/include/boost/range/algorithm/remove_copy_if.hpp +++ b/include/boost/range/algorithm/remove_copy_if.hpp @@ -31,7 +31,7 @@ namespace boost remove_copy_if(SinglePassRange& rng, OutputIterator out_it, Predicate pred) { boost::function_requires< SinglePassRangeConcept >(); - return std::remove_copy_if(boost::begin(rng), boost::end(rng), out_it, pred); + return std::remove_copy_if(boost::begin(rng), boost::end(rng), out_it, pred); } } diff --git a/include/boost/range/algorithm/remove_if.hpp b/include/boost/range/algorithm/remove_if.hpp index babcddc..349e7a4 100755 --- a/include/boost/range/algorithm/remove_if.hpp +++ b/include/boost/range/algorithm/remove_if.hpp @@ -35,15 +35,6 @@ remove_if(ForwardRange& rng, UnaryPredicate pred) return std::remove_if(boost::begin(rng), boost::end(rng), pred); } -/// \overload -template< class ForwardRange, class UnaryPredicate > -inline BOOST_DEDUCED_TYPENAME boost::range_iterator::type -remove_if(const ForwardRange& rng, UnaryPredicate pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return std::remove_if(boost::begin(rng),boost::end(rng),pred); -} - // range_return overloads /// \overload @@ -57,17 +48,6 @@ remove_if(ForwardRange& rng, UnaryPredicate pred) rng); } -/// \overload -template< range_return_value re, class ForwardRange, class UnaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_return::type -remove_if(const ForwardRange& rng, UnaryPredicate pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return range_return::pack( - std::remove_if(boost::begin(rng), boost::end(rng), pred), - rng); -} - } // namespace range using range::remove_if; } // namespace boost diff --git a/include/boost/range/algorithm/replace.hpp b/include/boost/range/algorithm/replace.hpp index 44d3e4c..3f2d72c 100755 --- a/include/boost/range/algorithm/replace.hpp +++ b/include/boost/range/algorithm/replace.hpp @@ -35,17 +35,6 @@ replace(ForwardRange& rng, const Value& what, return rng; } -/// \overload -template< class ForwardRange, class Value > -inline const ForwardRange& -replace(const ForwardRange& rng, const Value& what, - const Value& with_what) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - std::replace(boost::begin(rng), boost::end(rng), what, with_what); - return rng; -} - } // namespace range using range::replace; } // namespace boost; diff --git a/include/boost/range/algorithm/replace_if.hpp b/include/boost/range/algorithm/replace_if.hpp index 93d5a1f..393a4ca 100755 --- a/include/boost/range/algorithm/replace_if.hpp +++ b/include/boost/range/algorithm/replace_if.hpp @@ -36,17 +36,6 @@ inline ForwardRange& return rng; } -/// \overload -template< class ForwardRange, class UnaryPredicate, class Value > -inline const ForwardRange& - replace_if(const ForwardRange& rng, UnaryPredicate pred, - const Value& val) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - std::replace_if(boost::begin(rng), boost::end(rng), pred, val); - return rng; -} - } // namespace range using range::replace_if; } // namespace boost diff --git a/include/boost/range/algorithm/reverse.hpp b/include/boost/range/algorithm/reverse.hpp index 20a7eb1..8741d66 100755 --- a/include/boost/range/algorithm/reverse.hpp +++ b/include/boost/range/algorithm/reverse.hpp @@ -34,15 +34,6 @@ inline BidirectionalRange& reverse(BidirectionalRange& rng) return rng; } -/// \overload -template -inline const BidirectionalRange& reverse(const BidirectionalRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); - std::reverse(boost::begin(rng), boost::end(rng)); - return rng; -} - } // namespace range using range::reverse; } // namespace boost diff --git a/include/boost/range/algorithm/reverse_copy.hpp b/include/boost/range/algorithm/reverse_copy.hpp index 381f157..d86145d 100755 --- a/include/boost/range/algorithm/reverse_copy.hpp +++ b/include/boost/range/algorithm/reverse_copy.hpp @@ -26,15 +26,7 @@ namespace boost /// range-based version of the reverse_copy std algorithm /// /// \pre BidirectionalRange is a model of the BidirectionalRangeConcept -template -inline OutputIterator reverse_copy(BidirectionalRange& rng, OutputIterator out) -{ - BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); - return std::reverse_copy(boost::begin(rng), boost::end(rng), out); -} - -/// \overload -template +template inline OutputIterator reverse_copy(const BidirectionalRange& rng, OutputIterator out) { BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); diff --git a/include/boost/range/algorithm/rotate.hpp b/include/boost/range/algorithm/rotate.hpp index 2372a00..aef6062 100755 --- a/include/boost/range/algorithm/rotate.hpp +++ b/include/boost/range/algorithm/rotate.hpp @@ -25,26 +25,15 @@ namespace boost /// range-based version of the rotate std algorithm /// /// \pre Rng meets the requirements for a Forward range -template +template inline ForwardRange& rotate(ForwardRange& rng, - typename range_iterator::type middle) + BOOST_DEDUCED_TYPENAME range_iterator::type middle) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); std::rotate(boost::begin(rng), middle, boost::end(rng)); return rng; } -/// \overload -template -inline const ForwardRange& - rotate(const ForwardRange& rng, - typename range_iterator::type middle) -{ - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - std::rotate(boost::begin(rng), middle, boost::end(rng)); - return rng; -} - } // namespace range using range::rotate; } // namespace boost diff --git a/include/boost/range/algorithm/rotate_copy.hpp b/include/boost/range/algorithm/rotate_copy.hpp index 9030f73..0409ac5 100755 --- a/include/boost/range/algorithm/rotate_copy.hpp +++ b/include/boost/range/algorithm/rotate_copy.hpp @@ -28,9 +28,9 @@ namespace boost /// \pre Rng meets the requirements for a Forward range template inline OutputIterator rotate_copy( - const ForwardRange& rng, - typename range_iterator::type middle, - OutputIterator target + const ForwardRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type middle, + OutputIterator target ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); diff --git a/include/boost/range/algorithm/search.hpp b/include/boost/range/algorithm/search.hpp index 45d7ade..28cc6e6 100755 --- a/include/boost/range/algorithm/search.hpp +++ b/include/boost/range/algorithm/search.hpp @@ -45,8 +45,8 @@ search(const ForwardRange1& rng1, const ForwardRange2& rng2) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return std::search(boost::begin(rng1),boost::end(rng1), - boost::begin(rng2),boost::end(rng2)); + return std::search(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)); } /// \overload @@ -63,13 +63,12 @@ search(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) /// \overload template< class ForwardRange1, class ForwardRange2, class BinaryPredicate > inline BOOST_DEDUCED_TYPENAME range_iterator::type -search(const ForwardRange1& rng1, const ForwardRange2& rng2, - BinaryPredicate pred) +search(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); - return std::search(boost::begin(rng1),boost::end(rng1), - boost::begin(rng2),boost::end(rng2),pred); + return std::search(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred); } // range_return overloads @@ -118,8 +117,7 @@ search(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) template< range_return_value re, class ForwardRange1, class ForwardRange2, class BinaryPredicate > inline BOOST_DEDUCED_TYPENAME range_return::type -search(const ForwardRange1& rng1, const ForwardRange2& rng2, - BinaryPredicate pred) +search(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); diff --git a/include/boost/range/algorithm/search_n.hpp b/include/boost/range/algorithm/search_n.hpp index cd0340b..2ced140 100755 --- a/include/boost/range/algorithm/search_n.hpp +++ b/include/boost/range/algorithm/search_n.hpp @@ -31,8 +31,8 @@ namespace boost /// \pre Value is a model of the EqualityComparableConcept /// \pre ForwardRange's value type is a model of the EqualityComparableConcept /// \pre Object's of ForwardRange's value type can be compared for equality with Objects of type Value -template< typename ForwardRange, typename Integer, typename Value > -inline typename range_iterator::type +template< class ForwardRange, class Integer, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type search_n(ForwardRange& rng, Integer count, const Value& value) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); @@ -40,8 +40,8 @@ search_n(ForwardRange& rng, Integer count, const Value& value) } /// \overload -template< typename ForwardRange, typename Integer, typename Value > -inline typename range_iterator::type +template< class ForwardRange, class Integer, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type search_n(const ForwardRange& rng, Integer count, const Value& value) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); @@ -49,29 +49,29 @@ search_n(const ForwardRange& rng, Integer count, const Value& value) } /// \overload -template< typename ForwardRange, typename Integer, class Value, - typename BinaryPredicate > -inline typename range_iterator::type +template< class ForwardRange, class Integer, class Value, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type search_n(ForwardRange& rng, Integer count, const Value& value, BinaryPredicate binary_pred) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, const Value&>)); + BOOST_DEDUCED_TYPENAME range_value::type, const Value&>)); return std::search_n(boost::begin(rng), boost::end(rng), count, value, binary_pred); } /// \overload -template< typename ForwardRange, typename Integer, typename Value, - typename BinaryPredicate > -inline typename range_iterator::type +template< class ForwardRange, class Integer, class Value, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type search_n(const ForwardRange& rng, Integer count, const Value& value, BinaryPredicate binary_pred) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, const Value&>)); + BOOST_DEDUCED_TYPENAME range_value::type, const Value&>)); return std::search_n(boost::begin(rng), boost::end(rng), count, value, binary_pred); } @@ -79,9 +79,9 @@ search_n(const ForwardRange& rng, Integer count, const Value& value, // range_return overloads /// \overload -template< range_return_value re, typename ForwardRange, typename Integer, - typename Value > -inline typename range_return::type +template< range_return_value re, class ForwardRange, class Integer, + class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type search_n(ForwardRange& rng, Integer count, const Value& value) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); @@ -92,9 +92,9 @@ search_n(ForwardRange& rng, Integer count, const Value& value) } /// \overload -template< range_return_value re, typename ForwardRange, typename Integer, +template< range_return_value re, class ForwardRange, class Integer, class Value > -inline typename range_return::type +inline BOOST_DEDUCED_TYPENAME range_return::type search_n(const ForwardRange& rng, Integer count, const Value& value) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); @@ -105,15 +105,15 @@ search_n(const ForwardRange& rng, Integer count, const Value& value) } /// \overload -template< range_return_value re, typename ForwardRange, typename Integer, - typename Value, typename BinaryPredicate > -inline typename range_return::type +template< range_return_value re, class ForwardRange, class Integer, + class Value, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type search_n(ForwardRange& rng, Integer count, const Value& value, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, + BOOST_DEDUCED_TYPENAME range_value::type, const Value&>)); return range_return:: pack(std::search_n(boost::begin(rng), boost::end(rng), @@ -122,15 +122,15 @@ search_n(ForwardRange& rng, Integer count, const Value& value, } /// \overload -template< range_return_value re, typename ForwardRange, typename Integer, - typename Value, typename BinaryPredicate > -inline typename range_return::type +template< range_return_value re, class ForwardRange, class Integer, + class Value, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type search_n(const ForwardRange& rng, Integer count, const Value& value, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, + BOOST_DEDUCED_TYPENAME range_value::type, const Value&>)); return range_return:: pack(std::search_n(boost::begin(rng), boost::end(rng), diff --git a/include/boost/range/algorithm/sort.hpp b/include/boost/range/algorithm/sort.hpp index a160907..0c6e3b2 100755 --- a/include/boost/range/algorithm/sort.hpp +++ b/include/boost/range/algorithm/sort.hpp @@ -34,15 +34,6 @@ inline RandomAccessRange& sort(RandomAccessRange& rng) return rng; } -/// \overload -template -inline const RandomAccessRange& sort(const RandomAccessRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::sort(boost::begin(rng),boost::end(rng)); - return rng; -} - /// \overload template inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred) @@ -52,15 +43,6 @@ inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred) return rng; } -/// \overload -template -inline const RandomAccessRange& sort(const RandomAccessRange& rng, BinaryPredicate pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::sort(boost::begin(rng), boost::end(rng), pred); - return rng; -} - } // namespace range using range::sort; } // namespace boost diff --git a/include/boost/range/algorithm/stable_sort.hpp b/include/boost/range/algorithm/stable_sort.hpp index d18da4d..6a27aa4 100755 --- a/include/boost/range/algorithm/stable_sort.hpp +++ b/include/boost/range/algorithm/stable_sort.hpp @@ -34,15 +34,6 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng) return rng; } -/// \overload -template -inline const RandomAccessRange& stable_sort(const RandomAccessRange& rng) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::stable_sort(boost::begin(rng), boost::end(rng)); - return rng; -} - /// \overload template inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate sort_pred) @@ -52,15 +43,6 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate so return rng; } -/// \overload -template -inline const RandomAccessRange& stable_sort(const RandomAccessRange& rng, BinaryPredicate sort_pred) -{ - BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); - std::stable_sort(boost::begin(rng), boost::end(rng), sort_pred); - return rng; -} - } // namespace range using range::stable_sort; } // namespace boost diff --git a/include/boost/range/algorithm/swap_ranges.hpp b/include/boost/range/algorithm/swap_ranges.hpp index 1acee0d..5b8967a 100755 --- a/include/boost/range/algorithm/swap_ranges.hpp +++ b/include/boost/range/algorithm/swap_ranges.hpp @@ -22,7 +22,7 @@ namespace boost { namespace range_detail { - template + template void swap_ranges_impl(Iterator1 it1, Iterator1 last1, Iterator2 it2, Iterator2 last2, single_pass_traversal_tag, @@ -36,7 +36,7 @@ namespace boost } } - template + template void swap_ranges_impl(Iterator1 it1, Iterator1 last1, Iterator2 it2, Iterator2 last2, random_access_traversal_tag, @@ -47,13 +47,13 @@ namespace boost std::swap_ranges(it1, last1, it2); } - template + template void swap_ranges_impl(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2) { swap_ranges_impl(first1, last1, first2, last2, - typename iterator_traversal::type(), - typename iterator_traversal::type()); + BOOST_DEDUCED_TYPENAME iterator_traversal::type(), + BOOST_DEDUCED_TYPENAME iterator_traversal::type()); } } // namespace range_detail @@ -66,7 +66,7 @@ namespace boost /// /// \pre SinglePassRange1 is a model of the SinglePassRangeConcept /// \pre SinglePassRange2 is a model of the SinglePassRangeConcept -template< typename SinglePassRange1, typename SinglePassRange2 > +template< class SinglePassRange1, class SinglePassRange2 > inline SinglePassRange2& swap_ranges(SinglePassRange1& range1, SinglePassRange2& range2) { diff --git a/include/boost/range/algorithm_ext/for_each.hpp b/include/boost/range/algorithm_ext/for_each.hpp index 6a3b35c..a470e2b 100755 --- a/include/boost/range/algorithm_ext/for_each.hpp +++ b/include/boost/range/algorithm_ext/for_each.hpp @@ -19,55 +19,55 @@ namespace boost { - namespace range_detail - { - template - inline Fn2 for_each_impl(InputIterator1 first1, InputIterator1 last1, - InputIterator2 first2, InputIterator2 last2, - Fn2 fn) - { - for (; first1 != last1 && first2 != last2; ++first1, ++first2) - { - fn(*first1, *first2); - } - return fn; - } - } + namespace range_detail + { + template + inline Fn2 for_each_impl(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, + Fn2 fn) + { + for (; first1 != last1 && first2 != last2; ++first1, ++first2) + { + fn(*first1, *first2); + } + return fn; + } + } - namespace range - { - template - inline Fn2 for_each(const SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn) - { - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + namespace range + { + template + inline Fn2 for_each(const SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - return ::boost::range_detail::for_each_impl( + return ::boost::range_detail::for_each_impl( ::boost::begin(rng1), ::boost::end(rng1), ::boost::begin(rng2), ::boost::end(rng2), fn); - } + } - template - inline Fn2 for_each(const SinglePassRange1& rng1, SinglePassRange2& rng2, Fn2 fn) - { - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + template + inline Fn2 for_each(const SinglePassRange1& rng1, SinglePassRange2& rng2, Fn2 fn) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - return ::boost::range_detail::for_each_impl( + return ::boost::range_detail::for_each_impl( ::boost::begin(rng1), ::boost::end(rng1), ::boost::begin(rng2), ::boost::end(rng2), fn); - } + } - template - inline Fn2 for_each(SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn) - { - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + template + inline Fn2 for_each(SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - return ::boost::range_detail::for_each_impl( + return ::boost::range_detail::for_each_impl( ::boost::begin(rng1), ::boost::end(rng1), ::boost::begin(rng2), ::boost::end(rng2), fn); - } + } template inline Fn2 for_each(SinglePassRange1& rng1, SinglePassRange2& rng2, Fn2 fn) @@ -79,8 +79,8 @@ namespace boost ::boost::begin(rng1), ::boost::end(rng1), ::boost::begin(rng2), ::boost::end(rng2), fn); } - } // namespace range - using range::for_each; + } // namespace range + using range::for_each; } // namespace boost #endif // include guard diff --git a/include/boost/range/counting_range.hpp b/include/boost/range/counting_range.hpp index c1ca5ec..bf22f7c 100755 --- a/include/boost/range/counting_range.hpp +++ b/include/boost/range/counting_range.hpp @@ -25,41 +25,41 @@ namespace boost { - template - inline iterator_range > - counting_range(Value first, Value last) - { - typedef counting_iterator counting_iterator_t; - typedef iterator_range result_t; - return result_t(counting_iterator_t(first), - counting_iterator_t(last)); - } + template + inline iterator_range > + counting_range(Value first, Value last) + { + typedef counting_iterator counting_iterator_t; + typedef iterator_range result_t; + return result_t(counting_iterator_t(first), + counting_iterator_t(last)); + } - template - inline iterator_range::type> > - counting_range(const Range& rng) - { - typedef counting_iterator::type> counting_iterator_t; - typedef iterator_range result_t; - return boost::empty(rng) - ? result_t() - : result_t( + template + inline iterator_range::type> > + counting_range(const Range& rng) + { + typedef counting_iterator::type> counting_iterator_t; + typedef iterator_range result_t; + return boost::empty(rng) + ? result_t() + : result_t( counting_iterator_t(*boost::begin(rng)), counting_iterator_t(*boost::prior(boost::end(rng)))); - } + } - template - inline iterator_range::type> > - counting_range(Range& rng) - { - typedef counting_iterator::type> counting_iterator_t; - typedef iterator_range result_t; - return boost::empty(rng) - ? result_t() - : result_t( + template + inline iterator_range::type> > + counting_range(Range& rng) + { + typedef counting_iterator::type> counting_iterator_t; + typedef iterator_range result_t; + return boost::empty(rng) + ? result_t() + : result_t( counting_iterator_t(*boost::begin(rng)), counting_iterator_t(*boost::prior(boost::end(rng)))); - } + } } // namespace boost #if BOOST_MSVC >= 1400 diff --git a/include/boost/range/detail/demote_iterator_traversal_tag.hpp b/include/boost/range/detail/demote_iterator_traversal_tag.hpp index 4351c85..5d77678 100755 --- a/include/boost/range/detail/demote_iterator_traversal_tag.hpp +++ b/include/boost/range/detail/demote_iterator_traversal_tag.hpp @@ -15,8 +15,8 @@ namespace boost { - namespace range_detail - { + namespace range_detail + { template struct demote_iterator_traversal_tag @@ -26,7 +26,7 @@ struct demote_iterator_traversal_tag #define BOOST_DEMOTE_TRAVERSAL_TAG( Tag1, Tag2, ResultTag ) \ template<> struct demote_iterator_traversal_tag< Tag1 , Tag2 > \ { \ - typedef ResultTag type; \ + typedef ResultTag type; \ }; BOOST_DEMOTE_TRAVERSAL_TAG( no_traversal_tag, no_traversal_tag, no_traversal_tag ) @@ -73,7 +73,7 @@ BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, random_access_traversal #undef BOOST_DEMOTE_TRAVERSAL_TAG - } // namespace range_detail + } // namespace range_detail } // namespace boost #endif // include guard diff --git a/include/boost/range/istream_range.hpp b/include/boost/range/istream_range.hpp index fac17a4..f0e9ef4 100755 --- a/include/boost/range/istream_range.hpp +++ b/include/boost/range/istream_range.hpp @@ -16,19 +16,24 @@ */ #include +#include #include -#include +#include namespace boost { - template inline - range > - istream_range(std::basic_istream& in) - { - return range >( - std::istream_iterator(in), - std::istream_iterator()); - } + namespace range + { + template inline + iterator_range > + istream_range(std::basic_istream& in) + { + return iterator_range >( + std::istream_iterator(in), + std::istream_iterator()); + } + } // namespace range + using range::istream_range; } // namespace boost #endif // include guard diff --git a/include/boost/range/join.hpp b/include/boost/range/join.hpp index 374df86..518026c 100644 --- a/include/boost/range/join.hpp +++ b/include/boost/range/join.hpp @@ -21,46 +21,46 @@ namespace boost template iterator_range::type, - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME add_const< - BOOST_DEDUCED_TYPENAME range_value::type>::type> + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME add_const< + BOOST_DEDUCED_TYPENAME range_value::type>::type> > join(const SinglePassRange1& r1, const SinglePassRange2& r2) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - typedef range_detail::join_iterator< - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME add_const< - BOOST_DEDUCED_TYPENAME range_value::type>::type> iterator_t; + typedef range_detail::join_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME add_const< + BOOST_DEDUCED_TYPENAME range_value::type>::type> iterator_t; - return iterator_range( - iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), - iterator_t(r1, r2, range_detail::join_iterator_end_tag())); + return iterator_range( + iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), + iterator_t(r1, r2, range_detail::join_iterator_end_tag())); } template iterator_range::type, - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME range_value::type> + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_value::type> > join(SinglePassRange1& r1, SinglePassRange2& r2) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - typedef range_detail::join_iterator< - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME range_value::type> iterator_t; + typedef range_detail::join_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_value::type> iterator_t; - return iterator_range( - iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), - iterator_t(r1, r2, range_detail::join_iterator_end_tag())); + return iterator_range( + iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), + iterator_t(r1, r2, range_detail::join_iterator_end_tag())); } } // namespace boost diff --git a/include/boost/range/numeric.hpp b/include/boost/range/numeric.hpp index 17e2cfe..0a76151 100755 --- a/include/boost/range/numeric.hpp +++ b/include/boost/range/numeric.hpp @@ -20,7 +20,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #if defined(_MSC_VER) && _MSC_VER >= 1000 - #pragma once + #pragma once #endif #ifndef BOOST_RANGE_NUMERIC_HPP @@ -36,82 +36,82 @@ namespace boost { - template< class SinglePassRange, class Value > - inline Value accumulate( const SinglePassRange& rng, Value init ) - { + template< class SinglePassRange, class Value > + inline Value accumulate( const SinglePassRange& rng, Value init ) + { boost::function_requires< SinglePassRangeConcept >(); - return std::accumulate( boost::begin(rng), boost::end(rng), init ); - } + return std::accumulate( boost::begin(rng), boost::end(rng), init ); + } - template< class SinglePassRange, class Value, class BinaryOperation > - inline Value accumulate( const SinglePassRange& rng, Value init, BinaryOperation op ) - { + template< class SinglePassRange, class Value, class BinaryOperation > + inline Value accumulate( const SinglePassRange& rng, Value init, BinaryOperation op ) + { boost::function_requires< SinglePassRangeConcept >(); - return std::accumulate( boost::begin(rng), boost::end(rng), init, op ); - } + return std::accumulate( boost::begin(rng), boost::end(rng), init, op ); + } - template< class SinglePassRange1, class SinglePassRange2, class Value > - inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, Value init ) - { + template< class SinglePassRange1, class SinglePassRange2, class Value > + inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, Value init ) + { boost::function_requires< SinglePassRangeConcept >(); boost::function_requires< SinglePassRangeConcept >(); BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); - return std::inner_product( boost::begin(rng1), boost::end(rng1), + return std::inner_product( boost::begin(rng1), boost::end(rng1), boost::begin(rng2), init ); - } + } - template< class SinglePassRange1, + template< class SinglePassRange1, class SinglePassRange2, class Value, - class BinaryOperation1, class BinaryOperation2 > - inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, + class BinaryOperation1, class BinaryOperation2 > + inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, Value init, - BinaryOperation1 op1, BinaryOperation2 op2 ) - { + BinaryOperation1 op1, BinaryOperation2 op2 ) + { boost::function_requires< SinglePassRangeConcept >(); boost::function_requires< SinglePassRangeConcept >(); BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); - return std::inner_product( boost::begin(rng1), boost::end(rng1), + return std::inner_product( boost::begin(rng1), boost::end(rng1), boost::begin(rng2), init, op1, op2 ); - } + } - template< class SinglePassRange, class OutputIterator > - inline OutputIterator partial_sum ( const SinglePassRange& rng, - OutputIterator result ) - { + template< class SinglePassRange, class OutputIterator > + inline OutputIterator partial_sum ( const SinglePassRange& rng, + OutputIterator result ) + { boost::function_requires< SinglePassRangeConcept >(); - return std::partial_sum( boost::begin(rng), boost::end(rng), result ); - } + return std::partial_sum( boost::begin(rng), boost::end(rng), result ); + } - template< class SinglePassRange, class OutputIterator, class BinaryOperation > - inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result, - BinaryOperation op ) - { + template< class SinglePassRange, class OutputIterator, class BinaryOperation > + inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result, + BinaryOperation op ) + { boost::function_requires< SinglePassRangeConcept >(); - return std::partial_sum( boost::begin(rng), boost::end(rng), result, op ); - } + return std::partial_sum( boost::begin(rng), boost::end(rng), result, op ); + } - template< class SinglePassRange, class OutputIterator > - inline OutputIterator adjacent_difference ( const SinglePassRange& rng, - OutputIterator result ) - { + template< class SinglePassRange, class OutputIterator > + inline OutputIterator adjacent_difference ( const SinglePassRange& rng, + OutputIterator result ) + { boost::function_requires< SinglePassRangeConcept >(); - return std::adjacent_difference( boost::begin(rng), boost::end(rng), - result ); - } + return std::adjacent_difference( boost::begin(rng), boost::end(rng), + result ); + } - template< class SinglePassRange, class OutputIterator, class BinaryOperation > - inline OutputIterator adjacent_difference ( const SinglePassRange& rng, - OutputIterator result, - BinaryOperation op ) - { + template< class SinglePassRange, class OutputIterator, class BinaryOperation > + inline OutputIterator adjacent_difference ( const SinglePassRange& rng, + OutputIterator result, + BinaryOperation op ) + { boost::function_requires< SinglePassRangeConcept >(); - return std::adjacent_difference( boost::begin(rng), boost::end(rng), - result, op ); - } - + return std::adjacent_difference( boost::begin(rng), boost::end(rng), + result, op ); + } + } #endif diff --git a/include/boost/range/size_type.hpp b/include/boost/range/size_type.hpp index 9993d55..8c184f8 100644 --- a/include/boost/range/size_type.hpp +++ b/include/boost/range/size_type.hpp @@ -68,7 +68,7 @@ namespace boost template< class T > struct range_size - : detail::range_size + : detail::range_size { }; } // namespace boost diff --git a/include/boost/range/unbounded_range.hpp b/include/boost/range/unbounded_range.hpp deleted file mode 100755 index 570a0a4..0000000 --- a/include/boost/range/unbounded_range.hpp +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef BOOST_RANGE_UNBOUNDED_RANGE_HPP -#define BOOST_RANGE_UNBOUNDED_RANGE_HPP - -#include -#include - -namespace boost -{ - template< class Iter > - struct unbounded_iterator_range : iterator_range - { - explicit unbounded_iterator_range( Iter r ) - : iterator_range( r, r ) - { - // - // Remark: by storing the same iterator - // twice, we can still allow - // comparison to execute without leading to - // operations on singular iterators - // - } - - private: - - bool empty() const - { - return false; - } - // - // Hide members that are illegal to use. - // - /* - void end() const; - void size() const; - void empty() const; - void equal() const; - operator bool() const; - bool operator==( unbounded_iterator_range ); - bool operator!=( unbounded_iterator_range ); - template< class S > - void operator[]( S s ) const; - template< class D > - void advance_end( D d ) const; - void back() const; - */ - }; - - template< class Iter > - inline unbounded_iterator_range unbounded_range( Iter r ) - { - return unbounded_iterator_range(r); - } - - namespace detail - { - char is_unbounded_range( ... ); - template< class Iter > - long is_unbounded_range( const unbounded_iterator_range* ); - } - - template< class T > - struct is_unbounded_range - { - private: - static T* ptr_; - - public: - BOOST_STATIC_CONSTANT( bool, - value = sizeof(long) == sizeof(detail::is_unbounded_range(ptr_) ) ); - }; -} - -#endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 97600d5..2b2466f 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -42,6 +42,7 @@ test-suite range : [ range-test adaptor_test/reversed ] [ range-test adaptor_test/sliced ] [ range-test adaptor_test/strided ] + [ range-test adaptor_test/strided2 ] [ range-test adaptor_test/tokenized ] [ range-test adaptor_test/transformed ] [ range-test adaptor_test/uniqued ] @@ -128,11 +129,13 @@ test-suite range : [ range-test counting_range ] [ range-test extension_mechanism ] [ range-test irange ] + [ range-test istream_range ] [ range-test iterator_pair ] [ range-test iterator_range ] # [ range-test mfc : $(VC71_ROOT)/atlmfc/include ] [ range-test join ] [ range-test partial_workaround ] + [ range-test pointer_as_iterator ] [ range-test reversible_range ] [ range-test std_container ] [ range-test string ] diff --git a/test/adaptor_test/adjacent_filtered_example.cpp b/test/adaptor_test/adjacent_filtered_example.cpp index b3538e8..ce132d6 100644 --- a/test/adaptor_test/adjacent_filtered_example.cpp +++ b/test/adaptor_test/adjacent_filtered_example.cpp @@ -55,4 +55,4 @@ init_unit_test_suite(int argc, char* argv[]) test->add( BOOST_TEST_CASE( &adjacent_filtered_example_test ) ); return test; -} \ No newline at end of file +} diff --git a/test/adaptor_test/copied_example.cpp b/test/adaptor_test/copied_example.cpp index f662a45..154a110 100644 --- a/test/adaptor_test/copied_example.cpp +++ b/test/adaptor_test/copied_example.cpp @@ -55,4 +55,4 @@ init_unit_test_suite(int argc, char* argv[]) test->add( BOOST_TEST_CASE( &copied_example_test ) ); return test; -} \ No newline at end of file +} diff --git a/test/adaptor_test/strided2.cpp b/test/adaptor_test/strided2.cpp new file mode 100644 index 0000000..4ac91f5 --- /dev/null +++ b/test/adaptor_test/strided2.cpp @@ -0,0 +1,67 @@ +// Boost.Range library +// +// Copyright Neil Groves 2010. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// + +// This test was added due to a report that the Range Adaptors: +// 1. Caused havoc when using namespace boost::adaptors was used +// 2. Did not work with non-member functions +// 3. The strided adaptor could not be composed with sliced +// +// None of these issues could be reproduced on GCC 4.4, but this +// work makes for useful additional test coverage since this +// uses chaining of adaptors and non-member functions whereas +// most of the tests avoid this use case. + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +namespace boost +{ + namespace + { + int times_two(int x) { return x * 2; } + + void strided_test2() + { + using namespace boost::adaptors; + using namespace boost::assign; + std::vector v; + boost::push_back(v, boost::irange(0,10)); + std::vector z; + boost::push_back(z, v | sliced(2,6) | strided(2) | transformed(×_two)); + std::vector reference; + reference += 4,8; + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + z.begin(), z.end() ); + } + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.adaptor.strided2" ); + + test->add( BOOST_TEST_CASE( &boost::strided_test2 ) ); + + return test; +} diff --git a/test/algorithm_ext_test/push_front.cpp b/test/algorithm_ext_test/push_front.cpp index ebc09a8..a5f5fb9 100644 --- a/test/algorithm_ext_test/push_front.cpp +++ b/test/algorithm_ext_test/push_front.cpp @@ -21,6 +21,15 @@ namespace { + struct DoubleValue + { + template< class Value > + Value operator()(Value x) + { + return x * 2; + } + }; + template< class Container > void test_push_front_impl(std::size_t n) { @@ -34,10 +43,14 @@ namespace BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), test.begin(), test.end() ); - // Do it again to push onto non-empty container - reference.insert(reference.begin(), reference.begin(), reference.end()); + // copy the orignal reference sequence + Container reference_copy(reference); + std::transform(reference.begin(), reference.end(), reference.begin(), DoubleValue()); - boost::push_front(test, boost::irange(0, n)); + // Do it again to push onto non-empty container + reference.insert(reference.end(), reference_copy.begin(), reference_copy.end()); + + boost::push_front(test, boost::irange(0, n * 2, 2)); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), test.begin(), test.end() ); diff --git a/test/algorithm_test/find.cpp b/test/algorithm_test/find.cpp index 6b3d532..fd179f1 100644 --- a/test/algorithm_test/find.cpp +++ b/test/algorithm_test/find.cpp @@ -36,16 +36,16 @@ namespace boost return boost::find(cont, 3); } - template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy&, Container& cont) - { - return boost::find(cont, 3); - } - }; + template + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy&, Container& cont) + { + return boost::find(cont, 3); + } + }; template BOOST_DEDUCED_TYPENAME range_iterator::type diff --git a/test/algorithm_test/find_end.cpp b/test/algorithm_test/find_end.cpp index fb44e52..a126e87 100644 --- a/test/algorithm_test/find_end.cpp +++ b/test/algorithm_test/find_end.cpp @@ -35,7 +35,7 @@ namespace boost { } - container2_t cont() { return m_cont; } + container2_t cont() { return m_cont; } template BOOST_DEDUCED_TYPENAME range_iterator::type @@ -45,14 +45,14 @@ namespace boost } template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::find_end(cont, policy.cont()); - } + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::find_end(cont, policy.cont()); + } }; template @@ -77,8 +77,8 @@ namespace boost { } - container2_t& cont() { return m_cont; } - BinaryPredicate& pred() { return m_pred; } + container2_t& cont() { return m_cont; } + BinaryPredicate& pred() { return m_pred; } template BOOST_DEDUCED_TYPENAME range_iterator::type @@ -88,14 +88,14 @@ namespace boost } template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::find_end(cont, policy.cont(), policy.pred()); - } + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::find_end(cont, policy.cont(), policy.pred()); + } }; template diff --git a/test/algorithm_test/find_first_of.cpp b/test/algorithm_test/find_first_of.cpp index b3d18e2..9ff7adb 100644 --- a/test/algorithm_test/find_first_of.cpp +++ b/test/algorithm_test/find_first_of.cpp @@ -35,7 +35,7 @@ namespace boost { } - container2_t& cont() { return m_cont; } + container2_t& cont() { return m_cont; } template BOOST_DEDUCED_TYPENAME range_iterator::type @@ -45,14 +45,14 @@ namespace boost } template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::find_first_of(cont, policy.cont()); - } + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::find_first_of(cont, policy.cont()); + } }; template @@ -77,8 +77,8 @@ namespace boost { } - container2_t& cont() { return m_cont; } - BinaryPredicate& pred() { return m_pred; } + container2_t& cont() { return m_cont; } + BinaryPredicate& pred() { return m_pred; } template BOOST_DEDUCED_TYPENAME range_iterator::type @@ -88,14 +88,14 @@ namespace boost } template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::find_first_of(cont, policy.cont(), policy.pred()); - } + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::find_first_of(cont, policy.cont(), policy.pred()); + } }; template diff --git a/test/algorithm_test/find_if.cpp b/test/algorithm_test/find_if.cpp index 4ee85a2..a5fe459 100644 --- a/test/algorithm_test/find_if.cpp +++ b/test/algorithm_test/find_if.cpp @@ -41,15 +41,15 @@ namespace boost return boost::find_if(cont, m_pred); } - template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(find_if_test_policy& policy, Container& cont) - { - return boost::find_if(cont, policy.pred()); - } + template + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(find_if_test_policy& policy, Container& cont) + { + return boost::find_if(cont, policy.pred()); + } }; template @@ -59,7 +59,7 @@ namespace boost return std::find_if(cont.begin(), cont.end(), m_pred); } - UnaryPredicate& pred() { return m_pred; } + UnaryPredicate& pred() { return m_pred; } private: UnaryPredicate m_pred; diff --git a/test/algorithm_test/for_each.cpp b/test/algorithm_test/for_each.cpp index 56f2ef5..ac517ad 100644 --- a/test/algorithm_test/for_each.cpp +++ b/test/algorithm_test/for_each.cpp @@ -83,4 +83,4 @@ init_unit_test_suite(int argc, char* argv[]) test->add( BOOST_TEST_CASE( &boost::test_for_each ) ); return test; -} \ No newline at end of file +} diff --git a/test/algorithm_test/lower_bound.cpp b/test/algorithm_test/lower_bound.cpp index 44cc120..ca622bc 100644 --- a/test/algorithm_test/lower_bound.cpp +++ b/test/algorithm_test/lower_bound.cpp @@ -36,16 +36,16 @@ namespace boost return boost::lower_bound(cont, 5); } - template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy&, Container& cont) - { - return boost::lower_bound(cont, 5); - } - }; + template + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy&, Container& cont) + { + return boost::lower_bound(cont, 5); + } + }; template< class Container > BOOST_DEDUCED_TYPENAME range_iterator::type @@ -66,15 +66,15 @@ namespace boost } template< range_return_value return_type > - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::lower_bound( - cont, 5, policy.pred()); - } + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::lower_bound( + cont, 5, policy.pred()); + } }; template @@ -85,10 +85,10 @@ namespace boost cont.begin(), cont.end(), 5, m_pred); } - BinaryPredicate& pred() { return m_pred; } + BinaryPredicate& pred() { return m_pred; } - private: - BinaryPredicate m_pred; + private: + BinaryPredicate m_pred; }; template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy&, Container& cont) - { - return boost::max_element(cont); - } + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy&, Container& cont) + { + return boost::max_element(cont); + } }; template< class Container > @@ -66,17 +66,17 @@ namespace boost return boost::max_element(cont, Pred()); } - Pred pred() const { return Pred(); } + Pred pred() const { return Pred(); } template< range_return_value return_type > - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::max_element(cont, policy.pred()); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::max_element(cont, policy.pred()); + } }; template< class Container > diff --git a/test/algorithm_test/min_element.cpp b/test/algorithm_test/min_element.cpp index 400372d..c68a655 100644 --- a/test/algorithm_test/min_element.cpp +++ b/test/algorithm_test/min_element.cpp @@ -37,14 +37,14 @@ namespace boost } template< range_return_value return_type > - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy&, Container& cont) - { - return boost::min_element(cont); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy&, Container& cont) + { + return boost::min_element(cont); + } }; template< class Container > @@ -66,17 +66,17 @@ namespace boost return boost::min_element(cont, Pred()); } - Pred pred() const { return Pred(); } + Pred pred() const { return Pred(); } template< range_return_value return_type > - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::min_element(cont, policy.pred()); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::min_element(cont, policy.pred()); + } }; template< class Container > diff --git a/test/algorithm_test/partition.cpp b/test/algorithm_test/partition.cpp index e71c9a7..3f0ce61 100644 --- a/test/algorithm_test/partition.cpp +++ b/test/algorithm_test/partition.cpp @@ -44,17 +44,17 @@ namespace boost return boost::partition(cont, UnaryPredicate()); } - UnaryPredicate pred() const { return UnaryPredicate(); } + UnaryPredicate pred() const { return UnaryPredicate(); } template< range_return_value return_type > - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::partition(cont, policy.pred()); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::partition(cont, policy.pred()); + } }; template< class Container > diff --git a/test/algorithm_test/stable_partition.cpp b/test/algorithm_test/stable_partition.cpp index 99db6be..fad4bef 100644 --- a/test/algorithm_test/stable_partition.cpp +++ b/test/algorithm_test/stable_partition.cpp @@ -44,17 +44,17 @@ namespace boost return boost::stable_partition(cont, UnaryPredicate()); } - UnaryPredicate pred() const { return UnaryPredicate(); } + UnaryPredicate pred() const { return UnaryPredicate(); } template< range_return_value return_type > - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::stable_partition(cont, policy.pred()); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::stable_partition(cont, policy.pred()); + } }; template< class Container > diff --git a/test/algorithm_test/unique.cpp b/test/algorithm_test/unique.cpp index f5d75cf..2e2ebfa 100644 --- a/test/algorithm_test/unique.cpp +++ b/test/algorithm_test/unique.cpp @@ -41,14 +41,14 @@ namespace boost } template< range_return_value return_type > - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy&, Container& cont) - { - return boost::unique(cont); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy&, Container& cont) + { + return boost::unique(cont); + } }; template< class Container > @@ -73,17 +73,17 @@ namespace boost return std::unique(cont.begin(), cont.end(), Pred()); } - Pred pred() const { return Pred(); } + Pred pred() const { return Pred(); } template< range_return_value return_type > - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::unique(cont, policy.pred()); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::unique(cont, policy.pred()); + } }; template< class Container > diff --git a/test/algorithm_test/upper_bound.cpp b/test/algorithm_test/upper_bound.cpp index 3df7164..2eb64cf 100644 --- a/test/algorithm_test/upper_bound.cpp +++ b/test/algorithm_test/upper_bound.cpp @@ -35,16 +35,16 @@ namespace boost return boost::upper_bound(cont, 5); } - template - struct test_range - { - template - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy&, Container& cont) - { - return boost::upper_bound(cont, 5); - } - }; + template + struct test_range + { + template + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy&, Container& cont) + { + return boost::upper_bound(cont, 5); + } + }; template< class Container > BOOST_DEDUCED_TYPENAME range_iterator::type @@ -65,15 +65,15 @@ namespace boost } template< range_return_value result_type> - struct test_range - { - template< class Container, class Policy > - BOOST_DEDUCED_TYPENAME range_return::type - operator()(Policy& policy, Container& cont) - { - return boost::upper_bound( - cont, 5, policy.pred()); - } + struct test_range + { + template< class Container, class Policy > + BOOST_DEDUCED_TYPENAME range_return::type + operator()(Policy& policy, Container& cont) + { + return boost::upper_bound( + cont, 5, policy.pred()); + } }; template @@ -83,11 +83,11 @@ namespace boost return std::upper_bound( cont.begin(), cont.end(), 5, BinaryPredicate()); } - - BinaryPredicate& pred() { return m_pred; } - - private: - BinaryPredicate m_pred; + + BinaryPredicate& pred() { return m_pred; } + + private: + BinaryPredicate m_pred; }; templateadd( BOOST_TEST_CASE( &boost::counting_range_test ) ); return test; -} \ No newline at end of file +} diff --git a/test/istream_range.cpp b/test/istream_range.cpp new file mode 100644 index 0000000..b3e16db --- /dev/null +++ b/test/istream_range.cpp @@ -0,0 +1,51 @@ +// Boost.Range library +// +// Copyright Neil Groves 2010. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#include +#include +#include +#include +#include +#include +#include +#include + +namespace +{ + // Test an integer range with a step size of 1. + void test_istream_range() + { + std::stringstream s; + std::vector reference; + for (int i = 0; i < 10; ++i) + { + reference.push_back(i); + s << i << " "; + } + + std::vector target; + boost::push_back(target, boost::range::istream_range(s)); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target.begin(), target.end() ); + } + +} // namespace anonymous namespace + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.istream_range" ); + + test->add(BOOST_TEST_CASE( &test_istream_range )); + + return test; +} diff --git a/test/iterator_range.cpp b/test/iterator_range.cpp index cf22463..7c53a8b 100644 --- a/test/iterator_range.cpp +++ b/test/iterator_range.cpp @@ -61,7 +61,7 @@ void check_iterator_range() BOOST_CHECK_EQUAL( r2.size(), size( r2 ) ); BOOST_CHECK_EQUAL( std::distance( r.begin(), r.end() ), - std::distance( boost::begin( r2 ), boost::end( r2 ) ) ); + std::distance( boost::begin( r2 ), boost::end( r2 ) ) ); std::cout << r << r2; diff --git a/test/pointer_as_iterator.cpp b/test/pointer_as_iterator.cpp new file mode 100644 index 0000000..e0e28d0 --- /dev/null +++ b/test/pointer_as_iterator.cpp @@ -0,0 +1,39 @@ +// Boost.Range library +// +// Copyright Neil Groves 2010. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#include +#include +#include +#include +#include +#include +#include +#include + +namespace +{ + void test_pointer_as_iterator() + { + boost::array arr; + boost::iterator_range r(arr.begin(), arr.end()); + r[0]; + } +} // anonymous namespace + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.pointer_as_iterator" ); + + test->add(BOOST_TEST_CASE( &test_pointer_as_iterator )); + + return test; +} diff --git a/test/test_driver/range_return_test_driver.hpp b/test/test_driver/range_return_test_driver.hpp index 6f4fc3b..eb52474 100644 --- a/test/test_driver/range_return_test_driver.hpp +++ b/test/test_driver/range_return_test_driver.hpp @@ -379,25 +379,25 @@ namespace boost range_result, reference_it); } - template< range_return_value result_type, class Container, class TestPolicy > - struct test_range - { - void operator()(Container& cont, TestPolicy policy) - { - typedef BOOST_DEDUCED_TYPENAME range_iterator::type iterator_t; - typedef BOOST_DEDUCED_TYPENAME range_return::type range_return_t; - typedef BOOST_DEDUCED_TYPENAME TestPolicy::template test_range test_range_t; + template< range_return_value result_type, class Container, class TestPolicy > + struct test_range + { + void operator()(Container& cont, TestPolicy policy) + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iterator_t; + typedef BOOST_DEDUCED_TYPENAME range_return::type range_return_t; + typedef BOOST_DEDUCED_TYPENAME TestPolicy::template test_range test_range_t; - Container reference(cont); - Container test_cont(cont); + Container reference(cont); + Container test_cont(cont); - range_return_t range_result = test_range_t()(policy, test_cont); - iterator_t reference_it = policy.reference(reference); + range_return_t range_result = test_range_t()(policy, test_cont); + iterator_t reference_it = policy.reference(reference); - check_results::check(test_cont, reference, + check_results::check(test_cont, reference, range_result, reference_it); - } - }; + } + }; }; } }