diff --git a/doc/history_ack.qbk b/doc/history_ack.qbk index 545b3ab..73ce9e8 100644 --- a/doc/history_ack.qbk +++ b/doc/history_ack.qbk @@ -26,11 +26,18 @@ the result of a merge of all of the RangeEx features into Boost.Range. There were an enormous number of very significant contributors through all stages of this library. +Prior to Boost.RangeEx there had been a number of Range library implementations, +these include library implementations by Eric Niebler, Adobe, +Shunsuke Sogame etc. Eric Niebler contributed the Range Adaptor idea which is +arguably the single biggest innovation in this library. Inevitably a great deal +of commonality evolved in each of these libraries, but a considerable amount +of effort was expended to learn from all of the divergent techniques. + The people in the following list all made contributions in the form of reviews, user feedback, design suggestions, or defect detection: * Thorsten Ottosen: review management, design advice, documentation feedback -* Eric Niebler: feedback +* Eric Niebler: early implementation, and review feedback * Joel de Guzman: review * Mathias Gaunard: review * David Abrahams: implementation advice diff --git a/doc/html/index.html b/doc/html/index.html index f6095bd..90355b6 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -2,8 +2,8 @@ Chapter 1. Range 2.0 - - + + @@ -11,14 +11,14 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-
Next
-
+
Next
+

Chapter 1. Range 2.0

@@ -29,8 +29,8 @@ Neil Groves
-
-

+

+

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)

@@ -142,10 +142,10 @@

- +

Last revised: April 28, 2010 at 17:51:33 GMT

Last revised: July 17, 2010 at 19:34:42 GMT


-
Next
+
Next
diff --git a/doc/html/range/concepts.html b/doc/html/range/concepts.html index c384122..b071de6 100644 --- a/doc/html/range/concepts.html +++ b/doc/html/range/concepts.html @@ -2,8 +2,8 @@ Range Concepts - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -45,7 +45,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/concepts/bidirectional_range.html b/doc/html/range/concepts/bidirectional_range.html index 72c8c28..a8decd6 100644 --- a/doc/html/range/concepts/bidirectional_range.html +++ b/doc/html/range/concepts/bidirectional_range.html @@ -2,8 +2,8 @@ Bidirectional Range - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -294,7 +294,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/concepts/concept_checking.html b/doc/html/range/concepts/concept_checking.html index 30d3850..ca397ff 100644 --- a/doc/html/range/concepts/concept_checking.html +++ b/doc/html/range/concepts/concept_checking.html @@ -2,8 +2,8 @@ Concept Checking - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -62,24 +62,24 @@

- + See also

@@ -102,7 +102,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/concepts/forward_range.html b/doc/html/range/concepts/forward_range.html index 61ec9e8..1910a37 100644 --- a/doc/html/range/concepts/forward_range.html +++ b/doc/html/range/concepts/forward_range.html @@ -2,8 +2,8 @@ Forward Range - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -154,7 +154,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/concepts/overview.html b/doc/html/range/concepts/overview.html index 7cd19e8..0fa9643 100644 --- a/doc/html/range/concepts/overview.html +++ b/doc/html/range/concepts/overview.html @@ -2,8 +2,8 @@ Overview - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -41,11 +41,11 @@

  • - own the elements that can be accessed through it, -
  • + own the elements that can be accessed through it, +
  • - have copy semantics, -
  • + have copy semantics, +

Because of the second requirement, a Range object must be passed by (const @@ -73,7 +73,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/concepts/random_access_range.html b/doc/html/range/concepts/random_access_range.html index 379410e..05cbdc0 100644 --- a/doc/html/range/concepts/random_access_range.html +++ b/doc/html/range/concepts/random_access_range.html @@ -2,8 +2,8 @@ Random Access Range - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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
@@ -181,7 +181,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/concepts/single_pass_range.html b/doc/html/range/concepts/single_pass_range.html index 32bcef4..a2372ac 100644 --- a/doc/html/range/concepts/single_pass_range.html +++ b/doc/html/range/concepts/single_pass_range.html @@ -2,8 +2,8 @@ Single Pass Range - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -344,7 +344,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/examples.html b/doc/html/range/examples.html index 4be5b97..14aad79 100644 --- a/doc/html/range/examples.html +++ b/doc/html/range/examples.html @@ -2,8 +2,8 @@ Examples - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -31,19 +31,31 @@

@@ -56,7 +68,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/faq.html b/doc/html/range/faq.html index cb21529..6a689f1 100644 --- a/doc/html/range/faq.html +++ b/doc/html/range/faq.html @@ -2,8 +2,8 @@ FAQ - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

FAQ

@@ -31,84 +31,47 @@ and range_const_iterator<C>::type for std::pair<iterator, iterator>?

-
-

-

-

- In general it is not possible nor desirable to find a corresponding const_iterator. When it is possible to - come up with one, the client might choose to construct a std::pair<const_iterator,const_iterator> - object. -

-

-

-
-
-

-

-

- Note that an iterator_range is somewhat more - convenient than a pair - and that a sub_range does propagate const-ness. -

-

-

-
+

+ In general it is not possible nor desirable to find a corresponding const_iterator. When it is possible to + come up with one, the client might choose to construct a std::pair<const_iterator,const_iterator> object. +

+

+ Note that an iterator_range is somewhat more + convenient than a pair and + that a sub_range does propagate const-ness. +

2. Why is there not supplied more types or more functions?

-
-

-

-

- The library has been kept small because its current interface will serve - most purposes. If and when a genuine need arises for more functionality, - it can be implemented. -

-

-

-
+

+ The library has been kept small because its current interface will serve + most purposes. If and when a genuine need arises for more functionality, + it can be implemented. +

3. How should I implement generic algorithms for ranges?

-
-

-

-

- One should always start with a generic algorithm that takes two iterators - (or more) as input. Then use Boost.Range to build handier versions on top - of the iterator based algorithm. Please notice that once the range version - of the algorithm is done, it makes sense not to expose the iterator version - in the public interface. -

-

-

-
+

+ One should always start with a generic algorithm that takes two iterators + (or more) as input. Then use Boost.Range to build handier versions on top + of the iterator based algorithm. Please notice that once the range version + of the algorithm is done, it makes sense not to expose the iterator version + in the public interface. +

4. Why is there no Incrementable Range concept?

-
-

-

-

- Even though we speak of incrementable iterators, it would not make much - sense for ranges; for example, we cannot determine the size and emptiness - of a range since we cannot even compare its iterators. -

-

-

-
-
-

-

-

- Note also that incrementable iterators are derived from output iterators - and so there exist no output range. -

-

-

-
+

+ Even though we speak of incrementable iterators, it would not make much sense + for ranges; for example, we cannot determine the size and emptiness of a + range since we cannot even compare its iterators. +

+

+ Note also that incrementable iterators are derived from output iterators + and so there exist no output range. +

@@ -120,7 +83,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/history_ack.html b/doc/html/range/history_ack.html index 37d497d..66191b9 100644 --- a/doc/html/range/history_ack.html +++ b/doc/html/range/history_ack.html @@ -2,8 +2,8 @@ History and Acknowledgement - - + + @@ -12,21 +12,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHome +PrevUpHome
-
+

- + Version 1 - before Boost 1.43

@@ -60,26 +60,26 @@

  • - Pavol Droba for help with documentation and implementation -
  • + Pavol Droba for help with documentation and implementation +
  • - Pavel Vozenilek for help with porting the library -
  • + Pavel Vozenilek for help with porting the library +
  • - Jonathan Turkanis and John Torjo for help with documentation -
  • + Jonathan Turkanis and John Torjo for help with documentation +
  • - Hartmut Kaiser for being review manager -
  • + Hartmut Kaiser for being review manager +
  • - Jonathan Turkanis for porting the lib (as far sa possible) to vc6 and vc7. -
  • + Jonathan Turkanis for porting the lib (as far sa possible) to vc6 and vc7. +

The concept checks and their documentation was provided by Daniel Walker.

- + Version 2 - Boost 1.43 and beyond

@@ -91,41 +91,49 @@ There were an enormous number of very significant contributors through all stages of this library.

+

+ Prior to Boost.RangeEx there had been a number of Range library implementations, + these include library implementations by Eric Niebler, Adobe, Shunsuke Sogame + etc. Eric Niebler contributed the Range Adaptor idea which is arguably the + single biggest innovation in this library. Inevitably a great deal of commonality + evolved in each of these libraries, but a considerable amount of effort was + expended to learn from all of the divergent techniques. +

The people in the following list all made contributions in the form of reviews, user feedback, design suggestions, or defect detection:

  • - Thorsten Ottosen: review management, design advice, documentation feedback -
  • + Thorsten Ottosen: review management, design advice, documentation feedback +
  • - Eric Niebler: feedback -
  • + Eric Niebler: early implementation, and review feedback +
  • - Joel de Guzman: review -
  • + Joel de Guzman: review +
  • - Mathias Gaunard: review -
  • + Mathias Gaunard: review +
  • - David Abrahams: implementation advice -
  • + David Abrahams: implementation advice +
  • - Robert Jones: defect reports, usage feedback -
  • + Robert Jones: defect reports, usage feedback +
  • - Sean Parent: contributed experience from the Adobe range library -
  • + Sean Parent: contributed experience from the Adobe range library +
  • - Arno Schoedl: implementations, and review -
  • + Arno Schoedl: implementations, and review +
  • - Rogier van Dalen: review -
  • + Rogier van Dalen: review +
  • - Vincente Botet: review, documentation feedback -
  • + Vincente Botet: review, documentation feedback +

Regardless of how I write this section it will never truly fairly capture the @@ -142,7 +150,7 @@


-PrevUpHome +PrevUpHome
diff --git a/doc/html/range/introduction.html b/doc/html/range/introduction.html index 7bedc97..5ea6f50 100644 --- a/doc/html/range/introduction.html +++ b/doc/html/range/introduction.html @@ -2,8 +2,8 @@ Introduction - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -59,83 +59,58 @@

  • - simpler implementation and specification of generic range algorithms -
  • + simpler implementation and specification of generic range algorithms +
  • - more flexible, compact and maintainable client code -
  • + more flexible, compact and maintainable client code +
  • - safe use of built-in arrays (for legacy code; why else would you use built-in - arrays?) -
  • + safe use of built-in arrays (for legacy code; why else would you use built-in + arrays?) +
-

- Below are given a small example (the complete example can be found here - ): -

+

+ + Example + - Iterate over the values in a map +

-
//
-// example: extracting bounds in a generic algorithm
-//
-template< class ForwardReadableRange, class T >
-inline typename boost::range_iterator< ForwardReadableRange >::type
-find( ForwardReadableRange& c, const T& value )
-{
-   return std::find( boost::begin( c ), boost::end( c ), value );
-}
-
-template< class ForwardReadableRange, class T >
-inline typename boost::range_iterator< const ForwardReadableRange >::type
-find( const ForwardReadableRange& c, const T& value )
-{
-   return std::find( boost::begin( c ), boost::end( c ), value );
-}
-
-//
-// replace first value and return its index
-//
-template< class ForwardReadableWriteableRange, class T >
-inline typename boost::range_size< ForwardReadableWriteableRange >::type
-my_generic_replace( ForwardReadableWriteableRange& c, const T& value, const T& replacement )
-{
-   typename boost::range_iterator< ForwardReadableWriteableRange >::type found = find( c, value );
-
-   if( found != boost::end( c ) )
-       *found = replacement;
-   return std::distance( boost::begin( c ), found );
-}
-
-//
-// usage
-//
-const int N = 5;
-std::vector<int> my_vector;
-int values[] = { 1,2,3,4,5,6,7,8,9 };
-
-my_vector.assign( values, boost::end( values ) );
-typedef std::vector<int>::iterator iterator;
-std::pair<iterator,iterator>       my_view( boost::begin( my_vector ),
-                                            boost::begin( my_vector ) + N );
-char  str_val[] = "a string";
-char* str       = str_val;
-
-std::cout << my_generic_replace( my_vector, 4, 2 );
-std::cout << my_generic_replace( my_view, 4, 2 );
-std::cout << my_generic_replace( str, 'a', 'b' );
-
-// prints '3', '5' and '0'
-
+
using namespace boost;
+using namespace boost::adaptors;
+for_each( my_map | map_values, fn );
+

+

+ + Example + - Iterate over the keys in a map +

+

+ +

+
using namespace boost;
+using namespace boost::adaptors;
+for_each( my_map | map_keys, fn );
+
+

+

+

+ + Example + - Push the even values from a map in reverse order into the container target +

+

+ +

+
using namespace boost;
+using namespace boost::adaptors;
+// Assume that is_even is a predicate that has been implemented elsewhere...
+push_back(target, my_map | map_values | filtered(is_even()) | reversed);
+

- By using the free-standing functions and metafunctions, - the code automatically works for all the types supported by this library; now - and in the future. Notice that we have to provide two versions of find() since - we cannot forward a non-const rvalue with reference arguments (see this article - about The - Forwarding Problem ).

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

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/library_headers.html b/doc/html/range/library_headers.html index 0e06413..93a048f 100644 --- a/doc/html/range/library_headers.html +++ b/doc/html/range/library_headers.html @@ -2,8 +2,8 @@ Library Headers - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -44,7 +44,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/library_headers/adaptors.html b/doc/html/range/library_headers/adaptors.html index f8810a4..d6948ea 100644 --- a/doc/html/range/library_headers/adaptors.html +++ b/doc/html/range/library_headers/adaptors.html @@ -2,8 +2,8 @@ Adaptors - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -226,7 +226,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/library_headers/algorithm.html b/doc/html/range/library_headers/algorithm.html index 6beb47e..cab83e7 100644 --- a/doc/html/range/library_headers/algorithm.html +++ b/doc/html/range/library_headers/algorithm.html @@ -2,8 +2,8 @@ Algorithm - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -677,7 +677,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/library_headers/algorithm_extensions.html b/doc/html/range/library_headers/algorithm_extensions.html index f3dd061..7a4db8f 100644 --- a/doc/html/range/library_headers/algorithm_extensions.html +++ b/doc/html/range/library_headers/algorithm_extensions.html @@ -2,8 +2,8 @@ Algorithm Extensions - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Algorithm Extensions @@ -166,7 +166,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/library_headers/general.html b/doc/html/range/library_headers/general.html index 558fe74..5996f99 100644 --- a/doc/html/range/library_headers/general.html +++ b/doc/html/range/library_headers/general.html @@ -2,8 +2,8 @@ General - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -545,7 +545,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/mfc_atl.html b/doc/html/range/mfc_atl.html index c0f1c6d..72221f9 100644 --- a/doc/html/range/mfc_atl.html +++ b/doc/html/range/mfc_atl.html @@ -2,8 +2,8 @@ MFC/ATL (courtesy of Shunsuke Sogame) - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Introduction

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

- + Overview

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/mfc_atl/atl_ranges.html b/doc/html/range/mfc_atl/atl_ranges.html index 65ee355..6c96f33 100644 --- a/doc/html/range/mfc_atl/atl_ranges.html +++ b/doc/html/range/mfc_atl/atl_ranges.html @@ -2,8 +2,8 @@ ATL Ranges - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -368,7 +368,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/mfc_atl/const_ranges.html b/doc/html/range/mfc_atl/const_ranges.html index 2e047f6..cf41223 100644 --- a/doc/html/range/mfc_atl/const_ranges.html +++ b/doc/html/range/mfc_atl/const_ranges.html @@ -2,8 +2,8 @@ const Ranges - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -119,7 +119,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/mfc_atl/mfc_ranges.html b/doc/html/range/mfc_atl/mfc_ranges.html index af0c6e9..57655a2 100644 --- a/doc/html/range/mfc_atl/mfc_ranges.html +++ b/doc/html/range/mfc_atl/mfc_ranges.html @@ -2,8 +2,8 @@ MFC Ranges - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -474,7 +474,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/mfc_atl/references.html b/doc/html/range/mfc_atl/references.html index 124a538..1d0a7a4 100644 --- a/doc/html/range/mfc_atl/references.html +++ b/doc/html/range/mfc_atl/references.html @@ -2,8 +2,8 @@ References - - + + @@ -13,25 +13,31 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+ @@ -44,7 +50,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/mfc_atl/requirements.html b/doc/html/range/mfc_atl/requirements.html index 131433f..8c0a80a 100644 --- a/doc/html/range/mfc_atl/requirements.html +++ b/doc/html/range/mfc_atl/requirements.html @@ -2,8 +2,8 @@ Requirements - - + + @@ -13,26 +13,26 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
  • - Boost C++ Libraries Version 1.34.0 or later (no compilation required) -
  • + Boost C++ Libraries Version 1.34.0 or later (no compilation required) +
  • - Visual C++ 7.1 or later (for MFC and ATL) -
  • + Visual C++ 7.1 or later (for MFC and ATL) +
@@ -45,7 +45,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/portability.html b/doc/html/range/portability.html index 45d3a07..e2afd81 100644 --- a/doc/html/range/portability.html +++ b/doc/html/range/portability.html @@ -2,8 +2,8 @@ Portability - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -47,32 +47,32 @@

  1. - do not use built-in arrays, -
  2. + do not use built-in arrays, +
  3. - do not pass rvalues to begin(), - end() - and iterator_range Range constructors - and assignment operators, -
  4. + do not pass rvalues to begin(), + end() + and iterator_range Range constructors + and assignment operators, +
  5. - use const_begin() - and const_end() - whenever your code by intention is read-only; this will also solve most rvalue - problems, -
  6. + use const_begin() + and const_end() + whenever your code by intention is read-only; this will also solve most + rvalue problems, +
  7. - do not rely on ADL: -
      + do not rely on ADL: +
      • - if you overload functions, include that header before the headers in - this library, -
      • + if you overload functions, include that header before the headers + in this library, +
      • - put all overloads in namespace boost. -
      • + put all overloads in namespace boost. +
      - +
@@ -85,7 +85,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference.html b/doc/html/range/reference.html index cbff24d..9b31bb4 100644 --- a/doc/html/range/reference.html +++ b/doc/html/range/reference.html @@ -2,8 +2,8 @@ Reference - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -89,7 +89,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors.html b/doc/html/range/reference/adaptors.html index b649558..59564f9 100644 --- a/doc/html/range/reference/adaptors.html +++ b/doc/html/range/reference/adaptors.html @@ -2,8 +2,8 @@ Range Adaptors - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -44,7 +44,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/adaptors_reference.html b/doc/html/range/reference/adaptors/adaptors_reference.html deleted file mode 100644 index d284888..0000000 --- a/doc/html/range/reference/adaptors/adaptors_reference.html +++ /dev/null @@ -1,75 +0,0 @@ - - - -Reference - - - - - - - - - - - - - - - -
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
-
-
-PrevUpHomeNext -
- - - - -
-
-
-PrevUpHomeNext -
- - diff --git a/doc/html/range/reference/adaptors/general_requirements.html b/doc/html/range/reference/adaptors/general_requirements.html index 63abc37..83d19c0 100644 --- a/doc/html/range/reference/adaptors/general_requirements.html +++ b/doc/html/range/reference/adaptors/general_requirements.html @@ -2,8 +2,8 @@ General Requirements - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

General Requirements @@ -33,40 +33,40 @@

  • -fwdRng is an expression - of a type R that models - ForwardRange -
  • + fwdRng is an expression + of a type R that models + ForwardRange +
  • -biRng is an expression - of a type R that models - BidirectionalRange -
  • + biRng is an expression + of a type R that models + BidirectionalRange +
  • -rndRng is an expression - of a type R that models - RandomAccessRange -
  • + rndRng is an expression + of a type R that models + RandomAccessRange +
  • -pred is an expression - of a type that models UnaryPredicate -
  • + pred is an expression + of a type that models UnaryPredicate +
  • -bi_pred is an expression - of a type that models BinaryPredicate -
  • + bi_pred is an expression + of a type that models BinaryPredicate +
  • -fun is an expression - of a type that models UnaryFunction -
  • + fun is an expression + of a type that models UnaryFunction +
  • -value, new_value and old_value - are objects convertible to boost::range_value<R>::type -
  • + value, new_value and old_value + are objects convertible to boost::range_value<R>::type +
  • -n,m are integer expressions convertible - to range_difference<R>::type -
  • + n,m are integer expressions convertible + to range_difference<R>::type +

Also note that boost::range_value<R>::type must be implicitly convertible to @@ -135,7 +135,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/introduction.html b/doc/html/range/reference/adaptors/introduction.html index 1982491..bdf55ce 100644 --- a/doc/html/range/reference/adaptors/introduction.html +++ b/doc/html/range/reference/adaptors/introduction.html @@ -2,8 +2,8 @@ Introduction and motivation - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Introduction and motivation @@ -122,7 +122,7 @@ situations, you will really appreciate the succinctness of operator|().

- + Composition of Adaptors
@@ -132,8 +132,14 @@ to algorithms. For example, consider these Range algorithms:

    -
  • boost::copy( rng, out )
  • -
  • boost::count( rng, pred )
  • +
  • + boost::copy( rng, out ) +
  • +
  • + boost::count( + rng, + pred ) +

What should we do if we only want to copy an element a @@ -142,13 +148,17 @@ The naive answer would be to use these algorithms:

    -
  • boost::copy_if( - rng, - pred, - out )
  • -
  • boost::count_if( - rng, - pred )
  • +
  • + boost::copy_if( + rng, + pred, + out ) +
  • +
  • + boost::count_if( + rng, + pred ) +

These algorithms are only defined to maintain a one to one relationship @@ -159,7 +169,7 @@ is the design solution to this problem.

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

- + Range Adaptor alternative to count_if algorithm
@@ -268,7 +278,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference.html b/doc/html/range/reference/adaptors/reference.html index a76fbcb..b026090 100644 --- a/doc/html/range/reference/adaptors/reference.html +++ b/doc/html/range/reference/adaptors/reference.html @@ -2,8 +2,8 @@ Reference - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -57,7 +57,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/adjacent_filtered.html b/doc/html/range/reference/adaptors/reference/adjacent_filtered.html index c6d4404..31128ea 100644 --- a/doc/html/range/reference/adaptors/reference/adjacent_filtered.html +++ b/doc/html/range/reference/adaptors/reference/adjacent_filtered.html @@ -2,8 +2,8 @@ adjacent_filtered - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
adjacent_filtered @@ -77,29 +77,30 @@
  • -Precondition: The value_type - of the range is convertible to both argument types of bi_pred. -
  • + Precondition: The value_type of the range is convertible + to both argument types of bi_pred. +
  • -Postcondition: For all adjacent elements - [x,y] in the returned range, bi_pred(x,y) - is true. -
  • + Postcondition: For all adjacent + elements [x,y] in the returned range, bi_pred(x,y) + is true. +
  • -Throws: Whatever the copy constructor - of bi_pred might throw. -
  • + Throws: Whatever the copy constructor + of bi_pred might + throw. +
  • -Range Category:Single - Pass Range -
  • + Range Category: Single + Pass Range +
  • -Returned Range Category: The minimum - of the range category of rng - and Forward Range -
  • + Returned Range Category: The minimum + of the range category of rng + and Forward Range +
-
+
adjacent_filtered example @@ -151,7 +152,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/copied.html b/doc/html/range/reference/adaptors/reference/copied.html index 24b72f1..b690eba 100644 --- a/doc/html/range/reference/adaptors/reference/copied.html +++ b/doc/html/range/reference/adaptors/reference/copied.html @@ -2,8 +2,8 @@ copied - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -78,28 +78,28 @@
  • -Precondition:0 - <= n - && n - <= m - && m - < distance(rng) -
  • + Precondition: 0 + <= n + && n + <= m + && m + < distance(rng) +
  • -Returns: A new iterator_range - that holds the sliced range [n,m) - of the original range. -
  • + Returns: A new iterator_range + that holds the sliced range [n,m) + of the original range. +
  • -Range Category:Random - Access Range -
  • + Range Category: Random + Access Range +
  • -Returned Range Category:Random - Access Range -
  • + Returned Range Category: Random + Access Range +
-
+
copied example @@ -150,7 +150,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/filtered.html b/doc/html/range/reference/adaptors/reference/filtered.html index 6ce9f3c..1d21ce0 100644 --- a/doc/html/range/reference/adaptors/reference/filtered.html +++ b/doc/html/range/reference/adaptors/reference/filtered.html @@ -2,8 +2,8 @@ filtered - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -76,30 +76,30 @@
  • -Precondition: The value_type - of the range is convertible to the argument type of pred. -
  • + Precondition: The value_type of the range is convertible + to the argument type of pred. +
  • -Postcondition: For all adjacent elements - [x] in the returned range, pred(x) - is true. -
  • + Postcondition: For all adjacent + elements [x] in the returned range, pred(x) + is true. +
  • -Throws: Whatever the copy constructor - of pred might throw. -
  • + Throws: Whatever the copy constructor + of pred might throw. +
  • -Range Category:Forward - Range -
  • + Range Category: Forward + Range +
  • -Returned Range Category: The minimum - of the range category of rng - and Bidirectional - Range -
  • + Returned Range Category: The minimum + of the range category of rng + and Bidirectional + Range +
-
+
filtered example @@ -153,7 +153,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/indexed.html b/doc/html/range/reference/adaptors/reference/indexed.html index 3ef95df..45bcbef 100644 --- a/doc/html/range/reference/adaptors/reference/indexed.html +++ b/doc/html/range/reference/adaptors/reference/indexed.html @@ -2,8 +2,8 @@ indexed - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -75,23 +75,23 @@
  • -Returns: A range adapted to return - both the element and the associated index. The returned range consists - of iterators that have in addition to the usual iterator member functions - an index() - member function that returns the appropriate index for the element - in the sequence corresponding with the iterator. -
  • + Returns: A range adapted to return + both the element and the associated index. The returned range consists + of iterators that have in addition to the usual iterator member functions + an index() + member function that returns the appropriate index for the element + in the sequence corresponding with the iterator. +
  • -Range Category:Single - Pass Range -
  • + Range Category: Single + Pass Range +
  • -Returned Range Category: The range - category of rng -
  • + Returned Range Category: The range + category of rng +
-
+
indexed example @@ -184,7 +184,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/indirected.html b/doc/html/range/reference/adaptors/reference/indirected.html index 7dc0558..7360891 100644 --- a/doc/html/range/reference/adaptors/reference/indirected.html +++ b/doc/html/range/reference/adaptors/reference/indirected.html @@ -2,8 +2,8 @@ indirected - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -75,24 +75,27 @@
  • -Precondition: The value_type - of the range defines unary operator*() -
  • + Precondition: The value_type of the range defines + unary operator*() +
  • -Postcondition: For all elements x in the returned range, x is the result of *y - where y is the corresponding - element in the original range. -
  • + Postcondition: For all elements + x in the returned + range, x is the result + of *y + where y is the corresponding + element in the original range. +
  • -Range Category:Single - Pass Range -
  • + Range Category: Single + Pass Range +
  • -Returned Range Category: The range - category of rng -
  • + Returned Range Category: The range + category of rng +
-
+
indirected example @@ -144,7 +147,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/map_keys.html b/doc/html/range/reference/adaptors/reference/map_keys.html index 6c69774..3b8e621 100644 --- a/doc/html/range/reference/adaptors/reference/map_keys.html +++ b/doc/html/range/reference/adaptors/reference/map_keys.html @@ -2,8 +2,8 @@ map_keys - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -75,23 +75,26 @@
  • -Precondition: The value_type - of the range is an instantiation of std::pair. -
  • + Precondition: The value_type of the range is an instantiation + of std::pair. +
  • -Postcondition: For all elements x in the returned range, x is the result of y.first where y - is the corresponding element in the original range. -
  • + Postcondition: For all elements + x in the returned + range, x is the result + of y.first where y + is the corresponding element in the original range. +
  • -Range Category:Single - Pass Range -
  • + Range Category: Single + Pass Range +
  • -Returned Range Category: The range - category of rng. -
  • + Returned Range Category: The range + category of rng. +
-
+
map_keys example @@ -144,7 +147,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/map_values.html b/doc/html/range/reference/adaptors/reference/map_values.html index 6a906b2..c55f9ae 100644 --- a/doc/html/range/reference/adaptors/reference/map_values.html +++ b/doc/html/range/reference/adaptors/reference/map_values.html @@ -2,8 +2,8 @@ map_values - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -75,23 +75,26 @@
  • -Precondition: The value_type - of the range is an instantiation of std::pair. -
  • + Precondition: The value_type of the range is an instantiation + of std::pair. +
  • -Postcondition: For all elements x in the returned range, x is the result of y.second where y - is the corresponding element in the original range. -
  • + Postcondition: For all elements + x in the returned + range, x is the result + of y.second where y + is the corresponding element in the original range. +
  • -Range Category:Single - Pass Range -
  • + Range Category: Single + Pass Range +
  • -Returned Range Category: The range - category of rng. -
  • + Returned Range Category: The range + category of rng. +
-
+
map_values example @@ -144,7 +147,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/adaptors/reference/replaced.html b/doc/html/range/reference/adaptors/reference/replaced.html index 3bcfff4..da45959 100644 --- a/doc/html/range/reference/adaptors/reference/replaced.html +++ b/doc/html/range/reference/adaptors/reference/replaced.html @@ -2,8 +2,8 @@ replaced - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -78,37 +78,41 @@
  • -Precondition:
      + Precondition: +
      • -new_value is convertible - to the value_type - of the range. -
      • + new_value is + convertible to the value_type + of the range. +
      • -old_value is convertible - to the value_type - of the range. -
      • + old_value is + convertible to the value_type + of the range. +
      - +
    • -Postcondition: For all elements x in the returned range, the value - x is equal to the value - of (y - == old_value) ? new_value : - y where y - is the corresponding element in the original range. -
    • + Postcondition: For all elements + x in the returned + range, the value x + is equal to the value of (y == + old_value) + ? new_value + : y + where y is the corresponding + element in the original range. +
    • -Range Category:Forward - Range -
    • + Range Category: Forward + Range +
    • -Returned Range Category: The range - category of rng. -
    • + Returned Range Category: The range + category of rng. +
    -
    +
    replaced example @@ -159,7 +163,7 @@
    -PrevUpHomeNext +PrevUpHomeNext
    diff --git a/doc/html/range/reference/adaptors/reference/replaced_if.html b/doc/html/range/reference/adaptors/reference/replaced_if.html index dbd181e..b3b77e3 100644 --- a/doc/html/range/reference/adaptors/reference/replaced_if.html +++ b/doc/html/range/reference/adaptors/reference/replaced_if.html @@ -2,8 +2,8 @@ replaced_if - - + + @@ -13,16 +13,16 @@ - +
    Boost C++ Libraries HomeLibrariesLibraries People FAQ More

    -PrevUpHomeNext +PrevUpHomeNext
    -
    +
    replaced_if @@ -79,36 +79,37 @@
    • -Precondition:
        + Precondition: +
        • - The range value_type - is convertible to the argument type of pred. -
        • + The range value_type + is convertible to the argument type of pred. +
        • -new_value is convertible - to the value_type - of the range. -
        • + new_value is + convertible to the value_type + of the range. +
        - +
      • -Postconditions: For all elements - x in the returned range, - the value x is equal - to the value of pred(y) ? new_value : - y where y - is the corresponding element in the original range. -
      • + Postconditions: For all elements + x in the returned + range, the value x + is equal to the value of pred(y) ? new_value : + y where y + is the corresponding element in the original range. +
      • -Range Category:Forward - Range -
      • + Range Category: Forward + Range +
      • -Returned Range Category: The range - category of rng. -
      • + Returned Range Category: The range + category of rng. +
      -
      +
      replaced_if example @@ -164,7 +165,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/adaptors/reference/reversed.html b/doc/html/range/reference/adaptors/reference/reversed.html index f8d2f26..2b192f9 100644 --- a/doc/html/range/reference/adaptors/reference/reversed.html +++ b/doc/html/range/reference/adaptors/reference/reversed.html @@ -2,8 +2,8 @@ reversed - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -75,19 +75,19 @@
      • -Returns: A range whose iterators behave - as if they were the original iterators wrapped in reverse_iterator. -
      • + Returns: A range whose iterators + behave as if they were the original iterators wrapped in reverse_iterator. +
      • -Range Category:Bidirectional - Range -
      • + Range Category: Bidirectional + Range +
      • -Returned Range Category: The range - category of rng. -
      • + Returned Range Category: The range + category of rng. +
      -
      +
      reversed example @@ -138,7 +138,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/adaptors/reference/sliced.html b/doc/html/range/reference/adaptors/reference/sliced.html index 757aaaf..c0dfed0 100644 --- a/doc/html/range/reference/adaptors/reference/sliced.html +++ b/doc/html/range/reference/adaptors/reference/sliced.html @@ -2,8 +2,8 @@ sliced - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -78,26 +78,26 @@
      -
      +
      sliced example @@ -148,7 +148,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/adaptors/reference/strided.html b/doc/html/range/reference/adaptors/reference/strided.html index b641325..2cbb302 100644 --- a/doc/html/range/reference/adaptors/reference/strided.html +++ b/doc/html/range/reference/adaptors/reference/strided.html @@ -2,8 +2,8 @@ strided - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -76,25 +76,25 @@
      • -Precondition:0 - <= n - && n - < distance(rng) -
      • + Precondition: 0 + <= n + && n + < distance(rng) +
      • -Returns: A new range based on rng where traversal is performed - in steps of n. -
      • + Returns: A new range based on rng where traversal is performed + in steps of n. +
      • -Range Category:Random - Access Range -
      • + Range Category: Random + Access Range +
      • -Returned Range Category:Random - Access Range -
      • + Returned Range Category: Random + Access Range +
      -
      +
      strided example @@ -145,7 +145,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/adaptors/reference/tokenized.html b/doc/html/range/reference/adaptors/reference/tokenized.html index 32f57e6..66e5cd7 100644 --- a/doc/html/range/reference/adaptors/reference/tokenized.html +++ b/doc/html/range/reference/adaptors/reference/tokenized.html @@ -2,8 +2,8 @@ tokenized - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -88,47 +88,50 @@
      • -Precondition:
          + Precondition: +
          • - Let T denote typename range_value<decltype(rng)>::type, - then regex has - the type basic_regex<T> or is implicitly convertible - to one of these types. -
          • + Let T denote + typename range_value<decltype(rng)>::type, + then regex + has the type basic_regex<T> or is implicitly convertible + to one of these types. +
          • -i has the type - int. -
          • + i has the type + int. +
          • - the value_type - of rndRng is int. -
          • + the value_type + of rndRng is + int. +
          • -flags has the type - regex_constants::syntax_option_type. -
          • + flags has the + type regex_constants::syntax_option_type. +
          - +
        • -Returns: A range whose iterators behave - as if they were the original iterators wrapped in regex_token_iterator. - The first iterator in the range would be constructed by forwarding - all the arguments of tokenized() to the regex_token_iterator - constructor. -
        • + Returns: A range whose iterators + behave as if they were the original iterators wrapped in regex_token_iterator. The first + iterator in the range would be constructed by forwarding all the + arguments of tokenized() to the regex_token_iterator + constructor. +
        • -Throws: Whatever constructing and - copying equivalent regex_token_iterators - might throw. -
        • + Throws: Whatever constructing and + copying equivalent regex_token_iterators + might throw. +
        • -Range Category:Random - Access Range -
        • + Range Category: Random + Access Range +
        • -Returned Range Category:Random - Access Range -
        • + Returned Range Category: Random + Access Range +
      @@ -141,7 +144,7 @@

      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/adaptors/reference/transformed.html b/doc/html/range/reference/adaptors/reference/transformed.html index 43b8758..9631986 100644 --- a/doc/html/range/reference/adaptors/reference/transformed.html +++ b/doc/html/range/reference/adaptors/reference/transformed.html @@ -2,8 +2,8 @@ transformed - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      transformed @@ -77,28 +77,31 @@
      • -Precondition: The value_type - of the range is convertible to the argument type of fun. -
      • + Precondition: The value_type of the range is convertible + to the argument type of fun. +
      • -Postcondition: For all elements x in the returned range, x is the result of fun(y) - where y is the corresponding - element in the original range. -
      • + Postcondition: For all elements + x in the returned + range, x is the result + of fun(y) + where y is the corresponding + element in the original range. +
      • -Throws: Whatever the copy-constructor - of fun might throw. -
      • + Throws: Whatever the copy-constructor + of fun might throw. +
      • -Range Category:Single - Pass Range -
      • + Range Category: Single + Pass Range +
      • -Returned Range Category: The range - category of rng. -
      • + Returned Range Category: The range + category of rng. +
      -
      +
      transformed example @@ -155,7 +158,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/adaptors/reference/uniqued.html b/doc/html/range/reference/adaptors/reference/uniqued.html index 65fdc6e..6ab4c59 100644 --- a/doc/html/range/reference/adaptors/reference/uniqued.html +++ b/doc/html/range/reference/adaptors/reference/uniqued.html @@ -2,8 +2,8 @@ uniqued - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -75,24 +75,24 @@
      • -Precondition: The value_type - of the range is comparable with operator==(). -
      • + Precondition: The value_type of the range is comparable + with operator==(). +
      • -Postcondition: For all adjacent elements - [x,y] in the returned range, x==y is false. -
      • + Postcondition: For all adjacent + elements [x,y] in the returned range, x==y is false. +
      • -Range Category:Forward - Range -
      • + Range Category: Forward + Range +
      • -Returned Range Category: The minimum - of the range concept of rng - and Forward Range. -
      • + Returned Range Category: The minimum + of the range concept of rng + and Forward Range. +
      -
      +
      uniqued example @@ -141,7 +141,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms.html b/doc/html/range/reference/algorithms.html index a8b27ff..0bc9f39 100644 --- a/doc/html/range/reference/algorithms.html +++ b/doc/html/range/reference/algorithms.html @@ -2,8 +2,8 @@ Range Algorithm - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -50,7 +50,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/heap.html b/doc/html/range/reference/algorithms/heap.html index c06c707..045ea7b 100644 --- a/doc/html/range/reference/algorithms/heap.html +++ b/doc/html/range/reference/algorithms/heap.html @@ -2,8 +2,8 @@ Heap algorithms - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -43,7 +43,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/heap/make_heap.html b/doc/html/range/reference/algorithms/heap/make_heap.html index a847fc7..ce7157e 100644 --- a/doc/html/range/reference/algorithms/heap/make_heap.html +++ b/doc/html/range/reference/algorithms/heap/make_heap.html @@ -2,8 +2,8 @@ make_heap - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

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

      - + Definition

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

      - + Requirements

      @@ -75,50 +75,50 @@

      • -RandomAccessRange is - a model of the Random - Access Range Concept. -
      • + RandomAccessRange + is a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -RandomAccessRange's - value type is a model of the LessThanComparableConcept. -
      • + 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. -
      • + 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 a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -Compare is a model - of the StrictWeakOrderingConcept. -
      • + Compare is a model + of the StrictWeakOrderingConcept. +
      • -RandomAccessRange's - value type is convertible to both of Compare's - argument types. -
      • + RandomAccessRange's + value type is convertible to both of Compare's + argument types. +
      - + Complexity

      @@ -137,7 +137,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/heap/pop_heap.html b/doc/html/range/reference/algorithms/heap/pop_heap.html index 6cf064d..b00c3ac 100644 --- a/doc/html/range/reference/algorithms/heap/pop_heap.html +++ b/doc/html/range/reference/algorithms/heap/pop_heap.html @@ -2,8 +2,8 @@ pop_heap - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

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

      - + Definition

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

      - + Requirements

      @@ -77,60 +77,62 @@

      • -RandomAccessRange is - a model of the Random - Access Range Concept. -
      • + RandomAccessRange + is a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -RandomAccessRange's - value type is a model of the LessThanComparableConcept. -
      • + 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. -
      • + 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 a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -Compare is a model - of the StrictWeakOrderingConcept. -
      • + Compare is a model + of the StrictWeakOrderingConcept. +
      • -RandomAccessRange's - value type is convertible to both of Compare's - argument types. -
      • + RandomAccessRange's + value type is convertible to both of Compare's + argument types. +
      - + Precondition:
        -
      • !empty(rng)
      • -rng is a heap. -
      • + !empty(rng) + +
      • + rng is a heap. +
      - + Complexity

      @@ -149,7 +151,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/heap/push_heap.html b/doc/html/range/reference/algorithms/heap/push_heap.html index f4497b6..ece6dbf 100644 --- a/doc/html/range/reference/algorithms/heap/push_heap.html +++ b/doc/html/range/reference/algorithms/heap/push_heap.html @@ -2,8 +2,8 @@ push_heap - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

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

      - + Definition

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

      - + Requirements

      @@ -77,60 +77,62 @@

      • -RandomAccessRange is - a model of the Random - Access Range Concept. -
      • + RandomAccessRange + is a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -RandomAccessRange's - value type is a model of the LessThanComparableConcept. -
      • + 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. -
      • + 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 a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -Compare is a model - of the StrictWeakOrderingConcept. -
      • + Compare is a model + of the StrictWeakOrderingConcept. +
      • -RandomAccessRange's - value type is convertible to both of Compare's - argument types. -
      • + RandomAccessRange's + value type is convertible to both of Compare's + argument types. +
      - + Precondition:
        -
      • !empty(rng)
      • -[begin(rng), prior(end(rng))) is a heap. -
      • + !empty(rng) + +
      • + [begin(rng), prior(end(rng))) is a heap. +
      - + Complexity

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


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/heap/sort_heap.html b/doc/html/range/reference/algorithms/heap/sort_heap.html index c5bb9b3..77a5dab 100644 --- a/doc/html/range/reference/algorithms/heap/sort_heap.html +++ b/doc/html/range/reference/algorithms/heap/sort_heap.html @@ -2,8 +2,8 @@ sort_heap - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

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

      - + Definition

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

      - + Requirements

      @@ -76,57 +76,57 @@

      • -RandomAccessRange is - a model of the Random - Access Range Concept. -
      • + RandomAccessRange + is a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -RandomAccessRange's - value type is a model of the LessThanComparableConcept. -
      • + 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. -
      • + 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 a model of the Random + Access Range Concept. +
      • -RandomAccessRange is - mutable. -
      • + RandomAccessRange + is mutable. +
      • -Compare is a model - of the StrictWeakOrderingConcept. -
      • + Compare is a model + of the StrictWeakOrderingConcept. +
      • -RandomAccessRange's - value type is convertible to both of Compare's - argument types. -
      • + RandomAccessRange's + value type is convertible to both of Compare's + argument types. +
      - + Precondition:

      rng is a heap.

      - + Complexity

      @@ -146,7 +146,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating.html b/doc/html/range/reference/algorithms/mutating.html index 1990363..7a7d945 100644 --- a/doc/html/range/reference/algorithms/mutating.html +++ b/doc/html/range/reference/algorithms/mutating.html @@ -2,8 +2,8 @@ Mutating algorithms - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -85,7 +85,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/copy.html b/doc/html/range/reference/algorithms/mutating/copy.html index 854c4ac..671e761 100644 --- a/doc/html/range/reference/algorithms/mutating/copy.html +++ b/doc/html/range/reference/algorithms/mutating/copy.html @@ -2,8 +2,8 @@ copy - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

      @@ -39,7 +39,7 @@

      - + Description

      @@ -50,49 +50,49 @@ distance(source_rng)

      - + Definition

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

      - + Requirements
      • -SinglePassRange is - a model of the Single - Pass Range Concept. -
      • + SinglePassRange is + a model of the Single + Pass Range Concept. +
      • -OutputIterator is a - model of the OutputIteratorConcept. -
      • + OutputIterator is + a model of the OutputIteratorConcept. +
      • - The value_type of - Single Pass Range - Concept is convertible to a type in OutputIterator's - set of value types. -
      • + The value_type of + Single Pass Range + Concept is convertible to a type in OutputIterator's + set of value types. +
      - + Precondition:
      • -out_it is not an iterator - within the source_rng. -
      • + out_it is not an + iterator within the source_rng. +
      • -[out_it, out_it - + distance(source_rng)) is a valid range. -
      • + [out_it, out_it + + distance(source_rng)) is a valid range. +
      - + Complexity

      @@ -109,7 +109,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/copy_backward.html b/doc/html/range/reference/algorithms/mutating/copy_backward.html index c1d1266..7c909c1 100644 --- a/doc/html/range/reference/algorithms/mutating/copy_backward.html +++ b/doc/html/range/reference/algorithms/mutating/copy_backward.html @@ -2,8 +2,8 @@ copy_backward - - + + @@ -13,22 +13,22 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

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

      - + Definition

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

      - + Requirements
      • -BidirectionalRange - is a model of Bidirectional - Range Concept. -
      • + BidirectionalRange + is a model of Bidirectional + Range Concept. +
      • -OutputIterator is a - model of the OutputIteratorConcept. -
      • + OutputIterator is + a model of the OutputIteratorConcept. +
      • - The value_type of - Bidirectional Range - Concept is convertible to a type in OutputIterator's - set of value types. -
      • + The value_type of + Bidirectional + Range Concept is convertible to a type in OutputIterator's + set of value types. +
      - + Precondition:
      • -out_it is not an iterator - within the source_rng. -
      • + out_it is not an + iterator within the source_rng. +
      • -[out_it, out_it - + distance(source_rng)) is a valid range. -
      • + [out_it, out_it + + distance(source_rng)) is a valid range. +
      - + Complexity

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


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/fill.html b/doc/html/range/reference/algorithms/mutating/fill.html index 5f5da38..013fa91 100644 --- a/doc/html/range/reference/algorithms/mutating/fill.html +++ b/doc/html/range/reference/algorithms/mutating/fill.html @@ -2,8 +2,8 @@ fill - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

      @@ -39,7 +39,7 @@

      - + Description

      @@ -48,37 +48,37 @@ in the range rng.

      - + Definition

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

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

      @@ -95,7 +95,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/fill_n.html b/doc/html/range/reference/algorithms/mutating/fill_n.html index 5d09a06..a37bd29 100644 --- a/doc/html/range/reference/algorithms/mutating/fill_n.html +++ b/doc/html/range/reference/algorithms/mutating/fill_n.html @@ -2,8 +2,8 @@ fill_n - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

      @@ -39,7 +39,7 @@

      - + Description

      @@ -47,37 +47,37 @@ 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 a + model of the Forward + Range Concept. +
      • -ForwardRange is mutable. -
      • + ForwardRange is mutable. +
      • -Value is a model of - the AssignableConcept. -
      • + Value is a model + of the AssignableConcept. +
      • -Value is convertible - to ForwardRange's value - type. -
      • + Value is convertible + to ForwardRange's + value type. +
      - + Complexity

      @@ -95,7 +95,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/generate.html b/doc/html/range/reference/algorithms/mutating/generate.html index 7bdf2ff..a81fca5 100644 --- a/doc/html/range/reference/algorithms/mutating/generate.html +++ b/doc/html/range/reference/algorithms/mutating/generate.html @@ -2,8 +2,8 @@ generate - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

      @@ -52,52 +52,52 @@ Returns the resultant range.

      - + Definition

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

      - + Requirements
      • -ForwardRange is a model - of the Forward Range - Concept. -
      • + ForwardRange is a + model of the Forward + Range Concept. +
      • -ForwardRange is mutable. -
      • + ForwardRange is mutable. +
      • -Generator is a model - of the GeneratorConcept. -
      • + Generator is a model + of the GeneratorConcept. +
      • - The value_type of - SinglePassRange is - convertible to a type in OutputIterator's - set of value types. -
      • + The value_type of + SinglePassRange is + convertible to a type in OutputIterator's + set of value types. +
      - + Precondition:
      • -out_it is not an iterator - within rng. -
      • + out_it is not an + iterator within rng. +
      • -[out_it, out_it - + distance(rng)) is a valid range. -
      • + [out_it, out_it + + distance(rng)) is a valid range. +
      - + Complexity

      @@ -114,7 +114,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/inplace_merge.html b/doc/html/range/reference/algorithms/mutating/inplace_merge.html index 8d4d6c5..b77680d 100644 --- a/doc/html/range/reference/algorithms/mutating/inplace_merge.html +++ b/doc/html/range/reference/algorithms/mutating/inplace_merge.html @@ -2,8 +2,8 @@ inplace_merge - - + + @@ -13,22 +13,22 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + 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

      @@ -87,23 +87,23 @@

      • -BidirectionalRange - is a model of the Bidirectional - Range Concept. -
      • + BidirectionalRange + is a model of the Bidirectional + Range Concept. +
      • -BidirectionalRange - is mutable. -
      • + BidirectionalRange + is mutable. +
      • -range_value<BidirectionalRange>::type is a model of LessThanComparableConcept -
      • + range_value<BidirectionalRange>::type is a model of LessThanComparableConcept +
      • - The ordering on objects of range_type<BidirectionalRange>::type - is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
      • + The ordering on objects of range_type<BidirectionalRange>::type + is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +

      For the predicate version: * BidirectionalRange is a model of the @@ -116,55 +116,55 @@ argument types.

      - + Precondition:
      - + For the non-predicate version:
      • -middle is in the range - rng. -
      • + middle is in the + range rng. +
      • -[begin(rng), middle) is in ascending order. That is for - each pair of adjacent elements [x,y], - y < - x is false. -
      • + [begin(rng), middle) is in ascending order. That is for + each pair of adjacent elements [x,y], + y < + x is false. +
      • -[middle, end(rng)) is in ascending order. That is for - each pair of adjacent elements [x,y], - y < - x is false. -
      • + [middle, end(rng)) is in ascending order. That is + for each pair of adjacent elements [x,y], + y < + x is false. +
      - + For the predicate version:
      • -middle is in the range - rng. -
      • + middle is in the + range rng. +
      • -[begin(rng), middle) is in ascending order. That is for - each pair of adjacent elements [x,y], - pred(y,x) == false. -
      • + [begin(rng), middle) is in ascending order. That is for + each pair of adjacent elements [x,y], + pred(y,x) == false. +
      • -[middle, end(rng)) is in ascending order. That is for - each pair of adjacent elements [x,y], - pred(y,x) == false. -
      • + [middle, end(rng)) is in ascending order. That is + for each pair of adjacent elements [x,y], + pred(y,x) == false. +
      - + Complexity

      @@ -181,7 +181,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/merge.html b/doc/html/range/reference/algorithms/mutating/merge.html index d66fc41..7fc40e8 100644 --- a/doc/html/range/reference/algorithms/mutating/merge.html +++ b/doc/html/range/reference/algorithms/mutating/merge.html @@ -2,8 +2,8 @@ merge - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

      @@ -56,7 +56,7 @@

      - + Description

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

      - + Definition

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

      - + Requirements

      @@ -90,137 +90,147 @@

      • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
      • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
      • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
      • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
      • -range_value<SinglePassRange1>::type is the same as range_value<SinglePassRange2>::type. -
      • + range_value<SinglePassRange1>::type is the same as range_value<SinglePassRange2>::type. +
      • -range_value<SinglePassRange1>::type is a model of the LessThanComparableConcept. -
      • + range_value<SinglePassRange1>::type is a model of the LessThanComparableConcept. +
      • - The ordering on objects of range_value<SinglePassRange1>::type - is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
      • + The ordering on objects of range_value<SinglePassRange1>::type + is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
      • -range_value<SinglePassRange1>::type is convertible to a type in - OutputIterator's set - of value types. -
      • + range_value<SinglePassRange1>::type is convertible to a type in + OutputIterator's + set of value types. +

      For the predicate version:

      • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
      • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
      • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
      • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
      • -range_value<SinglePassRange1>::type is the same as range_value<SinglePassRange2>::type. -
      • + range_value<SinglePassRange1>::type is the same as range_value<SinglePassRange2>::type. +
      • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
      • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
      • -SinglePassRange1's - value type is convertible to both BinaryPredicate's - argument types. -
      • + SinglePassRange1's + value type is convertible to both BinaryPredicate's + argument types. +
      • -range_value<SinglePassRange1>::type is convertible to a type in - OutputIterator's set - of value types. -
      • + range_value<SinglePassRange1>::type is convertible to a type in + OutputIterator's + set of value types. +
      - + Precondition:
      - + For the non-predicate version:
      • - The elements of rng1 - are in ascending order. That is, for each adjacent element pair [x,y] of rng1, - y < - x == - false. -
      • + The elements of rng1 + are in ascending order. That is, for each adjacent element pair + [x,y] of rng1, + y < + x == + false. +
      • - The elements of rng2 - are in ascending order. That is, for each adjacent element pair [x,y] of rng2, - y < - x == - false. -
      • + The elements of rng2 + are in ascending order. That is, for each adjacent element pair + [x,y] of rng2, + y < + x == + false. +
      • - The ranges rng1 and - [out, out + distance(rng1) + distance(rng2)) - do not overlap. -
      • + The ranges rng1 and + [out, out + + distance(rng1) + distance(rng2)) + do not overlap. +
      • - The ranges rng2 and - [out, out + distance(rng1) + distance(rng2)) - do not overlap. -
      • + The ranges rng2 and + [out, out + + distance(rng1) + distance(rng2)) + do not overlap. +
      • -[out, out + distance(rng1) + distance(rng2)) - is a valid range. -
      • + [out, out + + distance(rng1) + distance(rng2)) + is a valid range. +
      - + For the predicate version:
      • - The elements of rng1 - are in ascending order. That is, for each adjacent element pair [x,y], of rng1, - pred(y, x) == false. -
      • + The elements of rng1 + are in ascending order. That is, for each adjacent element pair + [x,y], of rng1, + pred(y, x) == false. +
      • - The elements of rng2 - are in ascending order. That is, for each adjacent element pair [x,y], of rng2, - pred(y, x) == false. -
      • + The elements of rng2 + are in ascending order. That is, for each adjacent element pair + [x,y], of rng2, + pred(y, x) == false. +
      • - The ranges rng1 and - [out, out + distance(rng1) + distance(rng2)) - do not overlap. -
      • + The ranges rng1 and + [out, out + + distance(rng1) + distance(rng2)) + do not overlap. +
      • - The ranges rng2 and - [out, out + distance(rng1) + distance(rng2)) - do not overlap. -
      • + The ranges rng2 and + [out, out + + distance(rng1) + distance(rng2)) + do not overlap. +
      • -[out, out + distance(rng1) + distance(rng2)) - is a valid range. -
      • + [out, out + + distance(rng1) + distance(rng2)) + is a valid range. +
      - + Complexity

      @@ -240,7 +250,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/nth_element.html b/doc/html/range/reference/algorithms/mutating/nth_element.html index cd13253..1f3b2ef 100644 --- a/doc/html/range/reference/algorithms/mutating/nth_element.html +++ b/doc/html/range/reference/algorithms/mutating/nth_element.html @@ -2,8 +2,8 @@ nth_element - - + + @@ -13,22 +13,22 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

      @@ -70,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

      @@ -85,50 +85,50 @@

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

      For the predicate version:

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

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


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/partial_sort.html b/doc/html/range/reference/algorithms/mutating/partial_sort.html index 7938cd3..57faa7d 100644 --- a/doc/html/range/reference/algorithms/mutating/partial_sort.html +++ b/doc/html/range/reference/algorithms/mutating/partial_sort.html @@ -2,8 +2,8 @@ partial_sort - - + + @@ -13,22 +13,22 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

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

      - + Definition

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

      - + Requirements

      @@ -90,50 +90,50 @@

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

      For the predicate version:

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

      @@ -150,7 +150,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/partition.html b/doc/html/range/reference/algorithms/mutating/partition.html index 79bd88c..597612c 100644 --- a/doc/html/range/reference/algorithms/mutating/partition.html +++ b/doc/html/range/reference/algorithms/mutating/partition.html @@ -2,8 +2,8 @@ partition - - + + @@ -13,21 +13,21 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

      @@ -80,34 +80,34 @@ corresponds to the middle iterator.

      - + Definition

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

      - + Requirements
      • -ForwardRange is a model - of the Forward Range - Concept. -
      • + ForwardRange is a + model of the Forward + Range Concept. +
      • -UnaryPredicate is a - model of the PredicateConcept. -
      • + UnaryPredicate is + a model of the PredicateConcept. +
      • -ForwardRange's value - type is convertible to UnaryPredicate's - argument type. -
      • + ForwardRange's value + type is convertible to UnaryPredicate's + argument type. +
      - + Complexity

      @@ -126,7 +126,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/reference/algorithms/mutating/random_shuffle.html b/doc/html/range/reference/algorithms/mutating/random_shuffle.html index d94fc5a..ece4438 100644 --- a/doc/html/range/reference/algorithms/mutating/random_shuffle.html +++ b/doc/html/range/reference/algorithms/mutating/random_shuffle.html @@ -2,8 +2,8 @@ random_shuffle - - + + @@ -13,22 +13,22 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      - + Prototype

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

      - + Description

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

      - + Definition

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

      - + Requirements

      For the version without a Generator:

      + RandomAccessRange + is a model of the Random + Access Range Concept. +

    For the version with a Generator:

    • -RandomAccessRange is - a model of the Random - Access Range Concept. -
    • + RandomAccessRange + is a model of the Random + Access Range Concept. +
    • -Generator is a model - of the RandomNumberGeneratorConcept. -
    • + Generator is a model + of the RandomNumberGeneratorConcept. +
    • -RandomAccessRange's - distance type is convertible to Generator's - argument type. -
    • + RandomAccessRange's + distance type is convertible to Generator's + argument type. +
    - + Precondition:
    • -distance(rng) - is less than gen's - maximum value. -
    + distance(rng) + is less than gen's + maximum value. +
- + Complexity

@@ -126,7 +126,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/remove.html b/doc/html/range/reference/algorithms/mutating/remove.html index de178ea..58f2b6b 100644 --- a/doc/html/range/reference/algorithms/mutating/remove.html +++ b/doc/html/range/reference/algorithms/mutating/remove.html @@ -2,8 +2,8 @@ remove - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -83,37 +83,37 @@ are dereferenceable, but the elements are unspecified.

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -Value is a model of - the EqualityComparableConcept. -
  • + Value is a model + of the EqualityComparableConcept. +
  • - Objects of type Value - can be compared for equality with objects of ForwardRange's - value type. -
  • + Objects of type Value + can be compared for equality with objects of ForwardRange's + value type. +
- + Complexity

@@ -132,7 +132,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/remove_copy.html b/doc/html/range/reference/algorithms/mutating/remove_copy.html index b775716..c948593 100644 --- a/doc/html/range/reference/algorithms/mutating/remove_copy.html +++ b/doc/html/range/reference/algorithms/mutating/remove_copy.html @@ -2,8 +2,8 @@ remove_copy - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -54,37 +54,37 @@ rng for which x == val is false.

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -Value is a model of - the EqualityComparableConcept. -
  • + Value is a model + of the EqualityComparableConcept. +
  • - Objects of type Value - can be compared for equality with objects of ForwardRange's - value type. -
  • + Objects of type Value + can be compared for equality with objects of ForwardRange's + value type. +
- + Complexity

@@ -103,7 +103,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/remove_copy_if.html b/doc/html/range/reference/algorithms/mutating/remove_copy_if.html index 3f25b68..d631aab 100644 --- a/doc/html/range/reference/algorithms/mutating/remove_copy_if.html +++ b/doc/html/range/reference/algorithms/mutating/remove_copy_if.html @@ -2,8 +2,8 @@ remove_copy_if - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -55,32 +55,32 @@ is false.

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -UnaryPred is a model - of the UnaryPredicateConcept. -
  • + UnaryPred is a model + of the UnaryPredicateConcept. +
- + Complexity

@@ -98,7 +98,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/remove_if.html b/doc/html/range/reference/algorithms/mutating/remove_if.html index 95a933c..460b087 100644 --- a/doc/html/range/reference/algorithms/mutating/remove_if.html +++ b/doc/html/range/reference/algorithms/mutating/remove_if.html @@ -2,8 +2,8 @@ remove_if - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -82,37 +82,37 @@ are unspecified.

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -UnaryPredicate is a - model of the PredicateConcept. -
  • + UnaryPredicate is + a model of the PredicateConcept. +
  • -ForwardRange's value - type is convertible to UnaryPredicate's - argument type. -
  • + ForwardRange's value + type is convertible to UnaryPredicate's + argument type. +
- + Complexity

@@ -131,7 +131,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/replace.html b/doc/html/range/reference/algorithms/mutating/replace.html index abbffc3..efd4c78 100644 --- a/doc/html/range/reference/algorithms/mutating/replace.html +++ b/doc/html/range/reference/algorithms/mutating/replace.html @@ -2,8 +2,8 @@ replace - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -57,43 +57,43 @@ Return a reference to rng.

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -Value is convertible - to ForwardRange's value - type. -
  • + Value is convertible + to ForwardRange's + value type. +
  • -Value is a model of - the AssignableConcept. -
  • + Value is a model + of the AssignableConcept. +
  • -Value is a model of - the EqualityComparableConcept, - and may be compared for equality with objects of ForwardRange's - value type. -
  • + Value is a model + of the EqualityComparableConcept, + and may be compared for equality with objects of ForwardRange's + value type. +
- + Complexity

@@ -112,7 +112,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/replace_copy.html b/doc/html/range/reference/algorithms/mutating/replace_copy.html index a5678bd..ccc4e22 100644 --- a/doc/html/range/reference/algorithms/mutating/replace_copy.html +++ b/doc/html/range/reference/algorithms/mutating/replace_copy.html @@ -2,8 +2,8 @@ replace_copy - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -41,7 +41,7 @@

- + Description

@@ -54,41 +54,41 @@ x.

- + Definition

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

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

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/replace_copy_if.html b/doc/html/range/reference/algorithms/mutating/replace_copy_if.html index 17607de..60f4f9c 100644 --- a/doc/html/range/reference/algorithms/mutating/replace_copy_if.html +++ b/doc/html/range/reference/algorithms/mutating/replace_copy_if.html @@ -2,8 +2,8 @@ replace_copy_if - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -41,7 +41,7 @@

- + Description

@@ -52,45 +52,45 @@ : x.

- + Definition

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

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

@@ -108,7 +108,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/replace_if.html b/doc/html/range/reference/algorithms/mutating/replace_if.html index 110c753..293ae92 100644 --- a/doc/html/range/reference/algorithms/mutating/replace_if.html +++ b/doc/html/range/reference/algorithms/mutating/replace_if.html @@ -2,8 +2,8 @@ replace_if - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

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

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/reverse.html b/doc/html/range/reference/algorithms/mutating/reverse.html index 0ae4ef5..253d901 100644 --- a/doc/html/range/reference/algorithms/mutating/reverse.html +++ b/doc/html/range/reference/algorithms/mutating/reverse.html @@ -2,8 +2,8 @@ reverse - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -50,29 +50,29 @@ Returns a reference to the reversed range.

- + Definition

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

- + Requirements
  • -BidirectionalRange - is a model of the Bidirectional - Range Concept. -
  • + BidirectionalRange + is a model of the Bidirectional + Range Concept. +
  • -BidirectionalRange - is mutable. -
  • + BidirectionalRange + is mutable. +
- + Complexity

@@ -90,7 +90,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/reverse_copy.html b/doc/html/range/reference/algorithms/mutating/reverse_copy.html index 34a4b9a..4795437 100644 --- a/doc/html/range/reference/algorithms/mutating/reverse_copy.html +++ b/doc/html/range/reference/algorithms/mutating/reverse_copy.html @@ -2,8 +2,8 @@ reverse_copy - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -50,33 +50,33 @@ Returns the output iterator one passed the last copied element.

- + Definition

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

- + Requirements
  • -BidirectionalRange - is a model of the Bidirectional - Range Concept. -
  • + BidirectionalRange + is a model of the Bidirectional + Range Concept. +
  • -BidirectionalRange - is mutable. -
  • + BidirectionalRange + is mutable. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
- + Complexity

@@ -95,7 +95,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/rotate.html b/doc/html/range/reference/algorithms/mutating/rotate.html index b0dc3e4..9e7cbb4 100644 --- a/doc/html/range/reference/algorithms/mutating/rotate.html +++ b/doc/html/range/reference/algorithms/mutating/rotate.html @@ -2,8 +2,8 @@ rotate - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
- + Precondition:
  • -[begin(rng), middle) is a valid range. -
  • + [begin(rng), middle) is a valid range. +
  • -[middle, end(rng)) is a valid range. -
  • + [middle, end(rng)) is a valid range. +
- + Complexity

@@ -103,7 +103,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/rotate_copy.html b/doc/html/range/reference/algorithms/mutating/rotate_copy.html index 293f540..53643bd 100644 --- a/doc/html/range/reference/algorithms/mutating/rotate_copy.html +++ b/doc/html/range/reference/algorithms/mutating/rotate_copy.html @@ -2,8 +2,8 @@ rotate_copy - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -52,44 +52,44 @@ and [middle, end(rng)) to out.

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
- + Precondition:
  • -[begin(rng), middle) is a valid range. -
  • + [begin(rng), middle) is a valid range. +
  • -[middle, end(rng)) is a valid range. -
  • + [middle, end(rng)) is a valid range. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/sort.html b/doc/html/range/reference/algorithms/mutating/sort.html index ffa09ad..fa727b8 100644 --- a/doc/html/range/reference/algorithms/mutating/sort.html +++ b/doc/html/range/reference/algorithms/mutating/sort.html @@ -2,8 +2,8 @@ sort - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements

@@ -86,50 +86,50 @@

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

For versions of sort with a predicate

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

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/stable_partition.html b/doc/html/range/reference/algorithms/mutating/stable_partition.html index c12efc0..59a763d 100644 --- a/doc/html/range/reference/algorithms/mutating/stable_partition.html +++ b/doc/html/range/reference/algorithms/mutating/stable_partition.html @@ -2,8 +2,8 @@ stable_partition - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements
  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -UnaryPredicate is a - model of the PredicateConcept. -
  • + UnaryPredicate is + a model of the PredicateConcept. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/stable_sort.html b/doc/html/range/reference/algorithms/mutating/stable_sort.html index 7f4e1a5..8d9a6c0 100644 --- a/doc/html/range/reference/algorithms/mutating/stable_sort.html +++ b/doc/html/range/reference/algorithms/mutating/stable_sort.html @@ -2,8 +2,8 @@ stable_sort - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -87,50 +87,50 @@

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

For versions of stable_sort with a predicate:

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

@@ -151,7 +151,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/swap_ranges.html b/doc/html/range/reference/algorithms/mutating/swap_ranges.html index a9fc9fa..42e33ce 100644 --- a/doc/html/range/reference/algorithms/mutating/swap_ranges.html +++ b/doc/html/range/reference/algorithms/mutating/swap_ranges.html @@ -2,8 +2,8 @@ swap_ranges - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -50,38 +50,38 @@ Returns a reference to rng2.

- + Definition

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

- + Requirements
  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange1 is - mutable. -
  • + SinglePassRange1 + is mutable. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - mutable. -
  • + SinglePassRange2 + is mutable. +
- + Complexity

@@ -98,7 +98,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/transform.html b/doc/html/range/reference/algorithms/mutating/transform.html index 9247576..ca1a530 100644 --- a/doc/html/range/reference/algorithms/mutating/transform.html +++ b/doc/html/range/reference/algorithms/mutating/transform.html @@ -2,8 +2,8 @@ transform - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -56,7 +56,7 @@

- + Description

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

- + Definition

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

- + Requirements

@@ -107,69 +107,69 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -UnaryOperation is a - model of the UnaryFunctionConcept. -
  • + UnaryOperation is + a model of the UnaryFunctionConcept. +
  • -SinglePassRange1's - value type must be convertible to UnaryFunction's - argument type. -
  • + SinglePassRange1's + value type must be convertible to UnaryFunction's + argument type. +
  • -UnaryFunction's result - type must be convertible to a type in OutputIterator's - set of value types. -
  • + UnaryFunction's result + type must be convertible to a type in OutputIterator's + set of value types. +

For the binary versions of transform:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -BinaryOperation is - a model of the BinaryFunctionConcept. -
  • + BinaryOperation is + a model of the BinaryFunctionConcept. +
  • -SinglePassRange1's - value type must be convertible to BinaryFunction's - first argument type. -
  • + SinglePassRange1's + value type must be convertible to BinaryFunction's + first argument type. +
  • -SinglePassRange2's - value type must be convertible to BinaryFunction's - second argument type. -
  • + SinglePassRange2's + value type must be convertible to BinaryFunction's + second argument type. +
  • -BinaryOperation's result - type must be convertible to a type in OutputIterator's - set of value types. -
  • + BinaryOperation's + result type must be convertible to a type in OutputIterator's + set of value types. +
- + Precondition:

@@ -177,31 +177,33 @@

  • -out is not an iterator - within the range [begin(rng1) + 1, end(rng1)). -
  • + out is not an iterator + within the range [begin(rng1) + 1, end(rng1)). +
  • -[out, out + distance(rng1)) is a valid range. -
  • + [out, out + + distance(rng1)) is a valid range. +

For the binary version of transform:

  • -out is not an iterator - within the range [begin(rng1) + 1, end(rng1)). -
  • + out is not an iterator + within the range [begin(rng1) + 1, end(rng1)). +
  • -out is not an iterator - within the range [begin(rng2) + 1, end(rng2)). -
  • + out is not an iterator + within the range [begin(rng2) + 1, end(rng2)). +
  • -[out, out + min(distance(rng1), distance(rng2))) is a valid range. -
  • + [out, out + + min(distance(rng1), distance(rng2))) is a valid range. +
- + Complexity

@@ -219,7 +221,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/unique.html b/doc/html/range/reference/algorithms/mutating/unique.html index 961a44f..7c0c1b8 100644 --- a/doc/html/range/reference/algorithms/mutating/unique.html +++ b/doc/html/range/reference/algorithms/mutating/unique.html @@ -2,8 +2,8 @@ unique - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -68,7 +68,7 @@

- + Description

@@ -86,14 +86,14 @@ type.

- + Definition

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

- + Requirements

@@ -101,43 +101,43 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -ForwardRange's value - type is a model of the EqualityComparableConcept. -
  • + ForwardRange's value + type is a model of the EqualityComparableConcept. +

For the predicate versions of unique:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange is mutable. -
  • + ForwardRange is mutable. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -ForwardRange's value - type is convertible to BinaryPredicate's - first argument type and to BinaryPredicate's - second argument type. -
  • + ForwardRange's value + type is convertible to BinaryPredicate's + first argument type and to BinaryPredicate's + second argument type. +
- + Complexity

@@ -157,7 +157,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/mutating/unique_copy.html b/doc/html/range/reference/algorithms/mutating/unique_copy.html index e0de9fc..b202b52 100644 --- a/doc/html/range/reference/algorithms/mutating/unique_copy.html +++ b/doc/html/range/reference/algorithms/mutating/unique_copy.html @@ -2,8 +2,8 @@ unique_copy - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -56,14 +56,14 @@ value type.

- + Definition

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

- + Requirements

@@ -71,53 +71,53 @@

  • -SinglePassRange is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange is + a model of the Single + Pass Range Concept. +
  • -SinglePassRange is - mutable. -
  • + SinglePassRange is + mutable. +
  • -SinglePassRange's value - type is a model of the EqualityComparableConcept. -
  • + SinglePassRange's + value type is a model of the EqualityComparableConcept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +

For the predicate versions of unique:

  • -SinglePassRange is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange is + a model of the Single + Pass Range Concept. +
  • -SinglePassRange is - mutable. -
  • + SinglePassRange is + mutable. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -SinglePassRange's value - type is convertible to BinaryPredicate's - first argument type and to BinaryPredicate's - second argument type. -
  • + SinglePassRange's + value type is convertible to BinaryPredicate's + first argument type and to BinaryPredicate's + second argument type. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
- + Complexity

@@ -137,7 +137,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new.html b/doc/html/range/reference/algorithms/new.html index d07ac11..2fc36d9 100644 --- a/doc/html/range/reference/algorithms/new.html +++ b/doc/html/range/reference/algorithms/new.html @@ -2,8 +2,8 @@ New algorithms - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -51,7 +51,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/copy_n.html b/doc/html/range/reference/algorithms/new/copy_n.html index b84b29e..0a6c5cc 100644 --- a/doc/html/range/reference/algorithms/new/copy_n.html +++ b/doc/html/range/reference/algorithms/new/copy_n.html @@ -2,8 +2,8 @@ copy_n - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -39,7 +39,7 @@

- + Description

@@ -53,33 +53,33 @@ from [boost::begin(rng), boost::begin(rng) + n) to the range [out, out + n)

- + Definition

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

- + Requirements
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -Size is a model of - the Integer Concept. -
  4. + Size is a model of + the Integer Concept. +
  5. -OutputIterator is a - model of the OutputIteratorConcept. -
  6. + OutputIterator is + a model of the OutputIteratorConcept. +
- + Complexity

@@ -97,7 +97,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/erase.html b/doc/html/range/reference/algorithms/new/erase.html index 47a5197..346a24e 100644 --- a/doc/html/range/reference/algorithms/new/erase.html +++ b/doc/html/range/reference/algorithms/new/erase.html @@ -2,8 +2,8 @@ erase - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -41,7 +41,7 @@

- + Description

@@ -58,22 +58,22 @@ 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. -Container supports - erase of an iterator range. -
+ Container supports + erase of an iterator range. +
- + Complexity

@@ -90,7 +90,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/for_each.html b/doc/html/range/reference/algorithms/new/for_each.html index c9c5db1..8983318 100644 --- a/doc/html/range/reference/algorithms/new/for_each.html +++ b/doc/html/range/reference/algorithms/new/for_each.html @@ -2,8 +2,8 @@ for_each - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -72,7 +72,7 @@

- + Description

@@ -88,44 +88,44 @@ 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
  1. -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  3. -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  4. + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  5. -BinaryFunction is a - model of the BinaryFunctionConcept. -
  6. + BinaryFunction is + a model of the BinaryFunctionConcept. +
  7. -SinglePassRange1's - value type is convertible to BinaryFunction's - first argument type. -
  8. + SinglePassRange1's + value type is convertible to BinaryFunction's + first argument type. +
  9. -SinglepassRange2's - value type is convertible to BinaryFunction's - second argument type. -
  10. + SinglepassRange2's + value type is convertible to BinaryFunction's + second argument type. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/insert.html b/doc/html/range/reference/algorithms/new/insert.html index 013ca65..7da8357 100644 --- a/doc/html/range/reference/algorithms/new/insert.html +++ b/doc/html/range/reference/algorithms/new/insert.html @@ -2,8 +2,8 @@ insert - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -54,34 +54,34 @@ target.

- + Definition

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

- + Requirements
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -Container supports - insert at a specified position. -
  4. + Container supports + insert at a specified position. +
  5. -SinglePassRange's value - type is convertible to Container's - value type. -
  6. + SinglePassRange's + value type is convertible to Container's + value type. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/iota.html b/doc/html/range/reference/algorithms/new/iota.html index 00613b2..8693b0b 100644 --- a/doc/html/range/reference/algorithms/new/iota.html +++ b/doc/html/range/reference/algorithms/new/iota.html @@ -2,8 +2,8 @@ iota - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -39,7 +39,7 @@

- + Description

@@ -50,29 +50,30 @@ + boost::distance(boost::begin(rng), it)

- + Definition

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

- + Requirements
  1. -ForwardRange is a model - of the Forward Range - Concept. -
  2. + ForwardRange is a + model of the Forward + Range Concept. +
  3. -Value is a model of - the Incrementable Concept. -
  4. + Value is a model + of the Incrementable + Concept. +
- + Complexity

@@ -89,7 +90,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/is_sorted.html b/doc/html/range/reference/algorithms/new/is_sorted.html index 167665d..f5a2462 100644 --- a/doc/html/range/reference/algorithms/new/is_sorted.html +++ b/doc/html/range/reference/algorithms/new/is_sorted.html @@ -2,8 +2,8 @@ is_sorted - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -58,34 +58,34 @@ is true.

- + Definition

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

- + Requirements
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -BinaryPredicate is - a model of the BinaryPredicate - Concept. -
  4. + BinaryPredicate is + a model of the BinaryPredicate + Concept. +
  5. - The value type of SinglePassRange - is convertible to both argument types of BinaryPredicate. -
  6. + The value type of SinglePassRange + is convertible to both argument types of BinaryPredicate. +
- + Complexity

@@ -102,7 +102,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/overwrite.html b/doc/html/range/reference/algorithms/new/overwrite.html index 3ef0cfb..6072237 100644 --- a/doc/html/range/reference/algorithms/new/overwrite.html +++ b/doc/html/range/reference/algorithms/new/overwrite.html @@ -2,8 +2,8 @@ overwrite - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -52,41 +52,43 @@ into the range to.

- + Definition

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

- + Requirements
  1. -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  3. -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  4. + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  5. -SinglePassRange2 is - mutable. -
  6. -
  7. distance(SinglePassRange1) - <= distance(SinglePassRange2)
  8. + SinglePassRange2 + is mutable. +
  9. -SinglePassRange1's - value type is convertible to SinglePassRange2's - value type. -
  10. + distance(SinglePassRange1) + <= distance(SinglePassRange2) + +
  11. + SinglePassRange1's + value type is convertible to SinglePassRange2's + value type. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/push_back.html b/doc/html/range/reference/algorithms/new/push_back.html index b5a0ff1..ecd5949 100644 --- a/doc/html/range/reference/algorithms/new/push_back.html +++ b/doc/html/range/reference/algorithms/new/push_back.html @@ -2,8 +2,8 @@ push_back - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -52,34 +52,34 @@ to the back of the container target.

- + Definition

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

- + Requirements
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -Container supports - insert at end(). -
  4. + Container supports + insert at end(). +
  5. -SinglePassRange's value - type is convertible to Container's - value type. -
  6. + SinglePassRange's + value type is convertible to Container's + value type. +
- + Complexity

@@ -97,7 +97,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/push_front.html b/doc/html/range/reference/algorithms/new/push_front.html index a8b3381..13e2fe4 100644 --- a/doc/html/range/reference/algorithms/new/push_front.html +++ b/doc/html/range/reference/algorithms/new/push_front.html @@ -2,8 +2,8 @@ push_front - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -52,34 +52,34 @@ to the front of the container target.

- + Definition

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

- + Requirements
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -Container supports - insert at begin(). -
  4. + Container supports + insert at begin(). +
  5. -SinglePassRange's value - type is convertible to Container's - value type. -
  6. + SinglePassRange's + value type is convertible to Container's + value type. +
- + Complexity

@@ -97,7 +97,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/remove_erase.html b/doc/html/range/reference/algorithms/new/remove_erase.html index 6dd59be..0982bc7 100644 --- a/doc/html/range/reference/algorithms/new/remove_erase.html +++ b/doc/html/range/reference/algorithms/new/remove_erase.html @@ -2,8 +2,8 @@ remove_erase - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -50,22 +50,22 @@ algorithm which merely rearranges elements.

- + Definition

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

- + Requirements
  1. -Container supports - erase of an iterator range. -
+ Container supports + erase of an iterator range. +
- + Complexity

@@ -82,7 +82,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/new/remove_erase_if.html b/doc/html/range/reference/algorithms/new/remove_erase_if.html index ab20e8f..b9f2d9a 100644 --- a/doc/html/range/reference/algorithms/new/remove_erase_if.html +++ b/doc/html/range/reference/algorithms/new/remove_erase_if.html @@ -2,8 +2,8 @@ remove_erase_if - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -41,7 +41,7 @@

- + Description

@@ -52,28 +52,28 @@ algorithm which merely rearranges elements.

- + Definition

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

- + Requirements
  1. -Container supports - erase of an iterator range. -
  2. + Container supports + erase of an iterator range. +
  3. -Pred is a model of - the Predicate Concept. -
  4. + Pred is a model of + the Predicate Concept. +
- + Complexity

@@ -90,7 +90,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating.html b/doc/html/range/reference/algorithms/non_mutating.html index f25a857..ef22f2d 100644 --- a/doc/html/range/reference/algorithms/non_mutating.html +++ b/doc/html/range/reference/algorithms/non_mutating.html @@ -2,8 +2,8 @@ Non-mutating algorithms - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Non-mutating algorithms @@ -75,7 +75,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/adjacent_find.html b/doc/html/range/reference/algorithms/non_mutating/adjacent_find.html index 4bece6d..c909827 100644 --- a/doc/html/range/reference/algorithms/non_mutating/adjacent_find.html +++ b/doc/html/range/reference/algorithms/non_mutating/adjacent_find.html @@ -2,8 +2,8 @@ adjacent_find - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -113,37 +113,37 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange's value - type is a model of the EqualityComparableConcept. -
  • + ForwardRange's value + type is a model of the EqualityComparableConcept. +

For the predicate versions of adjacent_find:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -ForwardRange's value - type is convertible to BinaryPredicate's - first argument type and to BinaryPredicate's - second argument type. -
  • + ForwardRange's value + type is convertible to BinaryPredicate's + first argument type and to BinaryPredicate's + second argument type. +
- + Complexity

@@ -162,7 +162,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/binary_search.html b/doc/html/range/reference/algorithms/non_mutating/binary_search.html index fcbbbbb..96c6476 100644 --- a/doc/html/range/reference/algorithms/non_mutating/binary_search.html +++ b/doc/html/range/reference/algorithms/non_mutating/binary_search.html @@ -2,8 +2,8 @@ binary_search - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -68,50 +68,50 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -Value is a model of - the LessThanComparableConcept. -
  • + Value is a model + of the LessThanComparableConcept. +
  • - The ordering of objects of type Value - is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type Value + is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • -ForwardRange's value - type is the same type as Value. -
  • + ForwardRange's value + type is the same type as Value. +

For the predicate versions of binary_search:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -ForwardRange's value - type is the same type as Value. -
  • + ForwardRange's value + type is the same type as Value. +
  • -ForwardRange's value - type is convertible to BinaryPredicate's - argument type. -
  • + ForwardRange's value + type is convertible to BinaryPredicate's + argument type. +
- + Precondition:

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

- + Complexity

@@ -151,7 +151,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/count.html b/doc/html/range/reference/algorithms/non_mutating/count.html index e1b7195..1360a5c 100644 --- a/doc/html/range/reference/algorithms/non_mutating/count.html +++ b/doc/html/range/reference/algorithms/non_mutating/count.html @@ -2,8 +2,8 @@ count - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -54,37 +54,37 @@ is true.

- + Definition

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

- + Requirements
  • -SinglePassRange is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange is + a model of the Single + Pass Range Concept. +
  • -Value is a model of - the EqualityComparableConcept. -
  • + Value is a model + of the EqualityComparableConcept. +
  • -SinglePassRange's value - type is a model of the EqualityComparableConcept. -
  • + SinglePassRange's + value type is a model of the EqualityComparableConcept. +
  • - An object of SinglePassRange's - value type can be compared for equality with an object of type Value. -
  • + An object of SinglePassRange's + value type can be compared for equality with an object of type Value. +
- + Complexity

@@ -101,7 +101,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/count_if.html b/doc/html/range/reference/algorithms/non_mutating/count_if.html index 53b05ad..5e6e850 100644 --- a/doc/html/range/reference/algorithms/non_mutating/count_if.html +++ b/doc/html/range/reference/algorithms/non_mutating/count_if.html @@ -2,8 +2,8 @@ count_if - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -41,7 +41,7 @@

- + Description

@@ -51,37 +51,37 @@ is true.

- + Definition

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

- + Requirements
  • -SinglePassRange is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange is + a model of the Single + Pass Range Concept. +
  • -UnaryPredicate is a - model of the UnaryPredicateConcept. -
  • + UnaryPredicate is + a model of the UnaryPredicateConcept. +
  • -SinglePassRange's value - type is a model of the EqualityComparableConcept. -
  • + SinglePassRange's + value type is a model of the EqualityComparableConcept. +
  • - The value type of SinglePassRange - is convertible to the argument type of UnaryPredicate. -
  • + The value type of SinglePassRange + is convertible to the argument type of UnaryPredicate. +
- + Complexity

@@ -98,7 +98,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/equal.html b/doc/html/range/reference/algorithms/non_mutating/equal.html index 6f0e022..0556a2a 100644 --- a/doc/html/range/reference/algorithms/non_mutating/equal.html +++ b/doc/html/range/reference/algorithms/non_mutating/equal.html @@ -2,8 +2,8 @@ equal - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -52,7 +52,7 @@

- + Description

@@ -70,14 +70,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

@@ -85,60 +85,60 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange1's - value type is a model of the EqualityComparableConcept. -
  • + SinglePassRange1's + value type is a model of the EqualityComparableConcept. +
  • -SinglePassRange2's - value type is a model of the EqualityComparableConcept. -
  • + SinglePassRange2's + value type is a model of the EqualityComparableConcept. +
  • -SinglePassRange1's - value type can be compared for equality with SinglePassRange2's - value type. -
  • + SinglePassRange1's + value type can be compared for equality with SinglePassRange2's + value type. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument type. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument type. +
- + Complexity

@@ -156,7 +156,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/equal_range.html b/doc/html/range/reference/algorithms/non_mutating/equal_range.html index 7aa0fc1..766ee8a 100644 --- a/doc/html/range/reference/algorithms/non_mutating/equal_range.html +++ b/doc/html/range/reference/algorithms/non_mutating/equal_range.html @@ -2,8 +2,8 @@ equal_range - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -100,50 +100,50 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -Value is a model of - the LessThanComparableConcept. -
  • + Value is a model + of the LessThanComparableConcept. +
  • - The ordering of objects of type Value - is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type Value + is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • -ForwardRange's value - type is the same type as Value. -
  • + ForwardRange's value + type is the same type as Value. +

For the predicate versions:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -SortPredicate is a - model of the StrictWeakOrderingConcept. -
  • + SortPredicate is + a model of the StrictWeakOrderingConcept. +
  • -ForwardRange's value - type is the same as Value. -
  • + ForwardRange's value + type is the same as Value. +
  • -ForwardRange's value - type is convertible to both of SortPredicate's - argument types. -
  • + ForwardRange's value + type is convertible to both of SortPredicate's + argument types. +
- + Precondition:

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

- + Complexity

@@ -173,7 +173,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/find.html b/doc/html/range/reference/algorithms/non_mutating/find.html index 485e44a..80ac8a1 100644 --- a/doc/html/range/reference/algorithms/non_mutating/find.html +++ b/doc/html/range/reference/algorithms/non_mutating/find.html @@ -2,8 +2,8 @@ find - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -59,35 +59,35 @@ same manner as the returned iterator described above.

- + Definition

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

- + Requirements
  • -SinglePassRange is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange is + a model of the Single + Pass Range Concept. +
  • -Value is a model of - the EqualityComparableConcept. -
  • + Value is a model + of the EqualityComparableConcept. +
  • - The operator== - is defined for type Value - to be compared with the SinglePassRange's - value type. -
  • + The operator== + is defined for type Value + to be compared with the SinglePassRange's + value type. +
- + Complexity

@@ -104,7 +104,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/find_end.html b/doc/html/range/reference/algorithms/non_mutating/find_end.html index f11bb47..40847b3 100644 --- a/doc/html/range/reference/algorithms/non_mutating/find_end.html +++ b/doc/html/range/reference/algorithms/non_mutating/find_end.html @@ -2,8 +2,8 @@ find_end - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -96,59 +96,59 @@

  • -ForwardRange1 is a - model of the Forward Range - Concept. -
  • + ForwardRange1 is + a model of the Forward + Range Concept. +
  • -ForwardRange2 is a - model of the Forward Range - Concept. -
  • + ForwardRange2 is + a model of the Forward + Range Concept. +
  • -ForwardRange1's value - type is a model of the EqualityComparableConcept. -
  • + ForwardRange1's value + type is a model of the EqualityComparableConcept. +
  • -ForwardRange2's value - type is a model of the EqualityComparableConcept. -
  • + ForwardRange2's value + type is a model of the EqualityComparableConcept. +
  • - Objects of ForwardRange1's - value type can be compared for equality with objects of ForwardRange2's value type. -
  • + Objects of ForwardRange1's + value type can be compared for equality with objects of ForwardRange2's value type. +

For the predicate versions:

  • -ForwardRange1 is a - model of the Forward Range - Concept. -
  • + ForwardRange1 is + a model of the Forward + Range Concept. +
  • -ForwardRange2 is a - model of the Forward Range - Concept. -
  • + ForwardRange2 is + a model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -ForwardRange1's value - type is convertible to BinaryPredicate's - first argument type. -
  • + ForwardRange1's value + type is convertible to BinaryPredicate's + first argument type. +
  • -ForwardRange2's value - type is convertible to BinaryPredicate's - second argument type. -
  • + ForwardRange2's value + type is convertible to BinaryPredicate's + second argument type. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/find_first_of.html b/doc/html/range/reference/algorithms/non_mutating/find_first_of.html index 972690f..ab764df 100644 --- a/doc/html/range/reference/algorithms/non_mutating/find_first_of.html +++ b/doc/html/range/reference/algorithms/non_mutating/find_first_of.html @@ -2,8 +2,8 @@ find_first_of - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -101,53 +101,53 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -ForwardRange2 is a - model of the Forward Range - Concept. -
  • + ForwardRange2 is + a model of the Forward + Range Concept. +
  • -SinglePassRange1's - value type is a model of the EqualityComparableConcept, - and can be compared for equality with ForwardRange2's - value type. -
  • + SinglePassRange1's + value type is a model of the EqualityComparableConcept, + and can be compared for equality with ForwardRange2's + value type. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -ForwardRange2 is a - model of the Forward Range - Concept. -
  • + ForwardRange2 is + a model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -ForwardRange2's value - type is convertible to BinaryPredicate's - second argument type. -
  • + ForwardRange2's value + type is convertible to BinaryPredicate's + second argument type. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/find_if.html b/doc/html/range/reference/algorithms/non_mutating/find_if.html index 59ab8d3..caa16d2 100644 --- a/doc/html/range/reference/algorithms/non_mutating/find_if.html +++ b/doc/html/range/reference/algorithms/non_mutating/find_if.html @@ -2,8 +2,8 @@ find_if - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -64,33 +64,33 @@ 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
  • -SinglePassRange is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange is + a model of the Single + Pass Range Concept. +
  • -UnaryPredicate is a - model of the PredicateConcept. -
  • + UnaryPredicate is + a model of the PredicateConcept. +
  • - The value type of SinglePassRange - is convertible to the argument type of UnaryPredicate. -
  • + The value type of SinglePassRange + is convertible to the argument type of UnaryPredicate. +
- + Precondition:

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

- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/for_each.html b/doc/html/range/reference/algorithms/non_mutating/for_each.html index 7d8792f..c8584f7 100644 --- a/doc/html/range/reference/algorithms/non_mutating/for_each.html +++ b/doc/html/range/reference/algorithms/non_mutating/for_each.html @@ -2,8 +2,8 @@ for_each - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements
  • -SinglePassRange is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange is + a model of the Single + Pass Range Concept. +
  • -UnaryFunction is a - model of the UnaryFunctionConcept. -
  • + UnaryFunction is + a model of the UnaryFunctionConcept. +
  • -UnaryFunction does - not apply any non-constant operation through its argument. -
  • + UnaryFunction does + not apply any non-constant operation through its argument. +
  • -SinglePassRange's value - type is convertible to UnaryFunction's - argument type. -
  • + SinglePassRange's + value type is convertible to UnaryFunction's + argument type. +
- + Complexity

@@ -107,7 +107,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/lexicographical_compare.html b/doc/html/range/reference/algorithms/non_mutating/lexicographical_compare.html index e3e37ef..257ab7b 100644 --- a/doc/html/range/reference/algorithms/non_mutating/lexicographical_compare.html +++ b/doc/html/range/reference/algorithms/non_mutating/lexicographical_compare.html @@ -2,8 +2,8 @@ lexicographical_compare - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -88,64 +88,64 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange1's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange1's + value type is a model of the LessThanComparableConcept. +
  • -SinglePassRange2's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange2's + value type is a model of the LessThanComparableConcept. +
  • - Let x be an object - of SinglePassRange1's - value type. Let y be - an obect of SinglePassRange2's - value type. x < - y must be valid. y < - x must be valid. -
  • + Let x be an object + of SinglePassRange1's + value type. Let y + be an obect of SinglePassRange2's + value type. x < + y must be valid. y < + x must be valid. +

For the predicate versions of lexicographical_compare:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument type. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument type. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/lower_bound.html b/doc/html/range/reference/algorithms/non_mutating/lower_bound.html index f18a5bc..0f92df5 100644 --- a/doc/html/range/reference/algorithms/non_mutating/lower_bound.html +++ b/doc/html/range/reference/algorithms/non_mutating/lower_bound.html @@ -2,8 +2,8 @@ lower_bound - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -87,50 +87,50 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -Value is a model of - the LessThanComparableConcept. -
  • + Value is a model + of the LessThanComparableConcept. +
  • - The ordering of objects of type Value - is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type Value + is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • -ForwardRange's value - type is the same type as Value. -
  • + ForwardRange's value + type is the same type as Value. +

For the predicate versions:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -ForwardRange's value - type is the same type as Value. -
  • + ForwardRange's value + type is the same type as Value. +
  • -ForwardRange's value - type is convertible to both of BinaryPredicate's - argument types. -
  • + ForwardRange's value + type is convertible to both of BinaryPredicate's + argument types. +
- + Precondition:

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

- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/max_element.html b/doc/html/range/reference/algorithms/non_mutating/max_element.html index 9216f88..173b281 100644 --- a/doc/html/range/reference/algorithms/non_mutating/max_element.html +++ b/doc/html/range/reference/algorithms/non_mutating/max_element.html @@ -2,8 +2,8 @@ max_element - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -113,36 +113,36 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange's value - type is a model of the LessThanComparableConcept. -
  • + ForwardRange's value + type is a model of the LessThanComparableConcept. +

For the predicate versions:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -ForwardRange's value - type is convertible to both of BinaryPredicate's - argument types. -
  • + ForwardRange's value + type is convertible to both of BinaryPredicate's + argument types. +
- + Complexity

@@ -160,7 +160,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/min_element.html b/doc/html/range/reference/algorithms/non_mutating/min_element.html index 4abd6a8..14f7973 100644 --- a/doc/html/range/reference/algorithms/non_mutating/min_element.html +++ b/doc/html/range/reference/algorithms/non_mutating/min_element.html @@ -2,8 +2,8 @@ min_element - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -113,36 +113,36 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange's value - type is a model of the LessThanComparableConcept. -
  • + ForwardRange's value + type is a model of the LessThanComparableConcept. +

For the predicate versions:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -ForwardRange's value - type is convertible to both of BinaryPredicate's - argument types. -
  • + ForwardRange's value + type is convertible to both of BinaryPredicate's + argument types. +
- + Complexity

@@ -160,7 +160,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/mismatch.html b/doc/html/range/reference/algorithms/non_mutating/mismatch.html index d740dce..0ae3639 100644 --- a/doc/html/range/reference/algorithms/non_mutating/mismatch.html +++ b/doc/html/range/reference/algorithms/non_mutating/mismatch.html @@ -2,8 +2,8 @@ mismatch - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -118,14 +118,14 @@ Equality is determined by operator== for non-predicate versions of mismatch, and by satisfying pred in the predicate versions.

- + Definition

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

- + Requirements

@@ -133,67 +133,67 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange1's - value type is a model of the EqualityComparableConcept. -
  • + SinglePassRange1's + value type is a model of the EqualityComparableConcept. +
  • -SinglePassRange2's - value type is a model of the EqualityComparableConcept. -
  • + SinglePassRange2's + value type is a model of the EqualityComparableConcept. +
  • -SinglePassRange1s value - type can be compared for equality with SinglePassRange2's - value type. -
  • + SinglePassRange1s + value type can be compared for equality with SinglePassRange2's + value type. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument type. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument type. +
- + Precondition:

distance(rng2) >= distance(rng1)

- + Complexity

@@ -210,7 +210,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/search.html b/doc/html/range/reference/algorithms/non_mutating/search.html index 9746802..9c4f86a 100644 --- a/doc/html/range/reference/algorithms/non_mutating/search.html +++ b/doc/html/range/reference/algorithms/non_mutating/search.html @@ -2,8 +2,8 @@ search - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -130,60 +130,60 @@

  • -ForwardRange1 is a - model of the Forward Range - Concept. -
  • + ForwardRange1 is + a model of the Forward + Range Concept. +
  • -ForwardRange2 is a - model of the Forward Range - Concept. -
  • + ForwardRange2 is + a model of the Forward + Range Concept. +
  • -ForwardRange1's value - type is a model of the EqualityComparableConcept. -
  • + ForwardRange1's value + type is a model of the EqualityComparableConcept. +
  • -ForwardRange2's value - type is a model of the EqualityComparableConcept. -
  • + ForwardRange2's value + type is a model of the EqualityComparableConcept. +
  • -ForwardRange1s value - type can be compared for equality with ForwardRange2's - value type. -
  • + ForwardRange1s value + type can be compared for equality with ForwardRange2's + value type. +

For the predicate versions:

  • -ForwardRange1 is a - model of the Forward Range - Concept. -
  • + ForwardRange1 is + a model of the Forward + Range Concept. +
  • -ForwardRange2 is a - model of the Forward Range - Concept. -
  • + ForwardRange2 is + a model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -ForwardRange1's value - type is convertible to BinaryPredicate's - first argument type. -
  • + ForwardRange1's value + type is convertible to BinaryPredicate's + first argument type. +
  • -ForwardRange2's value - type is convertible to BinaryPredicate's - second argument type. -
  • + ForwardRange2's value + type is convertible to BinaryPredicate's + second argument type. +
- + Complexity

@@ -200,7 +200,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/search_n.html b/doc/html/range/reference/algorithms/non_mutating/search_n.html index 2b94b7f..1961ecf 100644 --- a/doc/html/range/reference/algorithms/non_mutating/search_n.html +++ b/doc/html/range/reference/algorithms/non_mutating/search_n.html @@ -2,8 +2,8 @@ search_n - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -64,14 +64,14 @@ and by a predicate when one is supplied.

- + Definition

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

- + Requirements

@@ -79,53 +79,53 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -ForwardRange's value - type is a model of the EqualityComparableConcept. -
  • + ForwardRange's value + type is a model of the EqualityComparableConcept. +
  • -ForwardRanges value - type can be compared for equality with Value. -
  • + ForwardRanges value + type can be compared for equality with Value. +
  • -Integer is a model - of the IntegerConcept. -
  • + Integer is a model + of the IntegerConcept. +

For the predicate versions:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the BinaryPredicateConcept. -
  • + BinaryPredicate is + a model of the BinaryPredicateConcept. +
  • -ForwardRange's value - type is convertible to BinaryPredicate's - first argument type. -
  • + ForwardRange's value + type is convertible to BinaryPredicate's + first argument type. +
  • -Value is convertible - to BinaryPredicate's - second argument type. -
  • + Value is convertible + to BinaryPredicate's + second argument type. +
  • -Integer is a model - of the IntegerConcept. -
  • + Integer is a model + of the IntegerConcept. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/non_mutating/upper_bound.html b/doc/html/range/reference/algorithms/non_mutating/upper_bound.html index 1bf73d6..0ef9e03 100644 --- a/doc/html/range/reference/algorithms/non_mutating/upper_bound.html +++ b/doc/html/range/reference/algorithms/non_mutating/upper_bound.html @@ -2,8 +2,8 @@ upper_bound - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -86,50 +86,50 @@

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -Value is a model of - the LessThanComparableConcept. -
  • + Value is a model + of the LessThanComparableConcept. +
  • - The ordering of objects of type Value - is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type Value + is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • -ForwardRange's value - type is the same type as Value. -
  • + ForwardRange's value + type is the same type as Value. +

For the predicate versions:

  • -ForwardRange is a model - of the Forward Range - Concept. -
  • + ForwardRange is a + model of the Forward + Range Concept. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -ForwardRange's value - type is the same type as Value. -
  • + ForwardRange's value + type is the same type as Value. +
  • -ForwardRange's value - type is convertible to both of BinaryPredicate's - argument types. -
  • + ForwardRange's value + type is convertible to both of BinaryPredicate's + argument types. +
- + Precondition:

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

- + Complexity

@@ -167,7 +167,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/numeric.html b/doc/html/range/reference/algorithms/numeric.html index 90818fa..99b3631 100644 --- a/doc/html/range/reference/algorithms/numeric.html +++ b/doc/html/range/reference/algorithms/numeric.html @@ -2,8 +2,8 @@ Numeric algorithms - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -46,7 +46,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/numeric/accumulate.html b/doc/html/range/reference/algorithms/numeric/accumulate.html index 4ba0962..6ea2097 100644 --- a/doc/html/range/reference/algorithms/numeric/accumulate.html +++ b/doc/html/range/reference/algorithms/numeric/accumulate.html @@ -2,8 +2,8 @@ accumulate - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -52,7 +52,7 @@

- + Description

@@ -63,77 +63,77 @@ 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
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -Value is a model of - the AssignableConcept. -
  4. + Value is a model + of the AssignableConcept. +
  5. - An operator+ - is defined for a left-hand operand of type Value - and a right-hand operance of the SinglePassRange - value type. -
  6. + An operator+ + is defined for a left-hand operand of type Value + and a right-hand operance of the SinglePassRange + value type. +
  7. - The return type of the above operator is convertible to Value. -
  8. + The return type of the above operator is convertible to Value. +
- + For the second version
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -Value is a model of - the AssignableConcept. -
  4. + Value is a model + of the AssignableConcept. +
  5. -BinaryOperation is - a model of the BinaryFunctionConcept. -
  6. + BinaryOperation is + a model of the BinaryFunctionConcept. +
  7. -Value is convertible - to BinaryOperation's - first argument type. -
  8. + Value is convertible + to BinaryOperation's + first argument type. +
  9. -SinglePassRange's value - type is convertible to BinaryOperation's - second argument type. -
  10. + SinglePassRange's + value type is convertible to BinaryOperation's + second argument type. +
  11. - The return type of BinaryOperation - is convertible to Value. -
  12. + The return type of BinaryOperation + is convertible to Value. +
- + Complexity

@@ -150,7 +150,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/numeric/adjacent_difference.html b/doc/html/range/reference/algorithms/numeric/adjacent_difference.html index 5dff5f8..57d2bf8 100644 --- a/doc/html/range/reference/algorithms/numeric/adjacent_difference.html +++ b/doc/html/range/reference/algorithms/numeric/adjacent_difference.html @@ -2,8 +2,8 @@ adjacent_difference - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements
- + For the first version
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -OutputIterator is a - model of the OutputIteratorConcept. -
  4. + OutputIterator is + a model of the OutputIteratorConcept. +
  5. - If x and y are objects of SinglePassRange's - value type, then x - y - is defined. -
  6. + If x and y are objects of SinglePassRange's value type, then + x - + y is defined. +
  7. - The value type of SinglePassRange - is convertible to a type in OutputIterator's - set of value types. -
  8. + The value type of SinglePassRange + is convertible to a type in OutputIterator's + set of value types. +
  9. - The return type of x - y - is convertible to a type in OutputIterator's - set of value types. -
  10. + The return type of x - y + is convertible to a type in OutputIterator's + set of value types. +
- + For the second version
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -OutputIterator is a - model of the OutputIteratorConcept. -
  4. + OutputIterator is + a model of the OutputIteratorConcept. +
  5. -BinaryOperation is - a model of the BinaryFunctionConcept. -
  6. + BinaryOperation is + a model of the BinaryFunctionConcept. +
  7. - The value type of SinglePassRange - is convertible to BinaryOperation's - first and second argument types. -
  8. + The value type of SinglePassRange + is convertible to BinaryOperation's + first and second argument types. +
  9. - The value type of SinglePassRange - is convertible to a type in OutputIterator's - set of value types. -
  10. + The value type of SinglePassRange + is convertible to a type in OutputIterator's + set of value types. +
  11. - The result type of BinaryOperation - is convertible to a type in OutputIterator's - set of value types. -
  12. + The result type of BinaryOperation + is convertible to a type in OutputIterator's + set of value types. +
- + Precondition:

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

- + Complexity

@@ -173,7 +173,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/numeric/inner_product.html b/doc/html/range/reference/algorithms/numeric/inner_product.html index 7872880..76a07fc 100644 --- a/doc/html/range/reference/algorithms/numeric/inner_product.html +++ b/doc/html/range/reference/algorithms/numeric/inner_product.html @@ -2,8 +2,8 @@ inner_product - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements
- + For the first version
  1. -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  3. -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  4. + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  5. -Value is a model of - the AssignableConcept. -
  6. + Value is a model + of the AssignableConcept. +
  7. - If x is an object of - type Value, y is an object of SinglePassRange1's - value type, and z is - an object of SinglePassRange2's - value type, then x + y * z - is defined. -
  8. + If x is an object + of type Value, y is an object of SinglePassRange1's value type, + and z is an object + of SinglePassRange2's + value type, then x + y * z + is defined. +
  9. - The result type of the expression x - + y - * z - is convertible to Value. -
  10. + The result type of the expression x + + y + * z + is convertible to Value. +
- + For the second version
  1. -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  3. -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  4. + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  5. -Value is a model of - the AssignableConcept. -
  6. + Value is a model + of the AssignableConcept. +
  7. -BinaryOperation1 is - a model of the BinaryFunctionConcept. -
  8. + BinaryOperation1 + is a model of the BinaryFunctionConcept. +
  9. -BinaryOperation2 is - a model of the BinaryFunctionConcept. -
  10. + BinaryOperation2 + is a model of the BinaryFunctionConcept. +
  11. - The value type of SinglePassRange1 - is convertible to the first argument type of BinaryOperation2. -
  12. + The value type of SinglePassRange1 + is convertible to the first argument type of BinaryOperation2. +
  13. - The value type of SinglePassRange2 - is convertible to the second argument type of BinaryOperation2. -
  14. + The value type of SinglePassRange2 + is convertible to the second argument type of BinaryOperation2. +
  15. -Value is convertible - to the value type of BinaryOperation1. -
  16. + Value is convertible + to the value type of BinaryOperation1. +
  17. - The return type of BinaryOperation2 - is convertible to the second argument type of BinaryOperation1. -
  18. + The return type of BinaryOperation2 + is convertible to the second argument type of BinaryOperation1. +
  19. - The return type of BinaryOperation1 - is convertible to Value. -
  20. + The return type of BinaryOperation1 + is convertible to Value. +
- + Precondition:

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

- + Complexity

@@ -186,7 +186,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/numeric/partial_sum.html b/doc/html/range/reference/algorithms/numeric/partial_sum.html index cddd838..0967f12 100644 --- a/doc/html/range/reference/algorithms/numeric/partial_sum.html +++ b/doc/html/range/reference/algorithms/numeric/partial_sum.html @@ -2,8 +2,8 @@ partial_sum - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

@@ -58,77 +58,77 @@ 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
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -OutputIterator is a - model of the OutputIteratorConcept. -
  4. + OutputIterator is + a model of the OutputIteratorConcept. +
  5. - If x and y are objects of SinglePassRange's - value type, then x + y - is defined. -
  6. + If x and y are objects of SinglePassRange's value type, then + x + + y is defined. +
  7. - The return type of x + y - is convertible to the value type of SinglePassRange. -
  8. + The return type of x + y + is convertible to the value type of SinglePassRange. +
  9. - The value type of SinglePassRange - is convertible to a type in OutputIterator's - set of value types. -
  10. + The value type of SinglePassRange + is convertible to a type in OutputIterator's + set of value types. +
- + For the second version
  1. -SinglePassRange is - a model of the Single - Pass Range Concept. -
  2. + SinglePassRange is + a model of the Single + Pass Range Concept. +
  3. -OutputIterator is a - model of the OutputIteratorConcept. -
  4. + OutputIterator is + a model of the OutputIteratorConcept. +
  5. -BinaryOperation is - a model of the BinaryFunctionConcept. -
  6. + BinaryOperation is + a model of the BinaryFunctionConcept. +
  7. - The result type of BinaryOperation - is convertible to the value type of SinglePassRange. -
  8. + The result type of BinaryOperation + is convertible to the value type of SinglePassRange. +
  9. - The value type of SinglePassRange - is convertible to a type in OutputIterator's - set of value types. -
  10. + The value type of SinglePassRange + is convertible to a type in OutputIterator's + set of value types. +
- + Precondition:

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

- + Complexity

@@ -155,7 +155,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/permutation.html b/doc/html/range/reference/algorithms/permutation.html index c859468..cf2da0e 100644 --- a/doc/html/range/reference/algorithms/permutation.html +++ b/doc/html/range/reference/algorithms/permutation.html @@ -2,8 +2,8 @@ Permutation algorithms - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Permutation algorithms @@ -44,7 +44,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/permutation/next_permutation.html b/doc/html/range/reference/algorithms/permutation/next_permutation.html index 3f23383..c7533d7 100644 --- a/doc/html/range/reference/algorithms/permutation/next_permutation.html +++ b/doc/html/range/reference/algorithms/permutation/next_permutation.html @@ -2,8 +2,8 @@ next_permutation - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements

@@ -82,50 +82,50 @@

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

For the predicate versions:

  • -BidirectionalRange - is a model of the Bidirectional - Range Concept. -
  • + BidirectionalRange + is a model of the Bidirectional + Range Concept. +
  • -BidirectionalRange - is mutable. -
  • + BidirectionalRange + is mutable. +
  • -Compare is a model - of the StrictWeakOrderingConcept. -
  • + Compare is a model + of the StrictWeakOrderingConcept. +
  • -BidirectionalRange's - value type is convertible to both of Compare's - argument types. -
  • + BidirectionalRange's + value type is convertible to both of Compare's + argument types. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/permutation/prev_permutation.html b/doc/html/range/reference/algorithms/permutation/prev_permutation.html index 3cb4d46..090c6c0 100644 --- a/doc/html/range/reference/algorithms/permutation/prev_permutation.html +++ b/doc/html/range/reference/algorithms/permutation/prev_permutation.html @@ -2,8 +2,8 @@ prev_permutation - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements

@@ -82,50 +82,50 @@

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

For the predicate versions:

  • -BidirectionalRange - is a model of the Bidirectional - Range Concept. -
  • + BidirectionalRange + is a model of the Bidirectional + Range Concept. +
  • -BidirectionalRange - is mutable. -
  • + BidirectionalRange + is mutable. +
  • -Compare is a model - of the StrictWeakOrderingConcept. -
  • + Compare is a model + of the StrictWeakOrderingConcept. +
  • -BidirectionalRange's - value type is convertible to both of Compare's - argument types. -
  • + BidirectionalRange's + value type is convertible to both of Compare's + argument types. +
- + Complexity

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/range_algorithm_introduction.html b/doc/html/range/reference/algorithms/range_algorithm_introduction.html new file mode 100644 index 0000000..36667b3 --- /dev/null +++ b/doc/html/range/reference/algorithms/range_algorithm_introduction.html @@ -0,0 +1,257 @@ + + + +Introduction and motivation + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ In its most simple form a Range Algorithm + (or range-based algorithm) is simply an iterator-based algorithm where + the two iterator arguments have been replaced by + one range argument. For example, we may write +

+

+ +

+
#include <boost/range/algorithm.hpp>
+#include <vector>
+
+std::vector<int> vec = ...;
+boost::sort(vec);
+
+

+

+

+ instead of +

+

+ +

+
std::sort(vec.begin(), vec.end());
+
+

+

+

+ However, the return type of range algorithms is almost always different + from that of existing iterator-based algorithms. +

+

+ One group of algorithms, like boost::sort(), will simply return the same range so + that we can continue to pass the range around and/or further modify it. + Because of this we may write +

+
boost:unique(boost::sort(vec));
+
+

+ to first sort the range and then run unique() on the sorted range. +

+

+ Algorithms like boost::unique() + fall into another group of algorithms that return (potentially) narrowed + views of the original range. By default boost::unique(rng) returns the range [boost::begin(rng), found) + where found denotes the + iterator returned by std::unique(boost::begin(rng), boost::end(rng)) +

+

+ Therefore exactly the unique values can be copied by writing +

+
boost::copy(boost::unique(boost::sort(vec)),
+            std::ostream_iterator<int>(std::cout));
+
+

+

+

+ Algorithms like boost::unique usually return the same range: + [boost::begin(rng), found). However, this behaviour may be changed + by supplying the algorithms with a template argument: +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return +

+
+

+ boost::unique<boost::return_found>(rng) +

+
+

+ returns a single iterator like std::unique +

+
+

+ boost::unique<boost::return_begin_found>(rng) +

+
+

+ returns the range [boost::begin(rng), + found) + (this is the default) +

+
+

+ boost::unique<boost::return_begin_next>(rng) +

+
+

+ returns the range [boost::begin(rng), + boost::next(found)) +

+
+

+ boost::unique<boost::return_found_end>(rng) +

+
+

+ returns the range [found, + boost::end(rng)) +

+
+

+ boost::unique<boost::return_next_end>(rng) +

+
+

+ returns the range [boost::next(found),boost::end(rng)) +

+
+

+ boost::unique<boost::return_begin_end>(rng) +

+
+

+ returns the entire original range. +

+
+

+ This functionality has the following advantages: +

+
    +
  1. + it allows for seamless functional-style + programming where you do not need to use named + local variables to store intermediate results +
  2. +
  3. + it is very safe + because the algorithm can verify out-of-bounds conditions and handle + tricky conditions that lead to empty ranges +
  4. +
+

+ For example, consider how easy we may erase the duplicates in a sorted + container: +

+

+ +

+
std::vector<int> vec = ...;
+boost::erase(vec, boost::unique<boost::return_found_end>(boost::sort(vec)));
+
+

+

+

+ Notice the use of boost::return_found_end. + What if we wanted to erase all the duplicates except one of them? In old-fashined + STL-programming we might write +

+

+ +

+
// assume 'vec' is already sorted
+std::vector<int>::iterator i = std::unique(vec.begin(), vec.end());
+
+// remember this check or you get into problems
+if (i != vec.end())
+    ++i;
+
+vec.erase(i, vec.end());
+
+

+

+

+ The same task may be accomplished simply with +

+
boost::erase(vec, boost::unique<boost::return_next_end>(vec));
+
+

+ and there is no need to worry about generating an invalid range. Furthermore, + if the container is complex, calling vec.end() several times will be more expensive + than using a range algorithm. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/algorithms/set.html b/doc/html/range/reference/algorithms/set.html index 7de08c4..2e0ae8b 100644 --- a/doc/html/range/reference/algorithms/set.html +++ b/doc/html/range/reference/algorithms/set.html @@ -2,8 +2,8 @@ Set algorithms - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -46,7 +46,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/set/includes.html b/doc/html/range/reference/algorithms/set/includes.html index d03a126..0e7e4b6 100644 --- a/doc/html/range/reference/algorithms/set/includes.html +++ b/doc/html/range/reference/algorithms/set/includes.html @@ -2,8 +2,8 @@ includes - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -47,7 +47,7 @@

- + Description

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

- + Definition

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

- + Requirements

@@ -74,77 +74,77 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -SinglePassRange1's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange1's + value type is a model of the LessThanComparableConcept. +
  • -SinglePassRange2's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange2's + value type is a model of the LessThanComparableConcept. +
  • - The ordering of objects of type SinglePassRange1's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange1's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • - The ordering of objects of type SinglePassRange2's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange2's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument types. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument types. +
- + Precondition:

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

- + Complexity

@@ -180,7 +180,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/set/set_difference.html b/doc/html/range/reference/algorithms/set/set_difference.html index 3084d87..c53281e 100644 --- a/doc/html/range/reference/algorithms/set/set_difference.html +++ b/doc/html/range/reference/algorithms/set/set_difference.html @@ -2,8 +2,8 @@ set_difference - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -56,7 +56,7 @@

- + Description

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

- + Definition

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

- + Requirements

@@ -85,85 +85,85 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -SinglePassRange1's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange1's + value type is a model of the LessThanComparableConcept. +
  • -SinglePassRange2's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange2's + value type is a model of the LessThanComparableConcept. +
  • - The ordering of objects of type SinglePassRange1's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange1's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • - The ordering of objects of type SinglePassRange2's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange2's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument types. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument types. +
- + Precondition:

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

- + Complexity

@@ -199,7 +199,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/set/set_intersection.html b/doc/html/range/reference/algorithms/set/set_intersection.html index a817f35..b77838f 100644 --- a/doc/html/range/reference/algorithms/set/set_intersection.html +++ b/doc/html/range/reference/algorithms/set/set_intersection.html @@ -2,8 +2,8 @@ set_intersection - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -86,85 +86,85 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -SinglePassRange1's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange1's + value type is a model of the LessThanComparableConcept. +
  • -SinglePassRange2's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange2's + value type is a model of the LessThanComparableConcept. +
  • - The ordering of objects of type SinglePassRange1's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange1's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • - The ordering of objects of type SinglePassRange2's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange2's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument types. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument types. +
- + Precondition:

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

- + Complexity

@@ -200,7 +200,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/set/set_symmetric_difference.html b/doc/html/range/reference/algorithms/set/set_symmetric_difference.html index 659877c..bef721c 100644 --- a/doc/html/range/reference/algorithms/set/set_symmetric_difference.html +++ b/doc/html/range/reference/algorithms/set/set_symmetric_difference.html @@ -2,8 +2,8 @@ set_symmetric_difference - - + + @@ -13,22 +13,22 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + 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

@@ -90,85 +90,85 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -SinglePassRange1's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange1's + value type is a model of the LessThanComparableConcept. +
  • -SinglePassRange2's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange2's + value type is a model of the LessThanComparableConcept. +
  • - The ordering of objects of type SinglePassRange1's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange1's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • - The ordering of objects of type SinglePassRange2's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange2's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument types. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument types. +
- + Precondition:

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

- + Complexity

@@ -204,7 +204,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/algorithms/set/set_union.html b/doc/html/range/reference/algorithms/set/set_union.html index ccc1783..026159c 100644 --- a/doc/html/range/reference/algorithms/set/set_union.html +++ b/doc/html/range/reference/algorithms/set/set_union.html @@ -2,8 +2,8 @@ set_union - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

@@ -56,7 +56,7 @@

- + Description

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

- + Definition

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

- + Requirements

@@ -84,85 +84,85 @@

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -SinglePassRange1's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange1's + value type is a model of the LessThanComparableConcept. +
  • -SinglePassRange2's - value type is a model of the LessThanComparableConcept. -
  • + SinglePassRange2's + value type is a model of the LessThanComparableConcept. +
  • - The ordering of objects of type SinglePassRange1's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange1's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +
  • - The ordering of objects of type SinglePassRange2's - value type is a strict weak ordering, - as defined in the LessThanComparableConcept - requirements. -
  • + The ordering of objects of type SinglePassRange2's + value type is a strict weak ordering, + as defined in the LessThanComparableConcept + requirements. +

For the predicate versions:

  • -SinglePassRange1 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange1 + is a model of the Single + Pass Range Concept. +
  • -SinglePassRange2 is - a model of the Single - Pass Range Concept. -
  • + SinglePassRange2 + is a model of the Single + Pass Range Concept. +
  • -OutputIterator is a - model of the OutputIteratorConcept. -
  • + OutputIterator is + a model of the OutputIteratorConcept. +
  • -SinglePassRange1 and - SinglePassRange2 have - the same value type. -
  • + SinglePassRange1 + and SinglePassRange2 + have the same value type. +
  • -BinaryPredicate is - a model of the StrictWeakOrderingConcept. -
  • + BinaryPredicate is + a model of the StrictWeakOrderingConcept. +
  • -SinglePassRange1's - value type is convertible to BinaryPredicate's - first argument type. -
  • + SinglePassRange1's + value type is convertible to BinaryPredicate's + first argument type. +
  • -SinglePassRange2's - value type is convertible to BinaryPredicate's - second argument types. -
  • + SinglePassRange2's + value type is convertible to BinaryPredicate's + second argument types. +
- + Precondition:

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

- + Complexity

@@ -198,7 +198,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/concept_implementation.html b/doc/html/range/reference/concept_implementation.html index 0d150f3..f2c4792 100644 --- a/doc/html/range/reference/concept_implementation.html +++ b/doc/html/range/reference/concept_implementation.html @@ -2,8 +2,8 @@ Range concept implementation - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Range concept implementation @@ -42,7 +42,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/concept_implementation/semantics.html b/doc/html/range/reference/concept_implementation/semantics.html index 1493f51..59fc394 100644 --- a/doc/html/range/reference/concept_implementation/semantics.html +++ b/doc/html/range/reference/concept_implementation/semantics.html @@ -2,8 +2,8 @@ Semantics - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -31,7 +31,7 @@
Functions
- + notation
@@ -157,7 +157,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/concept_implementation/semantics/functions.html b/doc/html/range/reference/concept_implementation/semantics/functions.html index 0c0ef81..895d32d 100644 --- a/doc/html/range/reference/concept_implementation/semantics/functions.html +++ b/doc/html/range/reference/concept_implementation/semantics/functions.html @@ -2,8 +2,8 @@ Functions - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -402,7 +402,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/concept_implementation/semantics/metafunctions.html b/doc/html/range/reference/concept_implementation/semantics/metafunctions.html index 779a3b7..1a03534 100644 --- a/doc/html/range/reference/concept_implementation/semantics/metafunctions.html +++ b/doc/html/range/reference/concept_implementation/semantics/metafunctions.html @@ -2,8 +2,8 @@ Metafunctions - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -230,7 +230,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/concept_implementation/synopsis.html b/doc/html/range/reference/concept_implementation/synopsis.html index 9dffad1..9fdbc91 100644 --- a/doc/html/range/reference/concept_implementation/synopsis.html +++ b/doc/html/range/reference/concept_implementation/synopsis.html @@ -2,8 +2,8 @@ Synopsis - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -179,7 +179,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/extending.html b/doc/html/range/reference/extending.html index a9d7524..8ca7be8 100644 --- a/doc/html/range/reference/extending.html +++ b/doc/html/range/reference/extending.html @@ -2,8 +2,8 @@ Extending the library - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -45,7 +45,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/extending/method_1.html b/doc/html/range/reference/extending/method_1.html index 632687b..910d2de 100644 --- a/doc/html/range/reference/extending/method_1.html +++ b/doc/html/range/reference/extending/method_1.html @@ -2,8 +2,8 @@ Method 1: provide member functions and nested types - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Method 1: provide member functions and nested types @@ -155,7 +155,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/extending/method_2.html b/doc/html/range/reference/extending/method_2.html index f4f3524..3828c8b 100644 --- a/doc/html/range/reference/extending/method_2.html +++ b/doc/html/range/reference/extending/method_2.html @@ -2,8 +2,8 @@ Method 2: provide free-standing functions and specialize metafunctions - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Method 2: provide free-standing functions and specialize metafunctions @@ -261,7 +261,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/extending/method_3.html b/doc/html/range/reference/extending/method_3.html index f841237..2ec9d4d 100644 --- a/doc/html/range/reference/extending/method_3.html +++ b/doc/html/range/reference/extending/method_3.html @@ -2,8 +2,8 @@ Method 3: provide range adaptor implementations - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Method 3: provide range adaptor implementations @@ -44,7 +44,7 @@
-PrevUpHomeNext +PrevUpHomeNext
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 e995bee..3c038e6 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 @@ -2,8 +2,8 @@ Method 3.1: Implement a Range Adaptor without arguments - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
Method 3.1: Implement a Range Adaptor without arguments @@ -33,7 +33,7 @@

  1. - Provide a range for your return type, for example: + Provide a range for your return type, for example:
    #include <boost/range/iterator_range.hpp>
     #include <boost/iterator/reverse_iterator.hpp>
     
    @@ -57,17 +57,19 @@
         { }
     };
     
    -
  2. +
  3. - Provide a tag to uniquely identify your adaptor in the operator| - function overload set + Provide a tag to uniquely identify your adaptor in the operator| + function overload set
    namespace detail {
         struct reverse_forwarder {};
     }
     
    -
  4. +
  5. - Implement operator|
    template< class BidirectionalRng >
    +                Implement operator|
    +                
    +
    template< class BidirectionalRng >
     inline reverse_range<BidirectionalRng>
     operator|( BidirectionalRng& r, detail::reverse_forwarder )
     {
    @@ -81,7 +83,7 @@
     	return reverse_range<const BidirectionalRng>( r );
     }
     
    -
  6. +
@@ -94,7 +96,7 @@

-PrevUpHomeNext +PrevUpHomeNext
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 2a0be9d..1f2102d 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 @@ -2,8 +2,8 @@ Method 3.2: Implement a Range Adaptor with arguments - - + + @@ -13,23 +13,23 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
  1. - Provide a range for your return type, for example: + Provide a range for your return type, for example:
    #include <boost/range/adaptor/argument_fwd.hpp>
     #include <boost/range/iterator_range.hpp>
     #include <boost/iterator/transform_iterator.hpp>
    @@ -77,11 +77,11 @@
          }
      };
     
    -
  2. +
  3. - Implement a holder class to hold the arguments required to construct - the RangeAdaptor. -
  4. + Implement a holder class to hold the arguments required to construct + the RangeAdaptor. +

The holder combines multiple parameters into one that can be passed as @@ -104,8 +104,8 @@

  1. - Define an instance of the holder with the name of the adaptor -
+ Define an instance of the holder with the name of the adaptor +

@@ -115,8 +115,8 @@

  1. - Define operator| -
+ Define operator| +

@@ -149,7 +149,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/overview.html b/doc/html/range/reference/overview.html new file mode 100644 index 0000000..0005ece --- /dev/null +++ b/doc/html/range/reference/overview.html @@ -0,0 +1,70 @@ + + + +Overview + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Three types of objects are currently supported by the library: +

+
    +
  • + standard-like containers +
  • +
  • + std::pair<iterator,iterator> +
  • +
  • + built-in arrays +
  • +
+

+ Even though the behavior of the primary templates are exactly such that standard + containers will be supported by default, the requirements are much lower + than the standard container requirements. For example, the utility class + iterator_range + implements the minimal interface + required to make the class a Forward + Range. +

+

+ Please also see Range concepts for + more details. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/range/reference/ranges.html b/doc/html/range/reference/ranges.html index d1d6017..6f8c5af 100644 --- a/doc/html/range/reference/ranges.html +++ b/doc/html/range/reference/ranges.html @@ -2,8 +2,8 @@ Provided Ranges - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -42,7 +42,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/ranges/counting_range.html b/doc/html/range/reference/ranges/counting_range.html index 566a7f2..b1d7294 100644 --- a/doc/html/range/reference/ranges/counting_range.html +++ b/doc/html/range/reference/ranges/counting_range.html @@ -2,8 +2,8 @@ counting_range - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

Defined in header file boost/range/counting_range.hpp

- + Requirements
  1. -Incrementable is a model - of the Incrementable - Concept. -
+ Incrementable is a + model of the Incrementable + Concept. +
@@ -84,7 +84,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/ranges/irange.html b/doc/html/range/reference/ranges/irange.html index 358791b..da9b33a 100644 --- a/doc/html/range/reference/ranges/irange.html +++ b/doc/html/range/reference/ranges/irange.html @@ -2,8 +2,8 @@ irange - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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

- + Requirements
  1. -Integer is a model of - the Integer Concept. -
  2. + Integer is a model + of the Integer Concept. +
  3. -StepSize is a model of - the SignedInteger Concept. -
  4. + StepSize is a model + of the SignedInteger + Concept. +
- + Complexity

@@ -97,7 +98,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/ranges/istream_range.html b/doc/html/range/reference/ranges/istream_range.html index eda91a4..52bb89c 100644 --- a/doc/html/range/reference/ranges/istream_range.html +++ b/doc/html/range/reference/ranges/istream_range.html @@ -2,8 +2,8 @@ istream_range - - + + @@ -13,21 +13,21 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
- + Prototype

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

- + Description

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

- + Definition

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


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/utilities.html b/doc/html/range/reference/utilities.html index f2f39b2..45e60d3 100644 --- a/doc/html/range/reference/utilities.html +++ b/doc/html/range/reference/utilities.html @@ -2,8 +2,8 @@ Utilities - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -41,14 +41,14 @@

  • - Class iterator_range -
  • + Class iterator_range +
  • - Class sub_range -
  • + Class sub_range +
  • - Function join -
  • + Function join +

The iterator_range class @@ -77,7 +77,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/utilities/iterator_range.html b/doc/html/range/reference/utilities/iterator_range.html index a0fc0c0..27df4a0 100644 --- a/doc/html/range/reference/utilities/iterator_range.html +++ b/doc/html/range/reference/utilities/iterator_range.html @@ -2,8 +2,8 @@ Class iterator_range - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -48,7 +48,7 @@ type.

- + Synopsis

@@ -188,39 +188,26 @@ iterators from the same container.

- + Details member functions

operator unspecified_bool_type() const;

-
-

-

-

- Returns !empty(); -

-

-

-
+

+ Returns !empty(); +

bool equal( iterator_range& r ) const;

-
-

-

-

- Returns begin() - == r.begin() && - end() - == r.end(); -

-

-

-
+

+ Returns begin() == r.begin() && + end() + == r.end(); +

- + Details functions
@@ -229,45 +216,27 @@ l, const ForwardRange2& r );

-
-

-

-

- Returns size(l) != size(r) ? false : std::equal( - begin(l), end(l), begin(r) ); -

-

-

-
+

+ Returns size(l) != size(r) ? false + : std::equal( begin(l), end(l), begin(r) ); +

bool operator!=( const ForwardRange1& l, const ForwardRange2& r );

-
-

-

-

- Returns !( l == r ); -

-

-

-
+

+ Returns !( l == r ); +

bool operator<( const ForwardRange1& l, const ForwardRange2& r );

-
-

-

-

- Returns std::lexicographical_compare( - begin(l), end(l), begin(r), end(r) ); -

-

-

-
+

+ Returns std::lexicographical_compare( + begin(l), end(l), begin(r), end(r) ); +

@@ -277,15 +246,9 @@

-
-

-

-

- Effects: -

-

-

-
+

+ Effects: +

@@ -301,16 +264,10 @@ Sequence copy_range( const ForwardRange& r );

-
-

-

-

- Returns Sequence( - begin(r), end(r) ); -

-

-

-
+

+ Returns Sequence( + begin(r), end(r) ); +

@@ -322,7 +279,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/utilities/join.html b/doc/html/range/reference/utilities/join.html index 349f282..458ed2e 100644 --- a/doc/html/range/reference/utilities/join.html +++ b/doc/html/range/reference/utilities/join.html @@ -2,8 +2,8 @@ Function join - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -39,7 +39,7 @@ check if the end of a range has been reached internally during traversal.

- + Synposis

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

- + Example

@@ -83,7 +83,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/reference/utilities/sub_range.html b/doc/html/range/reference/utilities/sub_range.html index 8c75a91..684c838 100644 --- a/doc/html/range/reference/utilities/sub_range.html +++ b/doc/html/range/reference/utilities/sub_range.html @@ -2,8 +2,8 @@ Class sub_range - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -35,7 +35,7 @@ is.

- + Synopsis

@@ -117,7 +117,7 @@


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/range/style_guide.html b/doc/html/range/style_guide.html index c9f3e34..c5e6877 100644 --- a/doc/html/range/style_guide.html +++ b/doc/html/range/style_guide.html @@ -2,8 +2,8 @@ Terminology and style guidelines - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -39,31 +39,41 @@

  • -Value access category: -
      + Value access category: +
      • - Readable Range -
      • + Readable Range +
      • - Writeable Range -
      • + Writeable Range +
      • - Swappable Range -
      • + Swappable Range +
      • - Lvalue Range -
      • + Lvalue Range +
      - +
    • -Traversal category: -

      Notice how we have used the categories from the new @@ -77,11 +87,11 @@

      • - Random Access Readable Writeable Range -
      • + Random Access Readable Writeable Range +
      • - Forward Lvalue Range -
      • + Forward Lvalue Range +

      By convention, we should always specify the traversal @@ -135,7 +145,7 @@


      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/upgrade.html b/doc/html/range/upgrade.html index ad53c37..2e6a068 100644 --- a/doc/html/range/upgrade.html +++ b/doc/html/range/upgrade.html @@ -2,8 +2,8 @@ Upgrade version of Boost.Range - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +
      @@ -43,7 +43,7 @@
      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/upgrade/upgrade_from_1_34.html b/doc/html/range/upgrade/upgrade_from_1_34.html index 1275e9c..bc22cb6 100644 --- a/doc/html/range/upgrade/upgrade_from_1_34.html +++ b/doc/html/range/upgrade/upgrade_from_1_34.html @@ -2,8 +2,8 @@ Upgrade from version 1.34 - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +

      Upgrade from version 1.34 @@ -32,32 +32,34 @@

      1. - Direct support for character arrays was abandoned in favor of uniform treatment - of all arrays. Instead string algorithms can use the new function as_literal(). -
      2. + Direct support for character arrays was abandoned in favor of uniform + treatment of all arrays. Instead string algorithms can use the new function + as_literal(). +
      3. -size now requires a Random - Access Range. The old behavior is provided as distance(). -
      4. + size now requires a Random + Access Range. The old behavior is provided as distance(). +
      5. -range_size<T>::type has been completely removed in favor - of range_difference<T>::type -
      6. + range_size<T>::type has been completely removed in + favor of range_difference<T>::type +
      7. -boost_range_begin() - and boost_range_end() - have been renamed range_begin() and range_end() respectively. -
      8. + boost_range_begin() + and boost_range_end() + have been renamed range_begin() and range_end() respectively. +
      9. -range_result_iterator<T>::type and range_reverse_result_iterator<T>::type - have been renamed range_iterator<T>::type - and range_reverse_iterator<T>::type. -
      10. + range_result_iterator<T>::type + and range_reverse_result_iterator<T>::type + have been renamed range_iterator<T>::type + and range_reverse_iterator<T>::type. +
      11. - The procedure that makes a custom type work with the library has been greatly - simplified. See Extending the - library for UDTs for details. -
      12. + The procedure that makes a custom type work with the library has been + greatly simplified. See Extending + the library for UDTs for details. +

      @@ -70,7 +72,7 @@

      -PrevUpHomeNext +PrevUpHomeNext
      diff --git a/doc/html/range/upgrade/upgrade_from_1_42.html b/doc/html/range/upgrade/upgrade_from_1_42.html index 3fbc2d2..3174dc1 100644 --- a/doc/html/range/upgrade/upgrade_from_1_42.html +++ b/doc/html/range/upgrade/upgrade_from_1_42.html @@ -2,8 +2,8 @@ Upgrade from version 1.42 - - + + @@ -13,16 +13,16 @@ - +
      Boost C++ Libraries HomeLibrariesLibraries People FAQ More

      -PrevUpHomeNext +PrevUpHomeNext
      -
      +

      Upgrade from version 1.42 @@ -31,22 +31,26 @@ New features:

      Removed:

      1. -iterator_range no longer - has a is_singular member - function. The singularity restrictions have been removed from the iterator_range class since this added - restrictions to ranges of iterators whose default constructors were not - singular. Previously the is_singular - member function always returned false - in release build configurations, hence it is not anticipated that this - interface change will produce difficulty in upgrading. -
      + iterator_range no longer + has a is_singular member + function. The singularity restrictions have been removed from the iterator_range class since this added + restrictions to ranges of iterators whose default constructors were not + singular. Previously the is_singular + member function always returned false + in release build configurations, hence it is not anticipated that this + interface change will produce difficulty in upgrading. +

@@ -58,7 +62,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/introduction.qbk b/doc/introduction.qbk index c25eeae..7fc83df 100644 --- a/doc/introduction.qbk +++ b/doc/introduction.qbk @@ -12,62 +12,27 @@ The main advantages are * more flexible, compact and maintainable client code * safe use of built-in arrays (for legacy code; why else would you use built-in arrays?) -Below are given a small example (the complete example can be found [@http://www.boost.org/libs/range/test/algorithm_example.cpp here] ): - +[heading Example - Iterate over the values in a map] `` - // - // example: extracting bounds in a generic algorithm - // - template< class ForwardReadableRange, class T > - inline typename boost::range_iterator< ForwardReadableRange >::type - find( ForwardReadableRange& c, const T& value ) - { - return std::find( boost::begin( c ), boost::end( c ), value ); - } - - template< class ForwardReadableRange, class T > - inline typename boost::range_iterator< const ForwardReadableRange >::type - find( const ForwardReadableRange& c, const T& value ) - { - return std::find( boost::begin( c ), boost::end( c ), value ); - } - - // - // replace first value and return its index - // - template< class ForwardReadableWriteableRange, class T > - inline typename boost::range_size< ForwardReadableWriteableRange >::type - my_generic_replace( ForwardReadableWriteableRange& c, const T& value, const T& replacement ) - { - typename boost::range_iterator< ForwardReadableWriteableRange >::type found = find( c, value ); - - if( found != boost::end( c ) ) - *found = replacement; - return std::distance( boost::begin( c ), found ); - } - - // - // usage - // - const int N = 5; - std::vector my_vector; - int values[] = { 1,2,3,4,5,6,7,8,9 }; - - my_vector.assign( values, boost::end( values ) ); - typedef std::vector::iterator iterator; - std::pair my_view( boost::begin( my_vector ), - boost::begin( my_vector ) + N ); - char str_val[] = "a string"; - char* str = str_val; - - std::cout << my_generic_replace( my_vector, 4, 2 ); - std::cout << my_generic_replace( my_view, 4, 2 ); - std::cout << my_generic_replace( str, 'a', 'b' ); - - // prints '3', '5' and '0' +using namespace boost; +using namespace boost::adaptors; +for_each( my_map | map_values, fn ); `` -By using the free-standing functions and __metafunctions__, the code automatically works for all the types supported by this library; now and in the future. Notice that we have to provide two versions of `find()` since we cannot forward a non-const rvalue with reference arguments (see this article about __the_forwarding_problem__ ). +[heading Example - Iterate over the keys in a map] +`` +using namespace boost; +using namespace boost::adaptors; +for_each( my_map | map_keys, fn ); +`` + +[heading Example - Push the even values from a map in reverse order into the container `target`] +`` +using namespace boost; +using namespace boost::adaptors; +// Assume that is_even is a predicate that has been implemented elsewhere... +push_back(target, my_map | map_values | filtered(is_even()) | reversed); +`` [endsect] diff --git a/doc/reference/adaptors/adjacent_filtered.html b/doc/reference/adaptors/adjacent_filtered.html deleted file mode 100755 index a5da75a..0000000 --- a/doc/reference/adaptors/adjacent_filtered.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

adjacent_filtered

-
-
            rng | boost::adaptors::adjacent_filtered( bi_pred )
-        
-
            boost::make_adjacent_filtered_range( rng, bi_pred )
-        
-
-
    -
  • - Precondition: - The value-type of the range is convertible to both argument types - of bi_pred. -
  • -
  • - Postcondition: - For all adjacent elements [x,y] in the returned range, - bi_pred(x,y) is true. -
  • -
  • - Throws: - Whatever the copy-constructor of bi_pred might throw. -
  • -
  • - Range Category: - SinglePassRange -
  • -
- -
-

Example

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

- This would produce the output:
- 1,2,3,4,5,6
-

-
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/copied.html b/doc/reference/adaptors/copied.html deleted file mode 100755 index 12b3351..0000000 --- a/doc/reference/adaptors/copied.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

copied

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

Example

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

- This would produce the output: - 2,3,4,5 -

-
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/filtered.html b/doc/reference/adaptors/filtered.html deleted file mode 100755 index 055c826..0000000 --- a/doc/reference/adaptors/filtered.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

filtered

-
-
rng | boost::adaptors::filtered( pred )
-
boost::make_filtered_range( rng, pred )
-
-
    -
  • - Precondition: - The value-type of the range is convertible to the argument type of - pred. -
  • -
  • - Postcondition: - For all elements x in the returned range, - pred(x) is true -
  • -
  • - Throws: - Whatever the copy-constructor of pred might throw. -
  • -
  • - Range Category: - ForwardRange -
  • -
  • - Returned Range Category: - ForwardRange -
  • -
- -
-

Example

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

- This would produce the output:
- 2,4,6,8 -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/indexed.html b/doc/reference/adaptors/indexed.html deleted file mode 100755 index 74e0d04..0000000 --- a/doc/reference/adaptors/indexed.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

indexed

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

Example

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

- This produces the output:
- - Element = 10 Index = 0
- Element = 20 Index = 1
- Element = 30 Index = 2
- Element = 40 Index = 3
- Element = 50 Index = 4
- Element = 60 Index = 5
- Element = 70 Index = 6
- Element = 80 Index = 7
- Element = 90 Index = 8
-
-

-
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/indirected.html b/doc/reference/adaptors/indirected.html deleted file mode 100755 index 0a56e32..0000000 --- a/doc/reference/adaptors/indirected.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

indirected

-
-
rng | boost::adaptors::indirected
-
boost::make_indirected_range( rng )
-
-
    -
  • - Precondition: - The value-type of the range defines unary operator*() -
  • -
  • - Postcondition: - For all elements x in the returned range, - x is the result of *y where - y is the corresponding element in the original range. -
  • -
  • - Range Category: - SinglePassRange -
  • -
- -
-

Example

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

- This produces the output:
- 0,1,2,3,4,5,6,7,8,9 -

-
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/map_keys.html b/doc/reference/adaptors/map_keys.html deleted file mode 100755 index a1eec17..0000000 --- a/doc/reference/adaptors/map_keys.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

map_keys

-
-
rng | boost::adaptors::map_keys
-
boost::make_map_key_range( rng )
-
-
    -
  • - Precondition: - The value-type of the range is an instantiation of std::pair. -
  • -
  • - Postcondition: - For all elements x in the returned range, - x is the result of y.first where - y is the corresponding element in the original range. -
  • -
  • - Range Category: - SinglePassRange -
  • -
- -
-

Example

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

- This produces the output:
- - 0,1,2,3,4,5,6,7,8,9 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/map_values.html b/doc/reference/adaptors/map_values.html deleted file mode 100755 index bc3c165..0000000 --- a/doc/reference/adaptors/map_values.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

map_values

-
-
rng | boost::adaptors::map_values
-
boost::make_map_value_range( rng )
-
-
    -
  • - Precondition: - The value-type of the range is an instantiation of std::pair. -
  • -
  • - Postcondition: - For all elements x in the returned range, - x is the result of y.second where - y is the corresponding element in the original range. -
  • -
  • - Range Category: - SinglePassRange -
  • -
-
-

Example

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

- This produces the output:
- - 0,10,20,30,40,50,60,70,80,90 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/replaced.html b/doc/reference/adaptors/replaced.html deleted file mode 100755 index 861277f..0000000 --- a/doc/reference/adaptors/replaced.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

replaced

-
-
rng | boost::adaptors::replaced( new_value, old_value )
-
boost::make_replaced_range( rng, new_value, old_value )
-
-
    -
  • - Precondition: -
      -
    • - new_value is convertible to the value-type of - the range. -
    • -
    • - old_value is convertible to the value-type of - the range. -
    • -
    -
  • -
  • - Postcondition: - For all elements x in the returned range, the value - x is equal to the value of - (y == old_value) ? new_value : y - where y is the corresponding element in the original - range. -
  • -
  • - Range Category: - ForwardRange -
  • -
-
-

Example

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

- This produces the output:
- - 1,10,3,10,5,10,7,10,9 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/replaced_if.html b/doc/reference/adaptors/replaced_if.html deleted file mode 100755 index cde3678..0000000 --- a/doc/reference/adaptors/replaced_if.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

replaced_if

-
-
rng | boost::adaptors::replaced_if( pred, new_value )
-
boost::make_replaced_if_range( rng, pred, new_value )
-
-
    -
  • - Precondition: -
      -
    • - The range value-type is convertible to the argument type - of pred. -
    • -
    • - new_value is convertible to the value-type - of the range. -
    • -
    -
  • -
  • - Postconditions: - For all elements [x] in the returned range, the value - x is equal to the value of - pred(y) ? new_value : y - where y is the corresponding element in the original - range. -
  • -
  • - Range Category: - ForwardRange -
  • -
- -
-

Example

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

- This produces the output:
- - 1,10,3,10,5,10,7,10,9 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/reversed.html b/doc/reference/adaptors/reversed.html deleted file mode 100755 index 0aea1ee..0000000 --- a/doc/reference/adaptors/reversed.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

reversed

-
-
rng | boost::adaptors::reversed
-
boost::make_reversed_range( rng )
-
-
    -
  • - Returns: - A range whose iterators behave as if they were the original - iterators wrapped in reverse_iterator. -
  • -
  • - Range Category: - BidirectionalRange -
  • -
-
-

Example

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

- This produces the output:
- - 9,8,7,6,5,4,3,2,1 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/sliced.html b/doc/reference/adaptors/sliced.html deleted file mode 100755 index d979392..0000000 --- a/doc/reference/adaptors/sliced.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

sliced

-
-
rng | boost::adaptors::sliced( n, m )
-
boost::make_sliced_range( rng, n, m )
-
-
    -
  • - Precondition: - 0 <= n && n <= m && m < distance(rng) -
  • -
  • - Returns: - make_range(rng, n, m) -
  • -
  • - Range Category: - RandomAccessRange -
  • -
-
-

Example

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

- This produces the output:
- - 3,4,5 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/strided.html b/doc/reference/adaptors/strided.html deleted file mode 100755 index 3e23af5..0000000 --- a/doc/reference/adaptors/strided.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

strided

-
-
rng | boost::adaptors::strided( n )
-
boost::make_strided_range( rng, n )
-
-
    -
  • - Precondition: - 0 <= n && n <= distance(rng) -
  • -
  • - Returns: - A new range based on rng where traversal is performed in steps of n. -
  • -
  • - Range Category: - RandomAccessRange -
  • -
-
-

Example

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

- This produces the output: - - 1,3,5,7,9 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/tokenized.html b/doc/reference/adaptors/tokenized.html deleted file mode 100755 index 304e91d..0000000 --- a/doc/reference/adaptors/tokenized.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

tokenized

-
-
rng | boost::adaptors::tokenized( regex )
-
rng | boost::adaptors::tokenized( regex, i )
-
rng | boost::adaptors::tokenized( regex, rndRng )
-
rng | boost::adaptors::tokenized( regex, i, flags )
-
rng | boost::adaptors::tokenized( regex, rndRng, flags )
-
boost::make_tokenized_range( rng, regex, i, flags )
-
boost::make_tokenized_range( rng, regex, rngRng, flags )
-
-
    -
  • - Precondition: -
      -
    • - Let T denote - typename range_value< decltype(rng) >::type, - then regex has the type - basic_regex<T> or is - implicitly convertible to one of these types. -
    • -
    • - i has the type int. -
    • -
    • - the value-type of rndRng is int. -
    • -
    • - flags has the type - regex_constants::syntax_option_type. -
    • -
    -
  • -
  • - Returns: - A range whose iterators behave as if they were the - original iterators wrapped in regex_token_iterator. - The first iterator in the range would be constructed by - forwarding all the arguments of tokenized() to the - regex_token_iterator constructor. -
  • -
  • - Throws: - Whatever constructing and copying equivalent - regex_token_iterators might throw. -
  • -
  • - Range Category: - RandomAccessRange -
  • -
-
-

Example

-
-        #include <boost/range/adaptor/tokenized.hpp>
-        #include <boost/range/algorithm_ext/push_back.hpp>
-        #include <boost/assert.hpp>
-        #include <algorithm>
-        #include <string>
-        #include <vector>
-        
-        int main(int argc, const char* argv)
-        {
-            using namespace boost::adaptors;
-            
-            std::string input = "a b c d e f g hijklmnopqrstuvwxyz";
-            std::vector< boost::sub_match< std::string::iterator > > result;
-            boost::push_back(result, input | tokenized(boost::regex("\\b")));
-            
-            BOOST_ASSERT( boost::size(result) == 16u );
-            
-            return 0;
-        }
-    
- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/transformed.html b/doc/reference/adaptors/transformed.html deleted file mode 100755 index 4069f9a..0000000 --- a/doc/reference/adaptors/transformed.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

transformed

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

Example

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

- This produces the output:
- - 2,4,6,8,10,12,14,16,18,20 - -

- -
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/doc/reference/adaptors/uniqued.html b/doc/reference/adaptors/uniqued.html deleted file mode 100755 index 43ca130..0000000 --- a/doc/reference/adaptors/uniqued.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - Boost.Range Range Adaptors - - - - - - - - - - -

Boost.Range

- -

Range Adaptors

- -
- -

uniqued

-
-
rng | boost::adaptors::uniqued
-
boost::make_uniqued_range( rng )
-
-
    -
  • - Precondition: - The value-type of the range is comparable with - operator==(). -
  • -
  • - Postcondition: - For all adjacent elements [x,y] in the returned range, - x==y is false. -
  • -
  • - Range Category: - ForwardRange -
  • -
- -
-

Example

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

- This would produce the output:
- 1,2,3,4,5,6
-

-
-

- (C) Copyright Neil Groves 2009 - (C) Copyright Thorsten Ottosen 2003-2004 -

- -
-
-
-
-
-
-
-
-
-
-
-
- - - diff --git a/include/boost/range/adaptor/adjacent_filtered.hpp b/include/boost/range/adaptor/adjacent_filtered.hpp index c01f1c1..f63a599 100644 --- a/include/boost/range/adaptor/adjacent_filtered.hpp +++ b/include/boost/range/adaptor/adjacent_filtered.hpp @@ -27,7 +27,6 @@ namespace boost { - namespace range_detail { template< class Iter, class Pred, bool default_pass > @@ -140,10 +139,14 @@ namespace boost 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) ) + : base_range(skip_iter(boost::begin(r), boost::end(r), p), + skip_iter(boost::end(r), boost::end(r), p)) { } + + private: + P m_pred; + R* m_range; }; template< class T > diff --git a/include/boost/range/adaptor/map.hpp b/include/boost/range/adaptor/map.hpp index a8a2c20..6d08ea7 100755 --- a/include/boost/range/adaptor/map.hpp +++ b/include/boost/range/adaptor/map.hpp @@ -25,9 +25,9 @@ namespace boost 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; + typedef BOOST_DEDUCED_TYPENAME range_value::type pair_t; + typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type& + result_type; result_type operator()( const pair_t& r ) const { @@ -38,8 +38,8 @@ namespace boost 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; + typedef BOOST_DEDUCED_TYPENAME range_value::type pair_t; + typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type; result_type operator()( pair_t& r ) const { @@ -50,16 +50,16 @@ namespace boost 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; - + typedef BOOST_DEDUCED_TYPENAME range_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< @@ -78,7 +78,7 @@ namespace boost select_first_range(const base& other) : base(other) {} }; - + template class select_second_mutable_range : public transform_range< @@ -97,7 +97,7 @@ namespace boost select_second_mutable_range(const base& other) : base(other) {} }; - + template class select_second_const_range : public transform_range< @@ -116,20 +116,20 @@ namespace boost select_second_const_range(const base& other) : base(other) {} }; - + template< class StdPairRng > - inline select_first_range + inline select_first_range operator|( const StdPairRng& r, map_keys_forwarder ) { - return operator|( r, + return operator|( r, boost::adaptors::transformed( select_first() ) ); } template< class StdPairRng > - inline select_second_mutable_range + inline select_second_mutable_range operator|( StdPairRng& r, map_values_forwarder ) { - return operator|( r, + return operator|( r, boost::adaptors::transformed( select_second_mutable() ) ); } @@ -137,27 +137,27 @@ namespace boost inline select_second_const_range operator|( const StdPairRng& r, map_values_forwarder ) { - return operator|( r, - boost::adaptors::transformed( select_second_const() ) ); + 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 = + const range_detail::map_keys_forwarder map_keys = range_detail::map_keys_forwarder(); - const range_detail::map_values_forwarder map_values = + const range_detail::map_values_forwarder map_values = range_detail::map_values_forwarder(); } - + template inline select_first_range keys(const StdPairRange& rng) @@ -165,7 +165,7 @@ namespace boost return select_first_range( range_detail::select_first(), rng ); } - + template inline select_second_const_range values(const StdPairRange& rng) @@ -173,7 +173,7 @@ namespace boost return select_second_const_range( range_detail::select_second_const(), rng ); } - + template inline select_second_mutable_range values(StdPairRange& rng) @@ -182,7 +182,7 @@ namespace boost range_detail::select_second_mutable(), rng ); } } // 'adaptors' - + } #endif diff --git a/include/boost/range/adaptor/replaced.hpp b/include/boost/range/adaptor/replaced.hpp index 3c40918..deeb8da 100644 --- a/include/boost/range/adaptor/replaced.hpp +++ b/include/boost/range/adaptor/replaced.hpp @@ -47,7 +47,7 @@ namespace boost }; template< class R > - class replace_range : + class replaced_range : public boost::iterator_range< boost::transform_iterator< replace_value< BOOST_DEDUCED_TYPENAME range_value::type >, @@ -64,7 +64,7 @@ namespace boost public: typedef BOOST_DEDUCED_TYPENAME range_value::type value_type; - replace_range( R& r, value_type from, value_type to ) + replaced_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) ) ) { } @@ -83,23 +83,23 @@ namespace boost }; template< class InputRng > - inline replace_range + inline replaced_range operator|( InputRng& r, const replace_holder::type>& f ) { - return replace_range(r, f.val1, f.val2); + return replaced_range(r, f.val1, f.val2); } template< class InputRng > - inline replace_range + inline replaced_range operator|( const InputRng& r, const replace_holder::type>& f ) { - return replace_range(r, f.val1, f.val2); + return replaced_range(r, f.val1, f.val2); } } // 'range_detail' - using range_detail::replace_range; + using range_detail::replaced_range; namespace adaptors { @@ -111,21 +111,21 @@ namespace boost } template - inline replace_range + inline replaced_range replace(InputRange& rng, BOOST_DEDUCED_TYPENAME range_value::type from, BOOST_DEDUCED_TYPENAME range_value::type to) { - return replace_range(rng, from, to); + return replaced_range(rng, from, to); } template - inline replace_range + inline replaced_range replace(const InputRange& rng, BOOST_DEDUCED_TYPENAME range_value::type from, BOOST_DEDUCED_TYPENAME range_value::type to) { - return replace_range(rng, from ,to); + return replaced_range(rng, from ,to); } } // 'adaptors' diff --git a/include/boost/range/adaptor/sliced.hpp b/include/boost/range/adaptor/sliced.hpp index eb506e0..03c6894 100755 --- a/include/boost/range/adaptor/sliced.hpp +++ b/include/boost/range/adaptor/sliced.hpp @@ -28,14 +28,26 @@ namespace boost }; template< class RandomAccessRange > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + class sliced_range : public boost::iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + { + typedef boost::iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > base_t; + public: + template + sliced_range(Rng& rng, T t, U u) + : base_t(boost::make_iterator_range(rng, t, u - boost::size(rng))) + { + } + }; + + template< class RandomAccessRange > + inline sliced_range slice( RandomAccessRange& rng, std::size_t t, std::size_t u ) { BOOST_ASSERT( t <= u && "error in slice indices" ); BOOST_ASSERT( static_cast(boost::size(rng)) >= u && "second slice index out of bounds" ); - return boost::make_iterator_range( rng, t, u - boost::size(rng) ); + return sliced_range(rng, t, u); } template< class RandomAccessRange > @@ -46,23 +58,21 @@ namespace boost BOOST_ASSERT( static_cast(boost::size(rng)) >= u && "second slice index out of bounds" ); - return boost::make_iterator_range( rng, t, u - boost::size(rng) ); + return sliced_range(rng, t, u); } template< class RandomAccessRange > - inline iterator_range< - BOOST_DEDUCED_TYPENAME range_iterator::type > + inline sliced_range operator|( RandomAccessRange& r, const sliced& f ) { - return adaptors::slice( r, f.t, f.u ); + return sliced_range( r, f.t, f.u ); } template< class RandomAccessRange > - inline iterator_range< - BOOST_DEDUCED_TYPENAME range_iterator::type > + inline sliced_range operator|( const RandomAccessRange& r, const sliced& f ) { - return adaptors::slice( r, f.t, f.u ); + return sliced_range( r, f.t, f.u ); } } // namespace adaptors diff --git a/include/boost/range/algorithm/copy.hpp b/include/boost/range/algorithm/copy.hpp index dc5a0c3..f15b31f 100644 --- a/include/boost/range/algorithm/copy.hpp +++ b/include/boost/range/algorithm/copy.hpp @@ -30,7 +30,7 @@ namespace boost template< class SinglePassRange, class OutputIterator > inline OutputIterator copy(const SinglePassRange& rng, OutputIterator out) { - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return std::copy(boost::begin(rng),boost::end(rng),out); } diff --git a/include/boost/range/algorithm/copy_backward.hpp b/include/boost/range/algorithm/copy_backward.hpp index 52dc922..c95c6f1 100755 --- a/include/boost/range/algorithm/copy_backward.hpp +++ b/include/boost/range/algorithm/copy_backward.hpp @@ -32,7 +32,7 @@ inline BidirectionalTraversalWriteableIterator copy_backward(const BidirectionalRange& rng, BidirectionalTraversalWriteableIterator out) { - BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); return std::copy_backward(boost::begin(rng), boost::end(rng), out); } diff --git a/include/boost/range/algorithm/equal.hpp b/include/boost/range/algorithm/equal.hpp index 7226440..a3ebc29 100755 --- a/include/boost/range/algorithm/equal.hpp +++ b/include/boost/range/algorithm/equal.hpp @@ -159,8 +159,8 @@ namespace boost template< class SinglePassRange1, class SinglePassRange2 > inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2 ) { - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return ::boost::range_detail::equal( ::boost::begin(rng1), ::boost::end(rng1), @@ -172,8 +172,8 @@ namespace boost inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2, BinaryPredicate pred ) { - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return ::boost::range_detail::equal( ::boost::begin(rng1), ::boost::end(rng1), diff --git a/include/boost/range/algorithm/fill.hpp b/include/boost/range/algorithm/fill.hpp index 72c5d58..95231a8 100755 --- a/include/boost/range/algorithm/fill.hpp +++ b/include/boost/range/algorithm/fill.hpp @@ -33,6 +33,15 @@ inline ForwardRange& fill(ForwardRange& rng, const Value& val) return rng; } +/// \overload +template< class ForwardRange, class Value > +inline const ForwardRange& fill(const ForwardRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + std::fill(boost::begin(rng), boost::end(rng), val); + return rng; +} + } // namespace range using range::fill; } diff --git a/include/boost/range/algorithm/fill_n.hpp b/include/boost/range/algorithm/fill_n.hpp index 29d7d6f..02a0c2a 100755 --- a/include/boost/range/algorithm/fill_n.hpp +++ b/include/boost/range/algorithm/fill_n.hpp @@ -36,6 +36,16 @@ inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val) return rng; } +/// \overload +template< class ForwardRange, class Size, class Value > +inline const ForwardRange& fill_n(const ForwardRange& rng, Size n, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_ASSERT( static_cast(std::distance(boost::begin(rng), boost::end(rng))) >= n ); + std::fill_n(boost::begin(rng), n, val); + return rng; +} + } // namespace range using range::fill_n; } // namespace boost diff --git a/include/boost/range/algorithm/find.hpp b/include/boost/range/algorithm/find.hpp index b4bf6d9..72c5cf1 100755 --- a/include/boost/range/algorithm/find.hpp +++ b/include/boost/range/algorithm/find.hpp @@ -27,18 +27,33 @@ namespace boost /// /// \pre SinglePassRange is a model of the SinglePassRangeConcept template< class SinglePassRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type find( SinglePassRange& rng, const Value& val ) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return std::find(boost::begin(rng), boost::end(rng), val); } +/// \overload +template< class SinglePassRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find( const SinglePassRange& rng, const Value& val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::find(boost::begin(rng), boost::end(rng), val); +} + // range_return overloads /// \overload template< range_return_value re, class SinglePassRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type find( SinglePassRange& rng, const Value& val ) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); @@ -47,6 +62,17 @@ find( SinglePassRange& rng, const Value& val ) rng); } +/// \overload +template< range_return_value re, class SinglePassRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +find( const SinglePassRange& rng, const Value& val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return range_return:: + pack(std::find(boost::begin(rng), boost::end(rng), val), + rng); +} + } // namespace range using range::find; } diff --git a/include/boost/range/algorithm/find_end.hpp b/include/boost/range/algorithm/find_end.hpp index 864d4b0..757e999 100755 --- a/include/boost/range/algorithm/find_end.hpp +++ b/include/boost/range/algorithm/find_end.hpp @@ -29,7 +29,10 @@ namespace boost /// \pre ForwardRange2 is a model of the ForwardRangeConcept /// \pre BinaryPredicate is a model of the BinaryPredicateConcept template< class ForwardRange1, class ForwardRange2 > -inline BOOST_DEDUCED_TYPENAME range_iterator< ForwardRange1 >::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator< ForwardRange1 >::type +>::type find_end(ForwardRange1 & rng1, const ForwardRange2& rng2) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -39,9 +42,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2) boost::begin(rng2),boost::end(rng2)); } +/// \overload +template< class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_iterator< const ForwardRange1 >::type +find_end(const ForwardRange1 & rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_end(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)); +} + /// \overload template< class ForwardRange1, class ForwardRange2, class BinaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -51,9 +69,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred) boost::begin(rng2),boost::end(rng2),pred); } +/// \overload +template< class ForwardRange1, class ForwardRange2, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_end(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_end(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2),pred); +} + /// \overload template< range_return_value re, class ForwardRange1, class ForwardRange2 > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type find_end(ForwardRange1& rng1, const ForwardRange2& rng2) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -65,10 +98,27 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2) rng1); } +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_end(const ForwardRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_end(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)), + rng1); +} + /// \overload template< range_return_value re, class ForwardRange1, class ForwardRange2, class BinaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -80,6 +130,21 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) rng1); } +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_end(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_end(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred), + rng1); +} + } // namespace range using range::find_end; } // namespace boost diff --git a/include/boost/range/algorithm/find_first_of.hpp b/include/boost/range/algorithm/find_first_of.hpp index f7543b7..4cb5989 100755 --- a/include/boost/range/algorithm/find_first_of.hpp +++ b/include/boost/range/algorithm/find_first_of.hpp @@ -29,7 +29,10 @@ namespace boost /// \pre ForwardRange2 is a model of the ForwardRangeConcept /// \pre BinaryPredicate is a model of the BinaryPredicateConcept template< class SinglePassRange1, class ForwardRange2 > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); @@ -39,9 +42,24 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2) boost::begin(rng2),boost::end(rng2)); } +/// \overload +template< class SinglePassRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_first_of(const SinglePassRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_first_of(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)); +} + /// \overload template< class SinglePassRange1, class ForwardRange2, class BinaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredicate pred) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); @@ -51,10 +69,25 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredica boost::begin(rng2),boost::end(rng2),pred); } +/// \overload +template< class SinglePassRange1, class ForwardRange2, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_first_of(const SinglePassRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_first_of(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2),pred); +} + // range return overloads /// \overload template< range_return_value re, class SinglePassRange1, class ForwardRange2 > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); @@ -66,10 +99,27 @@ find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2) rng1); } +/// \overload +template< range_return_value re, class SinglePassRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_first_of(const SinglePassRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_first_of(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)), + rng1); +} + /// \overload template< range_return_value re, class SinglePassRange1, class ForwardRange2, class BinaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred) { @@ -82,6 +132,22 @@ find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2, rng1); } +/// \overload +template< range_return_value re, class SinglePassRange1, class ForwardRange2, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_first_of(const SinglePassRange1 & rng1, const ForwardRange2& rng2, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_first_of(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred), + rng1); +} + } // namespace range using range::find_first_of; } // namespace boost diff --git a/include/boost/range/algorithm/find_if.hpp b/include/boost/range/algorithm/find_if.hpp index 3254d8c..2d1926d 100755 --- a/include/boost/range/algorithm/find_if.hpp +++ b/include/boost/range/algorithm/find_if.hpp @@ -28,18 +28,33 @@ namespace boost /// \pre SinglePassRange is a model of the SinglePassRangeConcept /// \pre UnaryPredicate is a model of the UnaryPredicateConcept template< class SinglePassRange, class UnaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type find_if( SinglePassRange& rng, UnaryPredicate pred ) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return std::find_if(boost::begin(rng), boost::end(rng), pred); } +/// \overload +template< class SinglePassRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_if( const SinglePassRange& rng, UnaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::find_if(boost::begin(rng), boost::end(rng), pred); +} + // range_return overloads /// \overload template< range_return_value re, class SinglePassRange, class UnaryPredicate > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type find_if( SinglePassRange& rng, UnaryPredicate pred ) { BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); @@ -48,6 +63,17 @@ find_if( SinglePassRange& rng, UnaryPredicate pred ) rng); } +/// \overload +template< range_return_value re, class SinglePassRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_if( const SinglePassRange& rng, UnaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return range_return:: + pack(std::find_if(boost::begin(rng), boost::end(rng), pred), + rng); +} + } // namespace range using range::find_if; } // namespace boost diff --git a/include/boost/range/algorithm/generate.hpp b/include/boost/range/algorithm/generate.hpp index bd63a48..324412c 100755 --- a/include/boost/range/algorithm/generate.hpp +++ b/include/boost/range/algorithm/generate.hpp @@ -33,6 +33,15 @@ 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 64df3e9..584920d 100755 --- a/include/boost/range/algorithm/heap_algorithm.hpp +++ b/include/boost/range/algorithm/heap_algorithm.hpp @@ -34,6 +34,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng) return rng; } +/// \overload +template +inline const RandomAccessRange& push_heap(const RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::push_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + /// \overload template inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred) @@ -43,6 +52,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred) return rng; } +/// \overload +template +inline const RandomAccessRange& 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 /// /// range-based version of the pop_heap std algorithm @@ -57,6 +75,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng) return rng; } +/// \overload +template +inline const RandomAccessRange& pop_heap(const RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::pop_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + /// \overload template inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred) @@ -66,6 +93,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred) return rng; } +/// \overload +template +inline const RandomAccessRange& 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 /// /// range-based version of the make_heap std algorithm @@ -80,6 +116,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng) return rng; } +/// \overload +template +inline const RandomAccessRange& make_heap(const RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::make_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + /// \overload template inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred) @@ -89,6 +134,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred) return rng; } +/// \overload +template +inline const RandomAccessRange& 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 /// /// range-based version of the sort_heap std algorithm @@ -103,6 +157,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng) return rng; } +/// \overload +template +inline const RandomAccessRange& sort_heap(const RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::sort_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + /// \overload template inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred) @@ -112,6 +175,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred) return rng; } +/// \overload +template +inline const RandomAccessRange& 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 using range::push_heap; using range::pop_heap; diff --git a/include/boost/range/algorithm/lower_bound.hpp b/include/boost/range/algorithm/lower_bound.hpp index 5d3945e..cb5e639 100755 --- a/include/boost/range/algorithm/lower_bound.hpp +++ b/include/boost/range/algorithm/lower_bound.hpp @@ -27,23 +27,52 @@ namespace boost /// /// \pre ForwardRange is a model of the ForwardRangeConcept template< class ForwardRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type lower_bound( ForwardRange& rng, Value val ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); return std::lower_bound(boost::begin(rng), boost::end(rng), val); } + +/// \overload +template< class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +lower_bound( const ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::lower_bound(boost::begin(rng), boost::end(rng), val); +} + /// \overload template< class ForwardRange, class Value, class SortPredicate > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type lower_bound( ForwardRange& rng, Value val, SortPredicate pred ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); return std::lower_bound(boost::begin(rng), boost::end(rng), val, pred); } + +/// \overload +template< class ForwardRange, class Value, class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +lower_bound( const ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::lower_bound(boost::begin(rng), boost::end(rng), val, pred); +} + /// \overload template< range_return_value re, class ForwardRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type lower_bound( ForwardRange& rng, Value val ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -51,9 +80,24 @@ lower_bound( ForwardRange& rng, Value val ) pack(std::lower_bound(boost::begin(rng), boost::end(rng), val), rng); } + +/// \overload +template< range_return_value re, class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +lower_bound( const ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::lower_bound(boost::begin(rng), boost::end(rng), val), + rng); +} + /// \overload template< range_return_value re, class ForwardRange, class Value, class SortPredicate > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type lower_bound( ForwardRange& rng, Value val, SortPredicate pred ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -62,6 +106,17 @@ lower_bound( ForwardRange& rng, Value val, SortPredicate pred ) rng); } +/// \overload +template< range_return_value re, class ForwardRange, class Value, class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +lower_bound( const ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::lower_bound(boost::begin(rng), boost::end(rng), val, pred), + rng); +} + } // namespace range using range::lower_bound; } // namespace boost diff --git a/include/boost/range/algorithm/partial_sort.hpp b/include/boost/range/algorithm/partial_sort.hpp index 1797c55..d7044cd 100755 --- a/include/boost/range/algorithm/partial_sort.hpp +++ b/include/boost/range/algorithm/partial_sort.hpp @@ -35,6 +35,16 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng, return rng; } +/// \overload +template +inline const RandomAccessRange& 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 RandomAccessRange& partial_sort(RandomAccessRange& rng, @@ -47,6 +57,18 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng, return rng; } +/// \overload +template +inline const RandomAccessRange& 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 using range::partial_sort; } // namespace boost diff --git a/include/boost/range/algorithm/partial_sort_copy.hpp b/include/boost/range/algorithm/partial_sort_copy.hpp index a2fe761..9129389 100755 --- a/include/boost/range/algorithm/partial_sort_copy.hpp +++ b/include/boost/range/algorithm/partial_sort_copy.hpp @@ -32,7 +32,18 @@ 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((SinglePassRangeConcept)); + + return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +partial_sort_copy(const SinglePassRange& rng1, const RandomAccessRange& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1), boost::begin(rng2), boost::end(rng2)); @@ -45,7 +56,20 @@ 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((SinglePassRangeConcept)); + + return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +partial_sort_copy(const SinglePassRange& rng1, const RandomAccessRange& rng2, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); 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 6404918..b814a24 100755 --- a/include/boost/range/algorithm/partition.hpp +++ b/include/boost/range/algorithm/partition.hpp @@ -34,6 +34,15 @@ 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 @@ -47,6 +56,17 @@ 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 0b17333..95bbd97 100755 --- a/include/boost/range/algorithm/random_shuffle.hpp +++ b/include/boost/range/algorithm/random_shuffle.hpp @@ -34,6 +34,15 @@ 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) @@ -43,6 +52,15 @@ 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 638dff2..699a7cd 100755 --- a/include/boost/range/algorithm/remove.hpp +++ b/include/boost/range/algorithm/remove.hpp @@ -34,6 +34,15 @@ 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 @@ -47,6 +56,17 @@ 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.hpp b/include/boost/range/algorithm/remove_copy.hpp index 0d3d83d..b65747e 100755 --- a/include/boost/range/algorithm/remove_copy.hpp +++ b/include/boost/range/algorithm/remove_copy.hpp @@ -31,9 +31,9 @@ namespace boost /// InputIterator's value type. template< class SinglePassRange, class OutputIterator, class Value > inline OutputIterator -remove_copy(SinglePassRange& rng, OutputIterator out_it, const Value& val) +remove_copy(const SinglePassRange& rng, OutputIterator out_it, const Value& val) { - BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return std::remove_copy(boost::begin(rng), boost::end(rng), out_it, val); } diff --git a/include/boost/range/algorithm/remove_copy_if.hpp b/include/boost/range/algorithm/remove_copy_if.hpp index 791a38f..8d9c37b 100755 --- a/include/boost/range/algorithm/remove_copy_if.hpp +++ b/include/boost/range/algorithm/remove_copy_if.hpp @@ -28,10 +28,10 @@ namespace boost /// \pre out_it is not an iterator in the range rng template< class SinglePassRange, class OutputIterator, class Predicate > inline OutputIterator - remove_copy_if(SinglePassRange& rng, OutputIterator out_it, Predicate pred) + remove_copy_if(const 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); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + 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 349e7a4..a965df0 100755 --- a/include/boost/range/algorithm/remove_if.hpp +++ b/include/boost/range/algorithm/remove_if.hpp @@ -35,6 +35,15 @@ 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 @@ -48,6 +57,17 @@ 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 3f2d72c..44d3e4c 100755 --- a/include/boost/range/algorithm/replace.hpp +++ b/include/boost/range/algorithm/replace.hpp @@ -35,6 +35,17 @@ 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_copy.hpp b/include/boost/range/algorithm/replace_copy.hpp index 36c91ce..0c02005 100755 --- a/include/boost/range/algorithm/replace_copy.hpp +++ b/include/boost/range/algorithm/replace_copy.hpp @@ -27,10 +27,10 @@ namespace boost /// \pre ForwardRange is a model of the ForwardRangeConcept template< class ForwardRange, class OutputIterator, class Value > inline OutputIterator -replace_copy(ForwardRange& rng, OutputIterator out_it, const Value& what, +replace_copy(const ForwardRange& rng, OutputIterator out_it, const Value& what, const Value& with_what) { - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); return std::replace_copy(boost::begin(rng), boost::end(rng), out_it, what, with_what); } diff --git a/include/boost/range/algorithm/replace_copy_if.hpp b/include/boost/range/algorithm/replace_copy_if.hpp index 5d4bfb6..d313151 100755 --- a/include/boost/range/algorithm/replace_copy_if.hpp +++ b/include/boost/range/algorithm/replace_copy_if.hpp @@ -31,10 +31,10 @@ namespace boost /// \pre Value is convertible to a type in OutputIterator's set of value types. template< class ForwardRange, class OutputIterator, class Predicate, class Value > inline OutputIterator -replace_copy_if(ForwardRange& rng, OutputIterator out_it, Predicate pred, +replace_copy_if(const ForwardRange& rng, OutputIterator out_it, Predicate pred, const Value& with_what) { - BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); return std::replace_copy_if(boost::begin(rng), boost::end(rng), out_it, pred, with_what); } diff --git a/include/boost/range/algorithm/replace_if.hpp b/include/boost/range/algorithm/replace_if.hpp index 393a4ca..93d5a1f 100755 --- a/include/boost/range/algorithm/replace_if.hpp +++ b/include/boost/range/algorithm/replace_if.hpp @@ -36,6 +36,17 @@ 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 8741d66..20a7eb1 100755 --- a/include/boost/range/algorithm/reverse.hpp +++ b/include/boost/range/algorithm/reverse.hpp @@ -34,6 +34,15 @@ 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 d86145d..f1990ad 100755 --- a/include/boost/range/algorithm/reverse_copy.hpp +++ b/include/boost/range/algorithm/reverse_copy.hpp @@ -29,7 +29,7 @@ namespace boost template inline OutputIterator reverse_copy(const BidirectionalRange& rng, OutputIterator out) { - BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); return std::reverse_copy(boost::begin(rng), boost::end(rng), out); } diff --git a/include/boost/range/algorithm/rotate.hpp b/include/boost/range/algorithm/rotate.hpp index aef6062..ca4b223 100755 --- a/include/boost/range/algorithm/rotate.hpp +++ b/include/boost/range/algorithm/rotate.hpp @@ -34,6 +34,16 @@ inline ForwardRange& rotate(ForwardRange& rng, return rng; } +/// \overload +template +inline const ForwardRange& rotate(const ForwardRange& rng, + BOOST_DEDUCED_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/search_n.hpp b/include/boost/range/algorithm/search_n.hpp index 2ced140..b69bc6d 100755 --- a/include/boost/range/algorithm/search_n.hpp +++ b/include/boost/range/algorithm/search_n.hpp @@ -44,7 +44,7 @@ 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)); + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); return std::search_n(boost::begin(rng), boost::end(rng), count, value); } @@ -69,7 +69,7 @@ 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((ForwardRangeConcept)); BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, const Value&>)); return std::search_n(boost::begin(rng), boost::end(rng), @@ -97,7 +97,7 @@ template< range_return_value re, class ForwardRange, class Integer, inline BOOST_DEDUCED_TYPENAME range_return::type search_n(const ForwardRange& rng, Integer count, const Value& value) { - BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); return range_return:: pack(std::search_n(boost::begin(rng), boost::end(rng), count, value), @@ -128,7 +128,7 @@ 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((ForwardRangeConcept)); BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, const Value&>)); diff --git a/include/boost/range/algorithm/sort.hpp b/include/boost/range/algorithm/sort.hpp index 0c6e3b2..45eecde 100755 --- a/include/boost/range/algorithm/sort.hpp +++ b/include/boost/range/algorithm/sort.hpp @@ -34,6 +34,15 @@ 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) @@ -43,6 +52,15 @@ 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 6a27aa4..d18da4d 100755 --- a/include/boost/range/algorithm/stable_sort.hpp +++ b/include/boost/range/algorithm/stable_sort.hpp @@ -34,6 +34,15 @@ 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) @@ -43,6 +52,15 @@ 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 5b8967a..52b0162 100755 --- a/include/boost/range/algorithm/swap_ranges.hpp +++ b/include/boost/range/algorithm/swap_ranges.hpp @@ -80,6 +80,51 @@ swap_ranges(SinglePassRange1& range1, SinglePassRange2& range2) return range2; } +/// \overload +template< class SinglePassRange1, class SinglePassRange2 > +inline SinglePassRange2& +swap_ranges(const SinglePassRange1& range1, SinglePassRange2& range2) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + + boost::range_detail::swap_ranges_impl( + boost::begin(range1), boost::end(range1), + boost::begin(range2), boost::end(range2)); + + return range2; +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2 > +inline const SinglePassRange2& +swap_ranges(SinglePassRange1& range1, const SinglePassRange2& range2) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + + boost::range_detail::swap_ranges_impl( + boost::begin(range1), boost::end(range1), + boost::begin(range2), boost::end(range2)); + + return range2; +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2 > +inline const SinglePassRange2& +swap_ranges(const SinglePassRange1& range1, const SinglePassRange2& range2) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + + boost::range_detail::swap_ranges_impl( + boost::begin(range1), boost::end(range1), + boost::begin(range2), boost::end(range2)); + + return range2; +} + } // namespace range using range::swap_ranges; } // namespace boost diff --git a/include/boost/range/algorithm/upper_bound.hpp b/include/boost/range/algorithm/upper_bound.hpp index 8aa26bd..c8acbc6 100755 --- a/include/boost/range/algorithm/upper_bound.hpp +++ b/include/boost/range/algorithm/upper_bound.hpp @@ -27,24 +27,53 @@ namespace boost /// /// \pre ForwardRange is a model of the ForwardRangeConcept template< class ForwardRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline +BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type upper_bound( ForwardRange& rng, Value val ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); return std::upper_bound(boost::begin(rng), boost::end(rng), val); } + /// \overload +template< class ForwardRange, class Value > +BOOST_DEDUCED_TYPENAME range_iterator::type +upper_bound( const ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::upper_bound(boost::begin(rng), boost::end(rng), val); +} + /// \overload template< class ForwardRange, class Value, class SortPredicate > -inline BOOST_DEDUCED_TYPENAME range_iterator::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_iterator::type +>::type upper_bound( ForwardRange& rng, Value val, SortPredicate pred ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); return std::upper_bound(boost::begin(rng), boost::end(rng), val, pred); } + +/// \overload +template< class ForwardRange, class Value, class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +upper_bound( const ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::upper_bound(boost::begin(rng), boost::end(rng), val, pred); +} + /// \overload template< range_return_value re, class ForwardRange, class Value > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type upper_bound( ForwardRange& rng, Value val ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -52,10 +81,25 @@ upper_bound( ForwardRange& rng, Value val ) pack(std::upper_bound(boost::begin(rng), boost::end(rng), val), rng); } + +/// \overload +template< range_return_value re, class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +upper_bound( const ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::upper_bound(boost::begin(rng), boost::end(rng), val), + rng); +} + /// \overload template< range_return_value re, class ForwardRange, class Value, class SortPredicate > -inline BOOST_DEDUCED_TYPENAME range_return::type +inline BOOST_DEDUCED_TYPENAME disable_if< + is_const, + BOOST_DEDUCED_TYPENAME range_return::type +>::type upper_bound( ForwardRange& rng, Value val, SortPredicate pred ) { BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); @@ -64,6 +108,18 @@ upper_bound( ForwardRange& rng, Value val, SortPredicate pred ) rng); } +/// \overload +template< range_return_value re, class ForwardRange, class Value, + class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +upper_bound( const ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::upper_bound(boost::begin(rng), boost::end(rng), val, pred), + rng); +} + } // namespace range using range::upper_bound; } // namespace boost diff --git a/include/boost/range/algorithm_ext/iota.hpp b/include/boost/range/algorithm_ext/iota.hpp index 65cbc89..f7af446 100644 --- a/include/boost/range/algorithm_ext/iota.hpp +++ b/include/boost/range/algorithm_ext/iota.hpp @@ -34,6 +34,19 @@ inline ForwardRange& iota( ForwardRange& rng, Value x ) return rng; } +template< class ForwardRange, class Value > +inline const ForwardRange& iota( const ForwardRange& rng, Value x ) +{ + BOOST_CONCEPT_ASSERT(( ForwardRangeConcept )); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iterator_t; + + iterator_t last_target = ::boost::end(rng); + for (iterator_t target = ::boost::begin(rng); target != last_target; ++target, ++x) + *target = x; + + return rng; +} + } // namespace range using range::iota; } // namespace boost diff --git a/include/boost/range/algorithm_ext/is_sorted.hpp b/include/boost/range/algorithm_ext/is_sorted.hpp index 69ead10..54fc038 100755 --- a/include/boost/range/algorithm_ext/is_sorted.hpp +++ b/include/boost/range/algorithm_ext/is_sorted.hpp @@ -51,7 +51,7 @@ template inline bool is_sorted(const SinglePassRange& rng) { BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); - BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept::type>)); + BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept::type>)); return range_detail::is_sorted(boost::begin(rng), boost::end(rng)); } @@ -59,8 +59,8 @@ inline bool is_sorted(const SinglePassRange& rng) template inline bool is_sorted(const SinglePassRange& rng, BinaryPredicate pred) { - BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); - BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, BOOST_DEDUCED_TYPENAME range_value::type>)); + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, BOOST_DEDUCED_TYPENAME range_value::type>)); return range_detail::is_sorted(boost::begin(rng), boost::end(rng), pred); } diff --git a/include/boost/range/algorithm_ext/overwrite.hpp b/include/boost/range/algorithm_ext/overwrite.hpp index d2cf4ed..f84f6ea 100755 --- a/include/boost/range/algorithm_ext/overwrite.hpp +++ b/include/boost/range/algorithm_ext/overwrite.hpp @@ -50,6 +50,33 @@ inline void overwrite( const SinglePassRange1& from, SinglePassRange2& to ) } } +template< class SinglePassRange1, class SinglePassRange2 > +inline void overwrite( const SinglePassRange1& from, const SinglePassRange2& to ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + BOOST_DEDUCED_TYPENAME range_iterator::type + i = boost::begin(from), e = boost::end(from); + + BOOST_DEDUCED_TYPENAME range_iterator::type + out = boost::begin(to); + +#ifndef NDEBUG + BOOST_DEDUCED_TYPENAME range_iterator::type + last_out = boost::end(to); +#endif + + for( ; i != e; ++out, ++i ) + { +#ifndef NDEBUG + BOOST_ASSERT( out != last_out + && "out of bounds in boost::overwrite()" ); +#endif + *out = *i; + } +} + } // namespace range using range::overwrite; } // namespace boost diff --git a/include/boost/range/detail/join_iterator.hpp b/include/boost/range/detail/join_iterator.hpp index 76ebbfe..d22292b 100644 --- a/include/boost/range/detail/join_iterator.hpp +++ b/include/boost/range/detail/join_iterator.hpp @@ -12,9 +12,9 @@ #define BOOST_RANGE_DETAIL_JOIN_ITERATOR_HPP_INCLUDED #include +#include #include #include -#include #include #include #include @@ -30,21 +30,6 @@ namespace boost template struct join_iterator_link { -private: - class reference_count_t - { - public: - reference_count_t() : m_count(0u) {} - reference_count_t(const reference_count_t&) : m_count(0u) {} - reference_count_t& operator=(const reference_count_t&) { return *this; } - - void increment() { ++m_count; } - bool decrement() { return --m_count ? false : true; } - - private: - unsigned int m_count; - }; - public: join_iterator_link(Iterator1 last1, Iterator2 first2) : last1(last1) @@ -52,38 +37,13 @@ public: { } - void add_reference() const - { - count.increment(); - } - - bool release_reference() const - { - return count.decrement(); - } - Iterator1 last1; Iterator2 first2; private: join_iterator_link() /* = delete */ ; - - mutable reference_count_t count; }; -template -inline void intrusive_ptr_add_ref(const join_iterator_link* p) -{ - p->add_reference(); -} - -template -inline void intrusive_ptr_release(const join_iterator_link* p) -{ - if (p->release_reference()) - delete p; -} - class join_iterator_begin_tag {}; class join_iterator_end_tag {}; @@ -174,12 +134,16 @@ public: typedef Iterator1 iterator1_t; typedef Iterator2 iterator2_t; - join_iterator() : m_section(0u) {} + join_iterator() + : m_section(0u) + , m_it(0u, iterator1_t(), iterator2_t()) + , m_link(link_t(iterator1_t(), iterator2_t())) + {} join_iterator(unsigned int section, Iterator1 current1, Iterator1 last1, Iterator2 first2, Iterator2 current2) : m_section(section) , m_it(section, current1, current2) - , m_link(new link_t(last1, first2)) + , m_link(link_t(last1, first2)) { } @@ -187,7 +151,7 @@ public: join_iterator(Range1& r1, Range2& r2, join_iterator_begin_tag) : m_section(boost::empty(r1) ? 1u : 0u) , m_it(boost::empty(r1) ? 1u : 0u, boost::begin(r1), boost::begin(r2)) - , m_link(new link_t(boost::end(r1), boost::begin(r2))) + , m_link(link_t(boost::end(r1), boost::begin(r2))) { } @@ -195,7 +159,7 @@ public: join_iterator(const Range1& r1, const Range2& r2, join_iterator_begin_tag) : m_section(boost::empty(r1) ? 1u : 0u) , m_it(boost::empty(r1) ? 1u : 0u, boost::const_begin(r1), boost::const_begin(r2)) - , m_link(new link_t(boost::const_end(r1), boost::const_begin(r2))) + , m_link(link_t(boost::const_end(r1), boost::const_begin(r2))) { } @@ -203,7 +167,7 @@ public: join_iterator(Range1& r1, Range2& r2, join_iterator_end_tag) : m_section(1u) , m_it(1u, boost::end(r1), boost::end(r2)) - , m_link(new link_t(boost::end(r1), boost::begin(r2))) + , m_link(link_t(boost::end(r1), boost::begin(r2))) { } @@ -211,7 +175,7 @@ public: join_iterator(const Range1& r1, const Range2& r2, join_iterator_end_tag) : m_section(1u) , m_it(1u, boost::const_end(r1), boost::const_end(r2)) - , m_link(new link_t(boost::const_end(r1), boost::const_begin(r2))) + , m_link(link_t(boost::const_end(r1), boost::const_begin(r2))) { } @@ -223,9 +187,9 @@ private: else { ++m_it.it1(); - if (m_it.it1() == m_link->last1) + if (m_it.it1() == m_link.last1) { - m_it.it2() = m_link->first2; + m_it.it2() = m_link.first2; m_section = 1u; } } @@ -235,9 +199,9 @@ private: { if (m_section) { - if (m_it.it2() == m_link->first2) + if (m_it.it2() == m_link.first2) { - m_it.it1() = boost::prior(m_link->last1); + m_it.it1() = boost::prior(m_link.last1); m_section = 0u; } else @@ -275,8 +239,8 @@ private: result = other.m_it.it2() - m_it.it2(); else { - result = (m_link->first2 - m_it.it2()) - + (other.m_it.it1() - m_link->last1); + result = (m_link.first2 - m_it.it2()) + + (other.m_it.it1() - m_link.last1); BOOST_ASSERT( result <= 0 ); } @@ -285,8 +249,8 @@ private: { if (other.m_section) { - result = (m_link->last1 - m_it.it1()) - + (other.m_it.it2() - m_link->first2); + result = (m_link.last1 - m_it.it1()) + + (other.m_it.it2() - m_link.first2); } else result = other.m_it.it1() - m_it.it1(); @@ -300,7 +264,7 @@ private: BOOST_ASSERT( m_section == 1u ); if (offset < 0) { - difference_t r2_dist = m_link->first2 - m_it.it2(); + difference_t r2_dist = m_link.first2 - m_it.it2(); BOOST_ASSERT( r2_dist <= 0 ); if (offset >= r2_dist) std::advance(m_it.it2(), offset); @@ -308,7 +272,7 @@ private: { difference_t r1_dist = offset - r2_dist; BOOST_ASSERT( r1_dist <= 0 ); - m_it.it1() = m_link->last1 + r1_dist; + m_it.it1() = m_link.last1 + r1_dist; m_section = 0u; } } @@ -322,7 +286,7 @@ private: BOOST_ASSERT( m_section == 0u ); if (offset > 0) { - difference_t r1_dist = m_link->last1 - m_it.it1(); + difference_t r1_dist = m_link.last1 - m_it.it1(); BOOST_ASSERT( r1_dist >= 0 ); if (offset < r1_dist) std::advance(m_it.it1(), offset); @@ -330,7 +294,7 @@ private: { difference_t r2_dist = offset - r1_dist; BOOST_ASSERT( r2_dist >= 0 ); - m_it.it2() = m_link->first2 + r2_dist; + m_it.it2() = m_link.first2 + r2_dist; m_section = 1u; } } @@ -340,7 +304,7 @@ private: unsigned int m_section; iterator_union m_it; - intrusive_ptr m_link; + link_t m_link; friend class ::boost::iterator_core_access; }; diff --git a/include/boost/range/irange.hpp b/include/boost/range/irange.hpp index ee25d45..8045550 100644 --- a/include/boost/range/irange.hpp +++ b/include/boost/range/irange.hpp @@ -173,28 +173,54 @@ namespace boost } // namespace range_detail template - iterator_range< range_detail::integer_iterator > - irange(Integer first, Integer last) + class integer_range + : public iterator_range< range_detail::integer_iterator > + { + typedef range_detail::integer_iterator iterator_t; + typedef iterator_range base_t; + public: + integer_range(Integer first, Integer last) + : base_t(iterator_t(first), iterator_t(last)) + { + } + }; + + template + class strided_integer_range + : public iterator_range< range_detail::integer_iterator_with_step > + { + typedef range_detail::integer_iterator_with_step iterator_t; + typedef iterator_range base_t; + public: + template + strided_integer_range(Iterator first, Iterator last) + : base_t(first, last) + { + } + }; + + template + integer_range + irange(Integer first, Integer last) { BOOST_ASSERT( first <= last ); - return boost::iterator_range< range_detail::integer_iterator >( - range_detail::integer_iterator(first), - range_detail::integer_iterator(last)); + return integer_range(first, last); } template - iterator_range< range_detail::integer_iterator_with_step > + strided_integer_range irange(Integer first, Integer last, StepSize step_size) { BOOST_ASSERT( step_size != 0 ); BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) ); + typedef typename range_detail::integer_iterator_with_step iterator_t; const std::ptrdiff_t last_step = (static_cast(last) - static_cast(first)) / (static_cast(step_size)); - return boost::iterator_range< iterator_t >( + return strided_integer_range( iterator_t(first, 0, step_size), iterator_t(first, last_step, step_size)); } diff --git a/include/boost/range/join.hpp b/include/boost/range/join.hpp index 518026c..ad0217e 100644 --- a/include/boost/range/join.hpp +++ b/include/boost/range/join.hpp @@ -18,49 +18,64 @@ namespace boost { + namespace range_detail + { template -iterator_range::type, - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME add_const< - BOOST_DEDUCED_TYPENAME range_value::type>::type> -> +class joined_type +{ +public: + typedef iterator_range< + range_detail::join_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_value::type + > + > type; +}; + + } // namespace range_detail + +template +class joined_range + : public range_detail::joined_type::type +{ + 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 BOOST_DEDUCED_TYPENAME range_detail::joined_type< + SinglePassRange1, SinglePassRange2>::type base_t; +public: + joined_range(SinglePassRange1& rng1, SinglePassRange2& rng2) + : base_t( + iterator_t(rng1, rng2, range_detail::join_iterator_begin_tag()), + iterator_t(rng1, rng2, range_detail::join_iterator_end_tag()) + ) + { + } +}; + +template +joined_range 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; - - return iterator_range( - iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), - iterator_t(r1, r2, range_detail::join_iterator_end_tag())); + return joined_range(r1, r2); } template -iterator_range::type, - BOOST_DEDUCED_TYPENAME range_iterator::type, - BOOST_DEDUCED_TYPENAME range_value::type> -> +joined_range 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; - - return iterator_range( - iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), - iterator_t(r1, r2, range_detail::join_iterator_end_tag())); + return joined_range(r1, r2); } } // namespace boost diff --git a/include/boost/range/numeric.hpp b/include/boost/range/numeric.hpp index 0a76151..b01b73a 100755 --- a/include/boost/range/numeric.hpp +++ b/include/boost/range/numeric.hpp @@ -7,13 +7,13 @@ // 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) -// +// // Copyright 2006 Thorsten Ottosen. // 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) -// +// // Copyright 2004 Eric Niebler. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -39,14 +40,14 @@ namespace boost template< class SinglePassRange, class Value > inline Value accumulate( const SinglePassRange& rng, Value init ) { - boost::function_requires< SinglePassRangeConcept >(); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); 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 ) { - boost::function_requires< SinglePassRangeConcept >(); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return std::accumulate( boost::begin(rng), boost::end(rng), init, op ); } @@ -54,42 +55,42 @@ namespace boost 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_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); - return std::inner_product( boost::begin(rng1), boost::end(rng1), - boost::begin(rng2), init ); + return std::inner_product( boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), init ); } template< class SinglePassRange1, class SinglePassRange2, - class Value, + class Value, class BinaryOperation1, class BinaryOperation2 > inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, - Value init, + Value init, BinaryOperation1 op1, BinaryOperation2 op2 ) { - boost::function_requires< SinglePassRangeConcept >(); - boost::function_requires< SinglePassRangeConcept >(); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); - return std::inner_product( boost::begin(rng1), boost::end(rng1), - boost::begin(rng2), init, op1, op2 ); + 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, + inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result ) { - boost::function_requires< SinglePassRangeConcept >(); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); 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, + inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result, BinaryOperation op ) { - boost::function_requires< SinglePassRangeConcept >(); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); return std::partial_sum( boost::begin(rng), boost::end(rng), result, op ); } @@ -97,8 +98,8 @@ namespace boost inline OutputIterator adjacent_difference ( const SinglePassRange& rng, OutputIterator result ) { - boost::function_requires< SinglePassRangeConcept >(); - return std::adjacent_difference( boost::begin(rng), boost::end(rng), + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::adjacent_difference( boost::begin(rng), boost::end(rng), result ); } @@ -107,11 +108,11 @@ namespace boost OutputIterator result, BinaryOperation op ) { - boost::function_requires< SinglePassRangeConcept >(); - return std::adjacent_difference( boost::begin(rng), boost::end(rng), + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::adjacent_difference( boost::begin(rng), boost::end(rng), result, op ); } - + } #endif diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 2b2466f..645f5f9 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -91,12 +91,19 @@ test-suite range : [ range-test algorithm_test/prev_permutation ] [ range-test algorithm_test/random_shuffle ] [ range-test algorithm_test/remove ] + [ range-test algorithm_test/remove_copy ] + [ range-test algorithm_test/remove_copy_if ] [ range-test algorithm_test/remove_if ] [ range-test algorithm_test/replace ] + [ range-test algorithm_test/replace_copy ] + [ range-test algorithm_test/replace_copy_if ] [ range-test algorithm_test/replace_if ] [ range-test algorithm_test/reverse ] + [ range-test algorithm_test/reverse_copy ] [ range-test algorithm_test/rotate ] + [ range-test algorithm_test/rotate_copy ] [ range-test algorithm_test/search ] + [ range-test algorithm_test/search_n ] [ range-test algorithm_test/set_difference ] [ range-test algorithm_test/set_intersection ] [ range-test algorithm_test/set_symmetric_difference ] @@ -104,8 +111,10 @@ test-suite range : [ range-test algorithm_test/sort ] [ range-test algorithm_test/stable_partition ] [ range-test algorithm_test/stable_sort ] + [ range-test algorithm_test/swap_ranges ] [ range-test algorithm_test/transform ] [ range-test algorithm_test/unique ] + [ range-test algorithm_test/unique_copy ] [ range-test algorithm_test/upper_bound ] [ range-test algorithm_ext_test/copy_n ] [ range-test algorithm_ext_test/erase ] diff --git a/test/adaptor_test/map.cpp b/test/adaptor_test/map.cpp index 73859b4..615b467 100644 --- a/test/adaptor_test/map.cpp +++ b/test/adaptor_test/map.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -111,6 +112,48 @@ namespace boost { map_test_impl< std::map >(); } + + void test_trac_item_4388() + { + typedef std::pair pair_t; + const boost::array ar = {{ + pair_t(3, 'a'), + pair_t(1, 'b'), + pair_t(4, 'c') + }}; + + const boost::array expected_keys = {{ 3, 1, 4 }}; + const boost::array expected_values = {{ 'a', 'b', 'c' }}; + + { + std::vector test; + boost::push_back(test, ar | boost::adaptors::map_keys); + BOOST_CHECK_EQUAL_COLLECTIONS( + expected_keys.begin(), expected_keys.end(), + test.begin(), test.end() + ); + } + + { + std::vector test; + boost::push_back(test, ar | boost::adaptors::map_values); + BOOST_CHECK_EQUAL_COLLECTIONS( + expected_values.begin(), expected_values.end(), + test.begin(), test.end() + ); + } + + { + std::vector test; + boost::array, 3> src(ar); + boost::push_back(test, src | boost::adaptors::map_values); + BOOST_CHECK_EQUAL_COLLECTIONS( + expected_values.begin(), expected_values.end(), + test.begin(), test.end() + ); + } + } + } } @@ -122,6 +165,7 @@ init_unit_test_suite(int argc, char* argv[]) = BOOST_TEST_SUITE( "RangeTestSuite.adaptor.map" ); test->add( BOOST_TEST_CASE( &boost::map_test ) ); + test->add( BOOST_TEST_CASE( &boost::test_trac_item_4388 ) ); return test; } diff --git a/test/algorithm_test/adjacent_find.cpp b/test/algorithm_test/adjacent_find.cpp index 914736b..63b65e8 100644 --- a/test/algorithm_test/adjacent_find.cpp +++ b/test/algorithm_test/adjacent_find.cpp @@ -9,7 +9,7 @@ // For more information, see http://www.boost.org/libs/range/ // #include - +#include #include #include @@ -38,14 +38,18 @@ namespace boost BOOST_CHECK( boost::adjacent_find(cont) == cont.end() ); BOOST_CHECK( boost::adjacent_find(cref_cont) == cref_cont.end() ); + BOOST_CHECK( boost::adjacent_find(boost::make_iterator_range(cont)) == cont.end() ); BOOST_CHECK( boost::adjacent_find(cont, pred) == cont.end() ); BOOST_CHECK( boost::adjacent_find(cref_cont, pred) == cref_cont.end() ); + BOOST_CHECK( boost::adjacent_find(boost::make_iterator_range(cont), pred) == cont.end() ); cont += 1; BOOST_CHECK( boost::adjacent_find(cont) == cont.end() ); BOOST_CHECK( boost::adjacent_find(cref_cont) == cref_cont.end() ); + BOOST_CHECK( boost::adjacent_find(boost::make_iterator_range(cont)) == cont.end() ); BOOST_CHECK( boost::adjacent_find(cont, pred) == cont.end() ); BOOST_CHECK( boost::adjacent_find(cref_cont, pred) == cref_cont.end() ); + BOOST_CHECK( boost::adjacent_find(boost::make_iterator_range(cont), pred) == cont.end() ); cont += 2,3,4,5,5,5,6,7,8,9; iterator_t it = boost::adjacent_find(cont); @@ -57,6 +61,8 @@ namespace boost { BOOST_CHECK( *it == 5 ); } + BOOST_CHECK( it == boost::adjacent_find(boost::make_iterator_range(cont)) ); + BOOST_CHECK( it_pred == boost::adjacent_find(boost::make_iterator_range(cont), pred) ); const_iterator_t cit = boost::adjacent_find(cref_cont); const_iterator_t cit_pred = boost::adjacent_find(cref_cont, pred); BOOST_CHECK( cit == cit_pred ); diff --git a/test/algorithm_test/binary_search.cpp b/test/algorithm_test/binary_search.cpp index e0aca31..2646c2e 100644 --- a/test/algorithm_test/binary_search.cpp +++ b/test/algorithm_test/binary_search.cpp @@ -37,6 +37,8 @@ namespace boost BOOST_CHECK( reference_result == test_result ); + BOOST_CHECK( test_result == boost::binary_search(boost::make_iterator_range(test), 5) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), test.begin(), test.end() @@ -68,6 +70,8 @@ namespace boost bool test_result = boost::binary_search(test, 5, pred); + BOOST_CHECK( test_result == boost::binary_search(boost::make_iterator_range(test), 5, pred) ); + BOOST_CHECK( reference_result == test_result ); BOOST_CHECK_EQUAL_COLLECTIONS( diff --git a/test/algorithm_test/copy.cpp b/test/algorithm_test/copy.cpp index 932d190..47f4172 100644 --- a/test/algorithm_test/copy.cpp +++ b/test/algorithm_test/copy.cpp @@ -42,6 +42,13 @@ namespace boost target.begin(), target.end(), source.begin(), source.end() ); + + it == boost::copy(boost::make_iterator_range(source), target.begin()); + + BOOST_CHECK( it == target.end() ); + + BOOST_CHECK_EQUAL_COLLECTIONS(target.begin(), target.end(), + source.begin(), source.end()); } void test_copy() diff --git a/test/algorithm_test/copy_backward.cpp b/test/algorithm_test/copy_backward.cpp index d66082a..3fd5679 100644 --- a/test/algorithm_test/copy_backward.cpp +++ b/test/algorithm_test/copy_backward.cpp @@ -39,6 +39,10 @@ namespace boost BOOST_CHECK( it == target.end() ); BOOST_CHECK_EQUAL_COLLECTIONS( target.begin(), target.end(), source.rbegin(), source.rend() ); + + BOOST_CHECK( it == boost::copy_backward(boost::make_iterator_range(source), target.begin()) ); + BOOST_CHECK_EQUAL_COLLECTIONS( target.begin(), target.end(), + source.rbegin(), source.rend() ); } void test_copy_backward() diff --git a/test/algorithm_test/copy_n.cpp b/test/algorithm_test/copy_n.cpp new file mode 100644 index 0000000..230eb03 --- /dev/null +++ b/test/algorithm_test/copy_n.cpp @@ -0,0 +1,70 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +#include + +namespace +{ + template< class Container > + void test_copy_n_impl() + { + Container source; + typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t; + + std::vector target; + target.resize(source.size()); + + typedef BOOST_DEDUCED_TYPENAME range_iterator< std::vector >::type iterator_t; + iterator_t it = boost::copy(source, target.begin()); + + BOOST_CHECK( it == target.end() ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + target.begin(), target.end(), + source.begin(), source.end() + ); + + it = boost::copy(boost::make_iterator_range(source), target.begin()); + + BOOST_CHECK( it == target.end() ); + + BOOST_CHECK_EQUAL_COLLECTIONS(target.begin(), target.end(), + source.begin(), source.end()); + } + + void test_copy_n() + { + test_copy_n_impl< std::vector >(); + test_copy_n_impl< std::list >(); + test_copy_n_impl< std::set >(); + test_copy_n_impl< std::multiset >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.copy_n" ); + + test->add( BOOST_TEST_CASE( &::test_copy_n ) ); + + return test; +} diff --git a/test/algorithm_test/count.cpp b/test/algorithm_test/count.cpp index d364710..90b2090 100644 --- a/test/algorithm_test/count.cpp +++ b/test/algorithm_test/count.cpp @@ -31,28 +31,36 @@ namespace boost Container cont; const Container& cref_cont = cont; - BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0) ); - BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(boost::make_iterator_range(cont), 0u) ); cont += 1; - BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0) ); - BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0) ); - BOOST_CHECK_EQUAL( 1u, boost::count(cont, 1) ); - BOOST_CHECK_EQUAL( 1u, boost::count(cref_cont, 1) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(boost::make_iterator_range(cont), 0u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(cont, 1u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(cref_cont, 1u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(boost::make_iterator_range(cont), 1u) ); cont += 2,3,4,5,6,7,8,9; - BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0) ); - BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0) ); - BOOST_CHECK_EQUAL( 1u, boost::count(cont, 1) ); - BOOST_CHECK_EQUAL( 1u, boost::count(cref_cont, 1) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(boost::make_iterator_range(cont), 0u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(cont, 1u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(cref_cont, 1u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(boost::make_iterator_range(cont), 1u) ); cont += 2; - BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0) ); - BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0) ); - BOOST_CHECK_EQUAL( 1u, boost::count(cont, 1) ); - BOOST_CHECK_EQUAL( 1u, boost::count(cref_cont, 1) ); - BOOST_CHECK_EQUAL( 2u, boost::count(cont, 2) ); - BOOST_CHECK_EQUAL( 2u, boost::count(cref_cont, 2) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(cref_cont, 0u) ); + BOOST_CHECK_EQUAL( 0u, boost::count(boost::make_iterator_range(cont), 0u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(cont, 1u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(cref_cont, 1u) ); + BOOST_CHECK_EQUAL( 1u, boost::count(boost::make_iterator_range(cont), 1u) ); + BOOST_CHECK_EQUAL( 2u, boost::count(cont, 2u) ); + BOOST_CHECK_EQUAL( 2u, boost::count(cref_cont, 2u) ); + BOOST_CHECK_EQUAL( 2u, boost::count(boost::make_iterator_range(cont), 2u) ); } void test_count() diff --git a/test/algorithm_test/count_if.cpp b/test/algorithm_test/count_if.cpp index 11526b4..c3d1b8b 100644 --- a/test/algorithm_test/count_if.cpp +++ b/test/algorithm_test/count_if.cpp @@ -15,6 +15,7 @@ #include #include "../test_function/false_predicate.hpp" +#include "../test_function/true_predicate.hpp" #include "../test_function/equal_to_x.hpp" #include #include @@ -38,29 +39,42 @@ namespace boost BOOST_CHECK_EQUAL( 0u, boost::count_if(cont, pred_t(0)) ); BOOST_CHECK_EQUAL( 0u, boost::count_if(cref_cont, pred_t(0)) ); + BOOST_CHECK_EQUAL( 0u, boost::count_if(boost::make_iterator_range(cont), pred_t(0)) ); cont += 1; BOOST_CHECK_EQUAL( 0u, boost::count_if(cont, pred_t(0)) ); BOOST_CHECK_EQUAL( 0u, boost::count_if(cref_cont, pred_t(0)) ); + BOOST_CHECK_EQUAL( 0u, boost::count_if(boost::make_iterator_range(cont), pred_t(0)) ); BOOST_CHECK_EQUAL( 1u, boost::count_if(cont, pred_t(1)) ); BOOST_CHECK_EQUAL( 1u, boost::count_if(cref_cont, pred_t(1)) ); + BOOST_CHECK_EQUAL( 1u, boost::count_if(boost::make_iterator_range(cont), pred_t(1)) ); cont += 2,3,4,5,6,7,8,9; BOOST_CHECK_EQUAL( 0u, boost::count_if(cont, pred_t(0)) ); BOOST_CHECK_EQUAL( 0u, boost::count_if(cref_cont, pred_t(0)) ); + BOOST_CHECK_EQUAL( 0u, boost::count_if(boost::make_iterator_range(cont), pred_t(0)) ); BOOST_CHECK_EQUAL( 1u, boost::count_if(cont, pred_t(1)) ); BOOST_CHECK_EQUAL( 1u, boost::count_if(cref_cont, pred_t(1)) ); + BOOST_CHECK_EQUAL( 1u, boost::count_if(boost::make_iterator_range(cont), pred_t(1)) ); cont += 2; BOOST_CHECK_EQUAL( 0u, boost::count_if(cont, pred_t(0)) ); BOOST_CHECK_EQUAL( 0u, boost::count_if(cref_cont, pred_t(0)) ); + BOOST_CHECK_EQUAL( 0u, boost::count_if(boost::make_iterator_range(cont), pred_t(0)) ); BOOST_CHECK_EQUAL( 1u, boost::count_if(cont, pred_t(1)) ); BOOST_CHECK_EQUAL( 1u, boost::count_if(cref_cont, pred_t(1)) ); + BOOST_CHECK_EQUAL( 1u, boost::count_if(boost::make_iterator_range(cont), pred_t(1)) ); BOOST_CHECK_EQUAL( 2u, boost::count_if(cont, pred_t(2)) ); BOOST_CHECK_EQUAL( 2u, boost::count_if(cref_cont, pred_t(2)) ); + BOOST_CHECK_EQUAL( 2u, boost::count_if(boost::make_iterator_range(cont), pred_t(2)) ); BOOST_CHECK_EQUAL( 0u, boost::count_if(cont, false_predicate()) ); BOOST_CHECK_EQUAL( 0u, boost::count_if(cref_cont, false_predicate()) ); + BOOST_CHECK_EQUAL( 0u, boost::count_if(boost::make_iterator_range(cont), false_predicate()) ); + + BOOST_CHECK_EQUAL( cont.size(), boost::count_if(cont, true_predicate()) ); + BOOST_CHECK_EQUAL( cont.size(), boost::count_if(cref_cont, true_predicate()) ); + BOOST_CHECK_EQUAL( cont.size(), boost::count_if(boost::make_iterator_range(cont), true_predicate()) ); } void test_count_if() diff --git a/test/algorithm_test/equal.cpp b/test/algorithm_test/equal.cpp index d750706..243f064 100644 --- a/test/algorithm_test/equal.cpp +++ b/test/algorithm_test/equal.cpp @@ -38,30 +38,70 @@ namespace boost Container2& cont2 = mcont2; BOOST_CHECK( boost::equal(cont1, cont2) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), cont2) ); + BOOST_CHECK( boost::equal(cont1, boost::make_iterator_range(cont2)) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2)) ); BOOST_CHECK( boost::equal(cont1, cont2, std::equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), cont2, std::equal_to()) ); + BOOST_CHECK( boost::equal(cont1, boost::make_iterator_range(cont2), std::equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::equal_to()) ); BOOST_CHECK( boost::equal(cont1, cont2, std::not_equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), cont2, std::not_equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::not_equal_to()) ); mcont1 += 1; BOOST_CHECK( !boost::equal(cont1, cont2) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2) ); + BOOST_CHECK( !boost::equal(cont1, boost::make_iterator_range(cont2)) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2)) ); BOOST_CHECK( !boost::equal(cont1, cont2, std::equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2, std::equal_to()) ); + BOOST_CHECK( !boost::equal(cont1, boost::make_iterator_range(cont2), std::equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::equal_to()) ); BOOST_CHECK( !boost::equal(cont1, cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::not_equal_to()) ); mcont1.clear(); mcont2 += 1; BOOST_CHECK( !boost::equal(cont1, cont2) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2)) ); BOOST_CHECK( !boost::equal(cont1, cont2, std::equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2, std::equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::equal_to()) ); BOOST_CHECK( !boost::equal(cont1, cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::not_equal_to()) ); mcont1 += 1; BOOST_CHECK( boost::equal(cont1, cont2) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), cont2) ); + BOOST_CHECK( boost::equal(cont1, boost::make_iterator_range(cont2)) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2)) ); BOOST_CHECK( boost::equal(cont1, cont2, std::equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), cont2, std::equal_to()) ); + BOOST_CHECK( boost::equal(cont1, boost::make_iterator_range(cont2), std::equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::equal_to()) ); BOOST_CHECK( !boost::equal(cont1, cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(cont1, boost::make_iterator_range(cont2), std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::not_equal_to()) ); mcont1 += 2,3,4,5,6,7,8,9; mcont2 += 2,3,4,5,6,7,8,9; BOOST_CHECK( boost::equal(cont1, cont2) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), cont2) ); + BOOST_CHECK( boost::equal(cont1, boost::make_iterator_range(cont2)) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2)) ); BOOST_CHECK( boost::equal(cont1, cont2, std::equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), cont2, std::equal_to()) ); + BOOST_CHECK( boost::equal(cont1, boost::make_iterator_range(cont2), std::equal_to()) ); + BOOST_CHECK( boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::equal_to()) ); BOOST_CHECK( !boost::equal(cont1, cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), cont2, std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(cont1, boost::make_iterator_range(cont2), std::not_equal_to()) ); + BOOST_CHECK( !boost::equal(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), std::not_equal_to()) ); } template< class Container1, class Container2 > diff --git a/test/algorithm_test/equal_range.cpp b/test/algorithm_test/equal_range.cpp index 652508c..612f1a4 100644 --- a/test/algorithm_test/equal_range.cpp +++ b/test/algorithm_test/equal_range.cpp @@ -70,8 +70,11 @@ namespace boost pair_t test_result = boost::equal_range(test, 5); - check_result(reference, reference_result, - test, test_result); + check_result(reference, reference_result, test, test_result); + + pair_t test_result2 = boost::equal_range(boost::make_iterator_range(test), 5); + + check_result(reference, reference_result, test, test_result2); } template @@ -107,8 +110,11 @@ namespace boost pair_t test_result = boost::equal_range(test, 5, BinaryPredicate()); - check_result(reference, reference_result, - test, test_result); + check_result(reference, reference_result, test, test_result); + + pair_t test_result2 = boost::equal_range(boost::make_iterator_range(test), 5, BinaryPredicate()); + + check_result(reference, reference_result, test, test_result2); } template diff --git a/test/algorithm_test/fill.cpp b/test/algorithm_test/fill.cpp index 93dba7e..2f975c4 100644 --- a/test/algorithm_test/fill.cpp +++ b/test/algorithm_test/fill.cpp @@ -36,6 +36,12 @@ namespace boost BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), target.begin(), target.end() ); + + Container target2(cont); + boost::fill(boost::make_iterator_range(target2), 1); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target2.begin(), target2.end() ); } template< class Container > diff --git a/test/algorithm_test/find.cpp b/test/algorithm_test/find.cpp index fd179f1..6eb1528 100644 --- a/test/algorithm_test/find.cpp +++ b/test/algorithm_test/find.cpp @@ -33,7 +33,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::find(cont, 3); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::find(cont, 3); + iter_t result2 = boost::find(boost::make_iterator_range(cont), 3); + BOOST_CHECK( result == result2 ); + return result; } template @@ -43,7 +47,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy&, Container& cont) { - return boost::find(cont, 3); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::find(cont, 3); + result_t result2 = boost::find(boost::make_iterator_range(cont), 3); + BOOST_CHECK( result == result2 ); + return result; } }; @@ -90,6 +98,8 @@ namespace boost std::vector vi; const std::vector& cvi = vi; std::vector::const_iterator it = boost::find(vi, 0); + std::vector::const_iterator it2 = boost::find(cvi, 0); + BOOST_CHECK( it == it2 ); } } } diff --git a/test/algorithm_test/find_end.cpp b/test/algorithm_test/find_end.cpp index a126e87..0592d5f 100644 --- a/test/algorithm_test/find_end.cpp +++ b/test/algorithm_test/find_end.cpp @@ -41,7 +41,12 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::find_end(cont, m_cont); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::find_end(cont, m_cont); + BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), m_cont) ); + BOOST_CHECK( result == boost::find_end(cont, boost::make_iterator_range(m_cont)) ); + BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont)) ); + return result; } template @@ -51,7 +56,13 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::find_end(cont, policy.cont()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::find_end(cont, policy.cont()); + BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), policy.cont()) ); + BOOST_CHECK( result == boost::find_end(cont, boost::make_iterator_range(policy.cont())) ); + BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), + boost::make_iterator_range(policy.cont())) ); + return result; } }; @@ -84,7 +95,12 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::find_end(cont, m_cont, m_pred); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t it = boost::find_end(cont, m_cont, m_pred); + BOOST_CHECK( it == boost::find_end(boost::make_iterator_range(cont), m_cont, m_pred) ); + BOOST_CHECK( it == boost::find_end(cont, boost::make_iterator_range(m_cont), m_pred) ); + BOOST_CHECK( it == boost::find_end(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont), m_pred) ); + return it; } template @@ -94,6 +110,12 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::find_end(cont, policy.cont(), policy.pred()); + BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), policy.cont(), policy.pred()) ); + BOOST_CHECK( result == boost::find_end(cont, boost::make_iterator_range(policy.cont()), policy.pred()) ); + BOOST_CHECK( result == boost::find_end(boost::make_iterator_range(cont), + boost::make_iterator_range(policy.cont()), policy.pred()) ); return boost::find_end(cont, policy.cont(), policy.pred()); } }; diff --git a/test/algorithm_test/find_first_of.cpp b/test/algorithm_test/find_first_of.cpp index 9ff7adb..c96d36a 100644 --- a/test/algorithm_test/find_first_of.cpp +++ b/test/algorithm_test/find_first_of.cpp @@ -41,7 +41,12 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::find_first_of(cont, m_cont); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::find_first_of(cont, m_cont); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), m_cont) ); + BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(m_cont)) ); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont)) ); + return result; } template @@ -51,7 +56,12 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::find_first_of(cont, policy.cont()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::find_first_of(cont, policy.cont()); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), policy.cont()) ); + BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(policy.cont())) ); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(policy.cont())) ); + return result; } }; @@ -84,7 +94,12 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::find_first_of(cont, m_cont, m_pred); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::find_first_of(cont, m_cont, m_pred); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), m_cont, m_pred) ); + BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(m_cont), m_pred) ); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(m_cont), m_pred) ); + return result; } template @@ -94,7 +109,12 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::find_first_of(cont, policy.cont(), policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::find_first_of(cont, policy.cont(), policy.pred()); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), policy.cont(), policy.pred()) ); + BOOST_CHECK( result == boost::find_first_of(cont, boost::make_iterator_range(policy.cont()), policy.pred()) ); + BOOST_CHECK( result == boost::find_first_of(boost::make_iterator_range(cont), boost::make_iterator_range(policy.cont()), policy.pred()) ); + return result; } }; @@ -103,8 +123,8 @@ namespace boost reference(Container& cont) { return std::find_first_of(cont.begin(), cont.end(), - m_cont.begin(), m_cont.end(), - m_pred); + m_cont.begin(), m_cont.end(), + m_pred); } private: diff --git a/test/algorithm_test/find_if.cpp b/test/algorithm_test/find_if.cpp index a5fe459..04fe6f2 100644 --- a/test/algorithm_test/find_if.cpp +++ b/test/algorithm_test/find_if.cpp @@ -38,7 +38,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::find_if(cont, m_pred); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::find_if(cont, m_pred); + BOOST_CHECK( result == boost::find_if(boost::make_iterator_range(cont), m_pred) ); + return result; } template @@ -48,7 +51,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(find_if_test_policy& policy, Container& cont) { - return boost::find_if(cont, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::find_if(cont, policy.pred()); + BOOST_CHECK( result == boost::find_if(boost::make_iterator_range(cont), policy.pred()) ); + return result; } }; diff --git a/test/algorithm_test/for_each.cpp b/test/algorithm_test/for_each.cpp index ac517ad..2ef51bf 100644 --- a/test/algorithm_test/for_each.cpp +++ b/test/algorithm_test/for_each.cpp @@ -26,6 +26,12 @@ namespace boost { namespace { + template< class Range > + unsigned int udistance(Range& rng) + { + return static_cast(boost::distance(rng)); + } + template< class SinglePassRange > void test_for_each_impl( SinglePassRange rng ) { @@ -35,12 +41,15 @@ namespace boost // Test the mutable version fn_t result_fn = boost::for_each(rng, fn_t(rng)); - BOOST_CHECK_EQUAL( boost::distance(rng), result_fn.invocation_count() ); + BOOST_CHECK_EQUAL( boost::udistance(rng), result_fn.invocation_count() ); + + fn_t result_fn2 = boost::for_each(boost::make_iterator_range(rng), fn_t(rng)); + BOOST_CHECK_EQUAL( boost::udistance(rng), result_fn.invocation_count() ); // Test the constant version const SinglePassRange& cref_rng = rng; result_fn = boost::for_each(cref_rng, fn_t(cref_rng)); - BOOST_CHECK_EQUAL( boost::distance(cref_rng), result_fn.invocation_count() ); + BOOST_CHECK_EQUAL( boost::udistance(cref_rng), result_fn.invocation_count() ); } template< class Container > @@ -51,7 +60,7 @@ namespace boost // Test empty Container cont; test_for_each_impl(cont); - + // Test one element cont += 0; test_for_each_impl(cont); @@ -63,7 +72,7 @@ namespace boost void test_for_each() { - boost::array a = { 0,1,2,3,4,5,6,7,8,9 }; + boost::array a = {{ 0,1,2,3,4,5,6,7,8,9 }}; test_for_each_impl(a); test_for_each_t< std::vector >(); @@ -79,8 +88,8 @@ init_unit_test_suite(int argc, char* argv[]) { boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.for_each" ); - + test->add( BOOST_TEST_CASE( &boost::test_for_each ) ); - + return test; } diff --git a/test/algorithm_test/generate.cpp b/test/algorithm_test/generate.cpp index ab47b06..d8fc0e6 100644 --- a/test/algorithm_test/generate.cpp +++ b/test/algorithm_test/generate.cpp @@ -49,6 +49,12 @@ namespace boost BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), test.begin(), test.end() ); + + Container test2(cont); + boost::generate(boost::make_iterator_range(test2), generator_fn()); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); } template< class Container > diff --git a/test/algorithm_test/heap.cpp b/test/algorithm_test/heap.cpp index 933d1f6..74b7fa3 100644 --- a/test/algorithm_test/heap.cpp +++ b/test/algorithm_test/heap.cpp @@ -41,28 +41,39 @@ namespace boost reference += 1,2,3,4,5,6,7,8,9; std::vector test_cont(reference); + std::vector test_cont2(reference); std::make_heap(reference.begin(), reference.end()); boost::make_heap(test_cont); check_equal(reference, test_cont); + boost::make_heap(boost::make_iterator_range(test_cont2)); + check_equal(reference, test_cont2); std::push_heap(reference.begin(), reference.end()); boost::push_heap(test_cont); check_equal(reference, test_cont); + boost::push_heap(boost::make_iterator_range(test_cont2)); + check_equal(reference, test_cont2); std::make_heap(reference.begin(), reference.end()); boost::make_heap(test_cont); + boost::make_heap(boost::make_iterator_range(test_cont2)); std::sort_heap(reference.begin(), reference.end()); boost::sort_heap(test_cont); check_equal(reference, test_cont); + boost::sort_heap(boost::make_iterator_range(test_cont2)); + check_equal(reference, test_cont2); std::make_heap(reference.begin(), reference.end()); boost::make_heap(test_cont); + boost::make_heap(boost::make_iterator_range(test_cont2)); std::pop_heap(reference.begin(), reference.end()); boost::pop_heap(test_cont); check_equal(reference, test_cont); + boost::pop_heap(boost::make_iterator_range(test_cont2)); + check_equal(reference, test_cont2); } template @@ -75,30 +86,42 @@ namespace boost std::sort(reference.begin(), reference.end(), pred); std::vector test_cont(reference); + std::vector test_cont2(reference); std::make_heap(reference.begin(), reference.end(), pred); boost::make_heap(test_cont, pred); check_equal(reference, test_cont); + boost::make_heap(boost::make_iterator_range(test_cont2), pred); + check_equal(reference, test_cont2); reference.push_back(5); test_cont.push_back(5); + test_cont2.push_back(5); std::push_heap(reference.begin(), reference.end(), pred); boost::push_heap(test_cont, pred); check_equal(reference, test_cont); + boost::push_heap(boost::make_iterator_range(test_cont2), pred); + check_equal(reference, test_cont2); std::make_heap(reference.begin(), reference.end(), pred); boost::make_heap(test_cont, pred); + boost::make_heap(boost::make_iterator_range(test_cont2), pred); std::sort_heap(reference.begin(), reference.end(), pred); boost::sort_heap(test_cont, pred); check_equal(reference, test_cont); + boost::sort_heap(boost::make_iterator_range(test_cont2), pred); + check_equal(reference, test_cont2); std::make_heap(reference.begin(), reference.end(), pred); boost::make_heap(test_cont, pred); + boost::make_heap(boost::make_iterator_range(test_cont2), pred); std::pop_heap(reference.begin(), reference.end(), pred); boost::pop_heap(test_cont, pred); check_equal(reference, test_cont); + boost::pop_heap(boost::make_iterator_range(test_cont2), pred); + check_equal(reference, test_cont2); } void test_heap() diff --git a/test/algorithm_test/includes.cpp b/test/algorithm_test/includes.cpp index f928957..8977532 100644 --- a/test/algorithm_test/includes.cpp +++ b/test/algorithm_test/includes.cpp @@ -46,6 +46,10 @@ namespace boost old_cont2.begin(), old_cont2.end(), cont2.begin(), cont2.end() ); + + BOOST_CHECK( test_result == boost::includes(boost::make_iterator_range(cont1), cont2) ); + BOOST_CHECK( test_result == boost::includes(cont1, boost::make_iterator_range(cont2)) ); + BOOST_CHECK( test_result == boost::includes(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2)) ); } template @@ -88,6 +92,10 @@ namespace boost old_cont2.begin(), old_cont2.end(), cont2.begin(), cont2.end() ); + + BOOST_CHECK( test_result == boost::includes(boost::make_iterator_range(cont1), cont2, pred) ); + BOOST_CHECK( test_result == boost::includes(cont1, boost::make_iterator_range(cont2), pred) ); + BOOST_CHECK( test_result == boost::includes(boost::make_iterator_range(cont1), boost::make_iterator_range(cont2), pred) ); } template diff --git a/test/algorithm_test/inplace_merge.cpp b/test/algorithm_test/inplace_merge.cpp index f109257..d0cad73 100644 --- a/test/algorithm_test/inplace_merge.cpp +++ b/test/algorithm_test/inplace_merge.cpp @@ -35,6 +35,7 @@ namespace boost cont2.begin(), cont2.end()); std::vector test_target(reference_target); + std::vector test_target2(reference_target); std::inplace_merge(reference_target.begin(), reference_target.begin() + cont1.size(), @@ -47,6 +48,14 @@ namespace boost reference_target.begin(), reference_target.end(), test_target.begin(), test_target.end() ); + + boost::inplace_merge(boost::make_iterator_range(test_target2), + test_target2.begin() + cont1.size()); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target2.begin(), test_target2.end() + ); } template @@ -75,6 +84,7 @@ namespace boost cont2.begin(), cont2.end()); std::vector test_target(reference_target); + std::vector test_target2(reference_target); std::inplace_merge(reference_target.begin(), reference_target.begin() + cont1.size(), @@ -88,6 +98,15 @@ namespace boost reference_target.begin(), reference_target.end(), test_target.begin(), test_target.end() ); + + boost::inplace_merge(boost::make_iterator_range(test_target2), + test_target2.begin() + cont1.size(), + pred); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target2.begin(), test_target2.end() + ); } template diff --git a/test/algorithm_test/lexicographical_compare.cpp b/test/algorithm_test/lexicographical_compare.cpp index c57f390..f724bd1 100644 --- a/test/algorithm_test/lexicographical_compare.cpp +++ b/test/algorithm_test/lexicographical_compare.cpp @@ -28,13 +28,16 @@ namespace boost void test_lexicographical_compare_impl_nopred(ForwardRange1& rng1, ForwardRange2& rng2) { - bool reference = std::lexicographical_compare( + const bool reference = std::lexicographical_compare( boost::begin(rng1), boost::end(rng1), boost::begin(rng2), boost::end(rng2)); - bool test = boost::lexicographical_compare(rng1, rng2); + const bool test = boost::lexicographical_compare(rng1, rng2); BOOST_CHECK( reference == test ); + BOOST_CHECK( test == boost::lexicographical_compare(boost::make_iterator_range(rng1), rng2) ); + BOOST_CHECK( test == boost::lexicographical_compare(rng1, boost::make_iterator_range(rng2)) ); + BOOST_CHECK( test == boost::lexicographical_compare(boost::make_iterator_range(rng1), boost::make_iterator_range(rng2)) ); } template diff --git a/test/algorithm_test/lower_bound.cpp b/test/algorithm_test/lower_bound.cpp index ca622bc..e627708 100644 --- a/test/algorithm_test/lower_bound.cpp +++ b/test/algorithm_test/lower_bound.cpp @@ -33,7 +33,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::lower_bound(cont, 5); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::lower_bound(cont, 5); + BOOST_CHECK( result == boost::lower_bound(boost::make_iterator_range(cont), 5) ); + return result; } template @@ -43,7 +46,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy&, Container& cont) { - return boost::lower_bound(cont, 5); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::lower_bound(cont, 5); + BOOST_CHECK( result == boost::lower_bound(boost::make_iterator_range(cont), 5) ); + return result; } }; @@ -62,7 +68,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::lower_bound(cont, 5, m_pred); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::lower_bound(cont, 5, m_pred); + BOOST_CHECK( result == boost::lower_bound( + boost::make_iterator_range(cont), 5, m_pred) ); + return result; } template< range_return_value return_type > @@ -72,8 +82,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::lower_bound( - cont, 5, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::lower_bound(cont, 5, policy.pred()); + BOOST_CHECK( result == boost::lower_bound( + boost::make_iterator_range(cont), 5, policy.pred()) ); + return result; } }; diff --git a/test/algorithm_test/max_element.cpp b/test/algorithm_test/max_element.cpp index d4c70ca..c4c6cb9 100644 --- a/test/algorithm_test/max_element.cpp +++ b/test/algorithm_test/max_element.cpp @@ -33,7 +33,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::max_element(cont); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::max_element(cont); + BOOST_CHECK( result == boost::max_element( + boost::make_iterator_range(cont)) ); + return result; } template @@ -43,7 +47,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy&, Container& cont) { - return boost::max_element(cont); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::max_element(cont); + BOOST_CHECK( result == boost::max_element( + boost::make_iterator_range(cont)) ); + return result; } }; @@ -63,7 +71,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::max_element(cont, Pred()); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::max_element(cont, Pred()); + BOOST_CHECK( result == boost::max_element( + boost::make_iterator_range(cont), Pred()) ); + return result; } Pred pred() const { return Pred(); } @@ -75,7 +87,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::max_element(cont, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::max_element(cont, policy.pred()); + BOOST_CHECK( result == boost::max_element( + boost::make_iterator_range(cont), policy.pred()) ); + return result; } }; diff --git a/test/algorithm_test/merge.cpp b/test/algorithm_test/merge.cpp index aed7cd7..5038782 100644 --- a/test/algorithm_test/merge.cpp +++ b/test/algorithm_test/merge.cpp @@ -51,6 +51,46 @@ namespace boost reference_target.begin(), reference_target.end(), test_target.begin(), test_target.end() ); + + test_it = boost::merge(boost::make_iterator_range(cont1), + cont2, test_target.begin()); + + BOOST_CHECK_EQUAL( + std::distance(reference_target.begin(), reference_it), + std::distance(test_target.begin(), test_it) + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target.begin(), test_target.end() + ); + + test_it = boost::merge(cont1, boost::make_iterator_range(cont2), + test_target.begin()); + + BOOST_CHECK_EQUAL( + std::distance(reference_target.begin(), reference_it), + std::distance(test_target.begin(), test_it) + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target.begin(), test_target.end() + ); + + test_it = boost::merge(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_target.begin()); + + BOOST_CHECK_EQUAL( + std::distance(reference_target.begin(), reference_it), + std::distance(test_target.begin(), test_it) + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target.begin(), test_target.end() + ); } template @@ -95,6 +135,46 @@ namespace boost reference_target.begin(), reference_target.end(), test_target.begin(), test_target.end() ); + + test_it = boost::merge(boost::make_iterator_range(cont1), cont2, + test_target.begin(), pred); + + BOOST_CHECK_EQUAL( + std::distance(reference_target.begin(), reference_it), + std::distance(test_target.begin(), test_it) + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target.begin(), test_target.end() + ); + + test_it = boost::merge(cont1, boost::make_iterator_range(cont2), + test_target.begin(), pred); + + BOOST_CHECK_EQUAL( + std::distance(reference_target.begin(), reference_it), + std::distance(test_target.begin(), test_it) + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target.begin(), test_target.end() + ); + + test_it = boost::merge(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_target.begin(), pred); + + BOOST_CHECK_EQUAL( + std::distance(reference_target.begin(), reference_it), + std::distance(test_target.begin(), test_it) + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference_target.begin(), reference_target.end(), + test_target.begin(), test_target.end() + ); } template diff --git a/test/algorithm_test/min_element.cpp b/test/algorithm_test/min_element.cpp index c68a655..c8fceda 100644 --- a/test/algorithm_test/min_element.cpp +++ b/test/algorithm_test/min_element.cpp @@ -33,7 +33,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::min_element(cont); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::min_element(cont); + BOOST_CHECK( result == boost::min_element(boost::make_iterator_range(cont)) ); + return result; } template< range_return_value return_type > @@ -43,7 +46,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy&, Container& cont) { - return boost::min_element(cont); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::min_element(cont); + BOOST_CHECK( result == boost::min_element(boost::make_iterator_range(cont)) ); + return result; } }; @@ -63,7 +69,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::min_element(cont, Pred()); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::min_element(cont, Pred()); + BOOST_CHECK( result == boost::min_element( + boost::make_iterator_range(cont), Pred()) ); + return result; } Pred pred() const { return Pred(); } @@ -75,7 +85,11 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::min_element(cont, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::min_element(cont, policy.pred()); + BOOST_CHECK( result == boost::min_element( + boost::make_iterator_range(cont), policy.pred()) ); + return result; } }; diff --git a/test/algorithm_test/mismatch.cpp b/test/algorithm_test/mismatch.cpp index eb8f5e7..2336e59 100644 --- a/test/algorithm_test/mismatch.cpp +++ b/test/algorithm_test/mismatch.cpp @@ -23,6 +23,130 @@ namespace boost { namespace { + template< class Container1, class Container2 > + void eval_mismatch(Container1& cont1, + Container2& cont2, + BOOST_DEDUCED_TYPENAME range_iterator::type ref_it1, + BOOST_DEDUCED_TYPENAME range_iterator::type ref_it2 + ) + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter1_t; + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter2_t; + typedef std::pair result_pair_t; + + result_pair_t result = boost::mismatch(cont1, cont2); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + + result = boost::mismatch(boost::make_iterator_range(cont1), + cont2); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + + result = boost::mismatch(cont1, + boost::make_iterator_range(cont2)); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + + result = boost::mismatch(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2)); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + } + + template< class Container1, class Container2, class Pred > + void eval_mismatch(Container1& cont1, + Container2& cont2, + Pred pred, + BOOST_DEDUCED_TYPENAME range_iterator::type ref_it1, + BOOST_DEDUCED_TYPENAME range_iterator::type ref_it2 + ) + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter1_t; + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter2_t; + typedef std::pair result_pair_t; + + result_pair_t result = boost::mismatch(cont1, cont2, pred); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + + result = boost::mismatch(boost::make_iterator_range(cont1), + cont2, pred); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + + result = boost::mismatch(cont1, + boost::make_iterator_range(cont2), pred); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + + result = boost::mismatch(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + pred); + BOOST_CHECK( result.first == ref_it1 ); + BOOST_CHECK( result.second == ref_it2 ); + } + + template< class Container1, class Container2 > + void eval_mismatch(Container1& cont1, + Container2& cont2, + const int ref1, + const int ref2) + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter1_t; + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter2_t; + typedef std::pair result_pair_t; + + result_pair_t result = boost::mismatch(cont1, cont2); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + + result = boost::mismatch(boost::make_iterator_range(cont1), cont2); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + + result = boost::mismatch(cont1, boost::make_iterator_range(cont2)); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + + result = boost::mismatch(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2)); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + } + + template< class Container1, class Container2, class Pred > + void eval_mismatch(Container1& cont1, + Container2& cont2, + Pred pred, + const int ref1, + const int ref2) + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter1_t; + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter2_t; + typedef std::pair result_pair_t; + + result_pair_t result = boost::mismatch(cont1, cont2, pred); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + + result = boost::mismatch(boost::make_iterator_range(cont1), + cont2, pred); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + + result = boost::mismatch(cont1, boost::make_iterator_range(cont2), + pred); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + + result = boost::mismatch(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + pred); + BOOST_CHECK_EQUAL( ref1, *result.first ); + BOOST_CHECK_EQUAL( ref2, *result.second ); + } + template< class Container1, class Container2 > void test_mismatch_impl() { @@ -46,107 +170,42 @@ namespace boost typedef std::pair pair_mcit_t; typedef std::pair pair_ccit_t; - pair_mmit_t pair_mmit = boost::mismatch(cont1, cont2); - BOOST_CHECK( pair_mmit.first == cont1.end() ); - BOOST_CHECK( pair_mmit.second == cont2.end() ); - pair_mmit = boost::mismatch(cont1, cont2, std::equal_to()); - BOOST_CHECK( pair_mmit.first == cont1.end() ); - BOOST_CHECK( pair_mmit.second == cont2.end() ); - - pair_cmit_t pair_cmit = boost::mismatch(cref_cont1, cont2); - BOOST_CHECK( pair_cmit.first == cref_cont1.end() ); - BOOST_CHECK( pair_cmit.second == cont2.end() ); - pair_cmit = boost::mismatch(cref_cont1, cont2, std::equal_to()); - BOOST_CHECK( pair_cmit.first == cref_cont1.end() ); - BOOST_CHECK( pair_cmit.second == cont2.end() ); - - pair_mcit_t pair_mcit = boost::mismatch(cont1, cref_cont2); - BOOST_CHECK( pair_mcit.first == cont1.end() ); - BOOST_CHECK( pair_mcit.second == cref_cont2.end() ); - pair_mcit = boost::mismatch(cont1, cref_cont2, std::equal_to()); - BOOST_CHECK( pair_mcit.first == cont1.end() ); - BOOST_CHECK( pair_mcit.second == cref_cont2.end() ); - - pair_ccit_t pair_ccit = boost::mismatch(cref_cont1, cref_cont2); - BOOST_CHECK( pair_ccit.first == cref_cont1.end() ); - BOOST_CHECK( pair_ccit.second == cref_cont2.end() ); - pair_ccit = boost::mismatch(cref_cont1, cref_cont2, std::equal_to()); - BOOST_CHECK( pair_ccit.first == cref_cont1.end() ); - BOOST_CHECK( pair_ccit.second == cref_cont2.end() ); + eval_mismatch(cont1, cont2, cont1.end(), cont2.end()); + eval_mismatch(cont1, cont2, std::equal_to(), cont1.end(), cont2.end()); + eval_mismatch(cref_cont1, cont2, cref_cont1.end(), cont2.end()); + eval_mismatch(cref_cont1, cont2, std::equal_to(), cref_cont1.end(), cont2.end()); + eval_mismatch(cont1, cref_cont2, cont1.end(), cref_cont2.end()); + eval_mismatch(cont1, cref_cont2, std::equal_to(), cont1.end(), cref_cont2.end()); + eval_mismatch(cref_cont1, cref_cont2, cref_cont1.end(), cref_cont2.end()); + eval_mismatch(cref_cont1, cref_cont2, std::equal_to(), cref_cont1.end(), cref_cont2.end()); cont1 += 1,2,3,4; cont2 += 1,2,3,4; - pair_mmit = boost::mismatch(cont1, cont2); - BOOST_CHECK( pair_mmit.first == cont1.end() ); - BOOST_CHECK( pair_mmit.second == cont2.end() ); - pair_mmit = boost::mismatch(cont1, cont2, std::equal_to()); - BOOST_CHECK( pair_mmit.first == cont1.end() ); - BOOST_CHECK( pair_mmit.second == cont2.end() ); - - pair_cmit = boost::mismatch(cref_cont1, cont2); - BOOST_CHECK( pair_cmit.first == cref_cont1.end() ); - BOOST_CHECK( pair_cmit.second == cont2.end() ); - pair_cmit = boost::mismatch(cref_cont1, cont2, std::equal_to()); - BOOST_CHECK( pair_cmit.first == cref_cont1.end() ); - BOOST_CHECK( pair_cmit.second == cont2.end() ); - - pair_mcit = boost::mismatch(cont1, cref_cont2); - BOOST_CHECK( pair_mcit.first == cont1.end() ); - BOOST_CHECK( pair_mcit.second == cref_cont2.end() ); - pair_mcit = boost::mismatch(cont1, cref_cont2, std::equal_to()); - BOOST_CHECK( pair_mcit.first == cont1.end() ); - BOOST_CHECK( pair_mcit.second == cref_cont2.end() ); - - pair_ccit = boost::mismatch(cref_cont1, cref_cont2); - BOOST_CHECK( pair_ccit.first == cref_cont1.end() ); - BOOST_CHECK( pair_ccit.second == cref_cont2.end() ); - pair_ccit = boost::mismatch(cref_cont1, cref_cont2, std::equal_to()); - BOOST_CHECK( pair_ccit.first == cref_cont1.end() ); - BOOST_CHECK( pair_ccit.second == cref_cont2.end() ); + eval_mismatch(cont1, cont2, cont1.end(), cont2.end()); + eval_mismatch(cont1, cont2, std::equal_to(), cont1.end(), cont2.end()); + eval_mismatch(cref_cont1, cont2, cref_cont1.end(), cont2.end()); + eval_mismatch(cref_cont1, cont2, std::equal_to(), cref_cont1.end(), cont2.end()); + eval_mismatch(cont1, cref_cont2, cont1.end(), cref_cont2.end()); + eval_mismatch(cont1, cref_cont2, std::equal_to(), cont1.end(), cref_cont2.end()); + eval_mismatch(cref_cont1, cref_cont2, cref_cont1.end(), cref_cont2.end()); + eval_mismatch(cref_cont1, cref_cont2, std::equal_to(), cref_cont1.end(), cref_cont2.end()); cont1.clear(); cont2.clear(); cont1 += 1,2,3,4; cont2 += 1,2,5,4; - pair_mmit = boost::mismatch(cont1, cont2); - BOOST_CHECK( pair_mmit.first != cont1.end() && *pair_mmit.first == 3 ); - BOOST_CHECK( pair_mmit.second != cont2.end() && *pair_mmit.second == 5 ); - pair_mmit = boost::mismatch(cont1, cont2, std::equal_to()); - BOOST_CHECK( pair_mmit.first != cont1.end() && *pair_mmit.first == 3 ); - BOOST_CHECK( pair_mmit.second != cont2.end() && *pair_mmit.second == 5 ); - pair_mmit = boost::mismatch(cont1, cont2, std::not_equal_to()); - BOOST_CHECK( pair_mmit.first == cont1.begin() ); - BOOST_CHECK( pair_mmit.second == cont2.begin() ); - - pair_cmit = boost::mismatch(cref_cont1, cont2); - BOOST_CHECK( pair_cmit.first != cref_cont1.end() && *pair_cmit.first == 3 ); - BOOST_CHECK( pair_cmit.second != cont2.end() && *pair_cmit.second == 5 ); - pair_cmit = boost::mismatch(cref_cont1, cont2, std::equal_to()); - BOOST_CHECK( pair_cmit.first != cref_cont1.end() && *pair_cmit.first == 3 ); - BOOST_CHECK( pair_cmit.second != cont2.end() && *pair_cmit.second == 5 ); - pair_cmit = boost::mismatch(cref_cont1, cont2, std::not_equal_to()); - BOOST_CHECK( pair_cmit.first == cref_cont1.begin() ); - BOOST_CHECK( pair_cmit.second == cont2.begin() ); - - pair_mcit = boost::mismatch(cont1, cref_cont2); - BOOST_CHECK( pair_mcit.first != cont1.end() && *pair_mcit.first == 3 ); - BOOST_CHECK( pair_mcit.second != cref_cont2.end() && *pair_mcit.second == 5 ); - pair_mcit = boost::mismatch(cont1, cref_cont2, std::equal_to()); - BOOST_CHECK( pair_mcit.first != cont1.end() && *pair_mcit.first == 3 ); - BOOST_CHECK( pair_mcit.second != cref_cont2.end() && *pair_mcit.second == 5 ); - pair_mcit = boost::mismatch(cont1, cref_cont2, std::not_equal_to()); - BOOST_CHECK( pair_mcit.first == cont1.begin() ); - BOOST_CHECK( pair_mcit.second == cref_cont2.begin() ); - - pair_ccit = boost::mismatch(cref_cont1, cref_cont2); - BOOST_CHECK( pair_ccit.first != cref_cont1.end() && *pair_ccit.first == 3 ); - BOOST_CHECK( pair_ccit.second != cref_cont2.end() && *pair_ccit.second == 5 ); - pair_ccit = boost::mismatch(cref_cont1, cref_cont2, std::equal_to()); - BOOST_CHECK( pair_ccit.first != cref_cont1.end() && *pair_ccit.first == 3 ); - BOOST_CHECK( pair_ccit.second != cref_cont2.end() && *pair_ccit.second == 5 ); - pair_ccit = boost::mismatch(cref_cont1, cref_cont2, std::not_equal_to()); - BOOST_CHECK( pair_ccit.first == cref_cont1.begin() ); - BOOST_CHECK( pair_ccit.second == cref_cont2.begin() ); + eval_mismatch(cont1, cont2, 3, 5); + eval_mismatch(cont1, cont2, std::equal_to(), 3, 5); + eval_mismatch(cont1, cont2, std::not_equal_to(), cont1.begin(), cont2.begin()); + eval_mismatch(cref_cont1, cont2, 3, 5); + eval_mismatch(cref_cont1, cont2, std::equal_to(), 3, 5); + eval_mismatch(cref_cont1, cont2, std::not_equal_to(), cref_cont1.begin(), cont2.begin()); + eval_mismatch(cont1, cref_cont2, 3, 5); + eval_mismatch(cont1, cref_cont2, std::equal_to(), 3, 5); + eval_mismatch(cont1, cref_cont2, std::not_equal_to(), cont1.begin(), cref_cont2.begin()); + eval_mismatch(cref_cont1, cref_cont2, 3, 5); + eval_mismatch(cref_cont1, cref_cont2, std::equal_to(), 3, 5); + eval_mismatch(cref_cont1, cref_cont2, std::not_equal_to(), cref_cont1.begin(), cref_cont2.begin()); } void test_mismatch() diff --git a/test/algorithm_test/next_permutation.cpp b/test/algorithm_test/next_permutation.cpp index c2d782b..ee1c371 100644 --- a/test/algorithm_test/next_permutation.cpp +++ b/test/algorithm_test/next_permutation.cpp @@ -29,11 +29,19 @@ namespace boost const bool reference_ret = std::next_permutation(reference.begin(), reference.end()); - const bool test_ret - = boost::next_permutation(test); + const bool test_ret = boost::next_permutation(test); BOOST_CHECK( reference_ret == test_ret ); + BOOST_CHECK_EQUAL_COLLECTIONS( + reference.begin(), reference.end(), + test.begin(), test.end() + ); + + test = cont; + + BOOST_CHECK( test_ret == boost::next_permutation(boost::make_iterator_range(test)) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), test.begin(), test.end() @@ -56,6 +64,15 @@ namespace boost BOOST_CHECK( reference_ret == test_ret ); + BOOST_CHECK_EQUAL_COLLECTIONS( + reference.begin(), reference.end(), + test.begin(), test.end() + ); + + test = cont; + + BOOST_CHECK( test_ret == boost::next_permutation(boost::make_iterator_range(test), pred) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), test.begin(), test.end() diff --git a/test/algorithm_test/nth_element.cpp b/test/algorithm_test/nth_element.cpp index dac2a2f..df241e9 100644 --- a/test/algorithm_test/nth_element.cpp +++ b/test/algorithm_test/nth_element.cpp @@ -29,7 +29,21 @@ namespace boost template void test_nth_element(Container& cont, Iterator mid) { + const Container old_cont(cont); + boost::nth_element(cont, mid); + + // Test the same operation on the container, for the + // case where a temporary is passed as the first + // argument. + Container cont2(old_cont); + const std::size_t index = std::distance(cont.begin(), mid); + Iterator mid2(cont2.begin()); + std::advance(mid2, index); + boost::nth_element(boost::make_iterator_range(cont2), mid2); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); } template @@ -45,7 +59,19 @@ namespace boost template void test_nth_element(Container& cont, Iterator mid) { + const Container old_cont(cont); + boost::nth_element(cont, mid, BinaryPredicate()); + + Container cont2(old_cont); + const std::size_t index = std::distance(cont.begin(), mid); + Iterator mid2(cont2.begin()); + std::advance(mid2, index); + boost::nth_element(boost::make_iterator_range(cont2), mid2, + BinaryPredicate()); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); } template diff --git a/test/algorithm_test/partial_sort.cpp b/test/algorithm_test/partial_sort.cpp index 62ff64b..c13f7f1 100644 --- a/test/algorithm_test/partial_sort.cpp +++ b/test/algorithm_test/partial_sort.cpp @@ -31,7 +31,18 @@ namespace boost template void test_partial_sort(Container& cont, Iterator mid) { + const Container old_cont(cont); + boost::partial_sort(cont, mid); + + const std::size_t index = std::distance(cont.begin(), mid); + Container cont2(old_cont); + Iterator mid2(cont2.begin()); + std::advance(mid2, index); + boost::partial_sort(cont2, mid2); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); } template @@ -47,7 +58,18 @@ namespace boost template void test_partial_sort(Container& cont, Iterator mid) { + const Container old_cont(cont); + boost::partial_sort(cont, mid, BinaryPredicate()); + + const std::size_t index = std::distance(cont.begin(), mid); + Container cont2(old_cont); + Iterator mid2(cont2.begin()); + std::advance(mid2, index); + boost::partial_sort(cont2, mid2, BinaryPredicate()); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); } template diff --git a/test/algorithm_test/partition.cpp b/test/algorithm_test/partition.cpp index 3f0ce61..0160dae 100644 --- a/test/algorithm_test/partition.cpp +++ b/test/algorithm_test/partition.cpp @@ -41,7 +41,21 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::partition(cont, UnaryPredicate()); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + + const Container old_cont(cont); + Container cont2(old_cont); + iter_t result = boost::partition(cont, UnaryPredicate()); + + boost::partition(cont2, UnaryPredicate()); + cont2 = old_cont; + boost::partition( + boost::make_iterator_range(cont2), UnaryPredicate()); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); + + return result; } UnaryPredicate pred() const { return UnaryPredicate(); } @@ -53,7 +67,21 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::partition(cont, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + + const Container old_cont(cont); + Container cont2(old_cont); + result_t result = boost::partition(cont, policy.pred()); + + // Test that operation a temporary created by using + // make_iterator_range. + boost::partition( + boost::make_iterator_range(cont2), policy.pred()); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); + + return result; } }; diff --git a/test/algorithm_test/prev_permutation.cpp b/test/algorithm_test/prev_permutation.cpp index e1073c9..a4adc7b 100644 --- a/test/algorithm_test/prev_permutation.cpp +++ b/test/algorithm_test/prev_permutation.cpp @@ -25,12 +25,12 @@ namespace boost { Container reference(cont); Container test(cont); + Container test2(cont); const bool reference_ret = std::prev_permutation(reference.begin(), reference.end()); - const bool test_ret - = boost::prev_permutation(test); + const bool test_ret = boost::prev_permutation(test); BOOST_CHECK( reference_ret == test_ret ); @@ -38,6 +38,14 @@ namespace boost reference.begin(), reference.end(), test.begin(), test.end() ); + + BOOST_CHECK( test_ret == boost::prev_permutation( + boost::make_iterator_range(test2)) ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference.begin(), reference.end(), + test2.begin(), test2.end() + ); } template @@ -46,13 +54,13 @@ namespace boost { Container reference(cont); Container test(cont); + Container test2(cont); const bool reference_ret = std::prev_permutation(reference.begin(), reference.end(), pred); - const bool test_ret - = boost::prev_permutation(test, pred); + const bool test_ret = boost::prev_permutation(test, pred); BOOST_CHECK( reference_ret == test_ret ); @@ -60,6 +68,14 @@ namespace boost reference.begin(), reference.end(), test.begin(), test.end() ); + + BOOST_CHECK( test_ret == boost::prev_permutation( + boost::make_iterator_range(test2), pred) ); + + BOOST_CHECK_EQUAL_COLLECTIONS( + reference.begin(), reference.end(), + test2.begin(), test2.end() + ); } template diff --git a/test/algorithm_test/random_shuffle.cpp b/test/algorithm_test/random_shuffle.cpp index ba55f51..410749a 100644 --- a/test/algorithm_test/random_shuffle.cpp +++ b/test/algorithm_test/random_shuffle.cpp @@ -110,6 +110,14 @@ namespace boost { shuffled = true; } + + // Verify that the shuffle can be performed on a + // temporary range + Container test2(cont); + boost::random_shuffle(boost::make_iterator_range(test2)); + ok = test_shuffle_result(cont, test2); + if (!ok) + break; } } @@ -124,6 +132,17 @@ namespace boost { BOOST_CHECK( gen.invocation_count() > 0 ); } + + // Test that random shuffle works when + // passed a temporary range + RandomGenerator gen2; + Container cont2(old_cont); + boost::random_shuffle(boost::make_iterator_range(cont2), gen2); + test_shuffle_result(cont2, old_cont); + if (cont2.size() > 2) + { + BOOST_CHECK( gen2.invocation_count() > 0 ); + } } template diff --git a/test/algorithm_test/remove.cpp b/test/algorithm_test/remove.cpp index 46e6591..3e4ab16 100644 --- a/test/algorithm_test/remove.cpp +++ b/test/algorithm_test/remove.cpp @@ -43,7 +43,16 @@ namespace boost std::distance(reference.begin(), reference_it) ); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), - test.begin(), test.end() ); + test.begin(), test.end() ); + + Container test2(c); + iterator_t test_it2 = boost::remove(test2, to_remove); + + BOOST_CHECK_EQUAL( std::distance(test2.begin(), test_it2), + std::distance(reference.begin(), reference_it) ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); } template< class Container > diff --git a/test/algorithm_test/remove_copy.cpp b/test/algorithm_test/remove_copy.cpp new file mode 100644 index 0000000..4050ef4 --- /dev/null +++ b/test/algorithm_test/remove_copy.cpp @@ -0,0 +1,107 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template + void test_append(Iterator target, Value value) + { + *target++ = value; + } + + template< class Container, class Value > + void test_remove_copy_impl( const Container& c, Value to_remove ) + { + typedef typename boost::range_value::type value_type; + std::vector reference; + + typedef BOOST_DEDUCED_TYPENAME std::vector::iterator iterator_t; + + test_append( + std::remove_copy(c.begin(), c.end(), + std::back_inserter(reference), to_remove), + to_remove); + + std::vector test; + test_append( + boost::remove_copy(c, std::back_inserter(test), to_remove), + to_remove); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + std::vector test2; + test_append( + boost::remove_copy(boost::make_iterator_range(c), + std::back_inserter(test2), to_remove), + to_remove); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); + } + + template< class Container > + void test_remove_copy_impl() + { + using namespace boost::assign; + + Container cont; + test_remove_copy_impl(cont, 0); + + cont.clear(); + cont += 1; + test_remove_copy_impl(cont, 0); + test_remove_copy_impl(cont, 1); + + cont.clear(); + cont += 1,1,1,1,1; + test_remove_copy_impl(cont, 0); + test_remove_copy_impl(cont, 1); + + cont.clear(); + cont += 1,2,3,4,5,6,7,8,9; + test_remove_copy_impl(cont, 1); + test_remove_copy_impl(cont, 9); + test_remove_copy_impl(cont, 4); + } + + void test_remove_copy() + { + test_remove_copy_impl< std::vector >(); + test_remove_copy_impl< std::list >(); + test_remove_copy_impl< std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.remove_copy" ); + + test->add( BOOST_TEST_CASE( &test_remove_copy ) ); + + return test; +} + diff --git a/test/algorithm_test/remove_copy_if.cpp b/test/algorithm_test/remove_copy_if.cpp new file mode 100644 index 0000000..c269c2a --- /dev/null +++ b/test/algorithm_test/remove_copy_if.cpp @@ -0,0 +1,113 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template< class Iterator, class Value > + void test_append(Iterator target, Value value) + { + *target++ = value; + } + + template< class Container, class UnaryPredicate > + void test_remove_copy_if_impl( const Container& c, UnaryPredicate pred ) + { + typedef BOOST_DEDUCED_TYPENAME boost::range_value::type value_type; + std::vector reference; + + test_append( + std::remove_copy_if(c.begin(), c.end(), std::back_inserter(reference), pred), + value_type() + ); + + std::vector test; + test_append( + boost::remove_copy_if(c, std::back_inserter(test), pred), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + std::vector test2; + test_append( + boost::remove_copy_if(boost::make_iterator_range(c), + std::back_inserter(test2), pred), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); + } + + template< class Container > + void test_remove_copy_if_( const Container& c, int to_remove ) + { + test_remove_copy_if_impl(c, boost::bind(std::equal_to(), _1, to_remove)); + test_remove_copy_if_impl(c, boost::bind(std::not_equal_to(), _1, to_remove)); + } + + template< class Container > + void test_remove_copy_if_impl() + { + using namespace boost::assign; + + Container cont; + test_remove_copy_if_(cont, 0); + + cont.clear(); + cont += 1; + test_remove_copy_if_(cont, 0); + test_remove_copy_if_(cont, 1); + + cont.clear(); + cont += 1,1,1,1,1; + test_remove_copy_if_(cont, 0); + test_remove_copy_if_(cont, 1); + + cont.clear(); + cont += 1,2,3,4,5,6,7,8,9; + test_remove_copy_if_(cont, 1); + test_remove_copy_if_(cont, 9); + test_remove_copy_if_(cont, 4); + } + + inline void test_remove_copy_if() + { + test_remove_copy_if_impl< std::vector >(); + test_remove_copy_if_impl< std::list >(); + test_remove_copy_if_impl< std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.remove_copy_if" ); + + test->add( BOOST_TEST_CASE( &test_remove_copy_if ) ); + + return test; +} diff --git a/test/algorithm_test/remove_if.cpp b/test/algorithm_test/remove_if.cpp index 1e77e7b..58fc07f 100644 --- a/test/algorithm_test/remove_if.cpp +++ b/test/algorithm_test/remove_if.cpp @@ -43,7 +43,17 @@ namespace boost std::distance(reference.begin(), reference_it) ); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), - test.begin(), test.end() ); + test.begin(), test.end() ); + + Container test2(c); + iterator_t test_it2 = boost::remove_if( + boost::make_iterator_range(test2), pred); + + BOOST_CHECK_EQUAL( std::distance(test2.begin(), test_it2), + std::distance(reference.begin(), reference_it) ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); } template< class Container > diff --git a/test/algorithm_test/replace.cpp b/test/algorithm_test/replace.cpp index 4a882dc..356024f 100644 --- a/test/algorithm_test/replace.cpp +++ b/test/algorithm_test/replace.cpp @@ -36,7 +36,14 @@ namespace boost boost::replace(target, what, with_what); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), - target.begin(), target.end() ); + target.begin(), target.end() ); + + std::vector target2(cont.begin(), cont.end()); + boost::replace(boost::make_iterator_range(target2), what, + with_what); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target2.begin(), target2.end() ); } diff --git a/test/algorithm_test/replace_copy.cpp b/test/algorithm_test/replace_copy.cpp new file mode 100644 index 0000000..6ae12e2 --- /dev/null +++ b/test/algorithm_test/replace_copy.cpp @@ -0,0 +1,110 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template + void test_append(Iterator target, Value value) + { + *target++ = value; + } + + template< class Container, class Value > + void test_replace_copy_impl( const Container& c, Value to_replace ) + { + const Value replace_with = to_replace * 2; + + typedef typename boost::range_value::type value_type; + std::vector reference; + + typedef BOOST_DEDUCED_TYPENAME std::vector::iterator iterator_t; + + test_append( + std::replace_copy(c.begin(), c.end(), + std::back_inserter(reference), to_replace, replace_with), + to_replace); + + std::vector test; + test_append( + boost::replace_copy(c, std::back_inserter(test), to_replace, replace_with), + to_replace); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + std::vector test2; + test_append( + boost::replace_copy(boost::make_iterator_range(c), + std::back_inserter(test2), to_replace, + replace_with), + to_replace); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); + } + + template< class Container > + void test_replace_copy_impl() + { + using namespace boost::assign; + + Container cont; + test_replace_copy_impl(cont, 0); + + cont.clear(); + cont += 1; + test_replace_copy_impl(cont, 0); + test_replace_copy_impl(cont, 1); + + cont.clear(); + cont += 1,1,1,1,1; + test_replace_copy_impl(cont, 0); + test_replace_copy_impl(cont, 1); + + cont.clear(); + cont += 1,2,3,4,5,6,7,8,9; + test_replace_copy_impl(cont, 1); + test_replace_copy_impl(cont, 9); + test_replace_copy_impl(cont, 4); + } + + void test_replace_copy() + { + test_replace_copy_impl< std::vector >(); + test_replace_copy_impl< std::list >(); + test_replace_copy_impl< std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.replace_copy" ); + + test->add( BOOST_TEST_CASE( &test_replace_copy ) ); + + return test; +} + diff --git a/test/algorithm_test/replace_copy_if.cpp b/test/algorithm_test/replace_copy_if.cpp new file mode 100644 index 0000000..6873547 --- /dev/null +++ b/test/algorithm_test/replace_copy_if.cpp @@ -0,0 +1,115 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template< class Iterator, class Value > + void test_append(Iterator target, Value value) + { + *target++ = value; + } + + template< class Container, class UnaryPredicate > + void test_replace_copy_if_impl( const Container& c, UnaryPredicate pred ) + { + typedef BOOST_DEDUCED_TYPENAME boost::range_value::type value_type; + const value_type replace_with = value_type(); + std::vector reference; + + test_append( + std::replace_copy_if(c.begin(), c.end(), std::back_inserter(reference), pred, replace_with), + value_type() + ); + + std::vector test; + test_append( + boost::replace_copy_if(c, std::back_inserter(test), pred, replace_with), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + std::vector test2; + test_append( + boost::replace_copy_if(boost::make_iterator_range(c), + std::back_inserter(test2), pred, + replace_with), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); + } + + template< class Container > + void test_replace_copy_if_( const Container& c, int to_replace ) + { + test_replace_copy_if_impl(c, boost::bind(std::equal_to(), _1, to_replace)); + test_replace_copy_if_impl(c, boost::bind(std::not_equal_to(), _1, to_replace)); + } + + template< class Container > + void test_replace_copy_if_impl() + { + using namespace boost::assign; + + Container cont; + test_replace_copy_if_(cont, 0); + + cont.clear(); + cont += 1; + test_replace_copy_if_(cont, 0); + test_replace_copy_if_(cont, 1); + + cont.clear(); + cont += 1,1,1,1,1; + test_replace_copy_if_(cont, 0); + test_replace_copy_if_(cont, 1); + + cont.clear(); + cont += 1,2,3,4,5,6,7,8,9; + test_replace_copy_if_(cont, 1); + test_replace_copy_if_(cont, 9); + test_replace_copy_if_(cont, 4); + } + + inline void test_replace_copy_if() + { + test_replace_copy_if_impl< std::vector >(); + test_replace_copy_if_impl< std::list >(); + test_replace_copy_if_impl< std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.replace_copy_if" ); + + test->add( BOOST_TEST_CASE( &test_replace_copy_if ) ); + + return test; +} diff --git a/test/algorithm_test/replace_if.cpp b/test/algorithm_test/replace_if.cpp index e1dd26f..12d7293 100644 --- a/test/algorithm_test/replace_if.cpp +++ b/test/algorithm_test/replace_if.cpp @@ -40,8 +40,14 @@ namespace boost boost::replace_if(target, boost::bind(pred, _1, what), with_what); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), - target.begin(), target.end() ); - + target.begin(), target.end() ); + + std::vector target2(cont.begin(), cont.end()); + boost::replace_if(boost::make_iterator_range(target2), + boost::bind(pred, _1, what), with_what); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target2.begin(), target2.end() ); } template< class Container > diff --git a/test/algorithm_test/reverse.cpp b/test/algorithm_test/reverse.cpp index 611a464..3ad63cb 100644 --- a/test/algorithm_test/reverse.cpp +++ b/test/algorithm_test/reverse.cpp @@ -29,14 +29,16 @@ namespace boost { Container reference(cont); Container test(cont); + Container test2(cont); boost::reverse(test); std::reverse(reference.begin(), reference.end()); - - BOOST_CHECK_EQUAL_COLLECTIONS( - reference.begin(), reference.end(), - test.begin(), test.end() - ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + boost::reverse(boost::make_iterator_range(test2)); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); } template diff --git a/test/algorithm_test/reverse_copy.cpp b/test/algorithm_test/reverse_copy.cpp new file mode 100644 index 0000000..92ef485 --- /dev/null +++ b/test/algorithm_test/reverse_copy.cpp @@ -0,0 +1,97 @@ +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template + void test_append(OutputIterator out, Value value) + { + *out++ = value; + } + + template + void test_reverse_copy_impl(Container& cont) + { + typedef BOOST_DEDUCED_TYPENAME boost::range_value::type value_type; + std::vector reference; + std::vector test; + + test_append( + std::reverse_copy(cont.begin(), cont.end(), std::back_inserter(reference)), + value_type() + ); + + test_append( + boost::reverse_copy(cont, std::back_inserter(test)), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + test.clear(); + + test_append( + boost::reverse_copy(boost::make_iterator_range(cont), + std::back_inserter(test)), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + } + + template + void test_reverse_copy_impl() + { + using namespace boost::assign; + + Container cont; + test_reverse_copy_impl(cont); + + cont.clear(); + cont += 1; + test_reverse_copy_impl(cont); + + cont.clear(); + cont += 1,2,3,4,5,6,7,8,9; + test_reverse_copy_impl(cont); + } + + void test_reverse_copy() + { + test_reverse_copy_impl< std::vector >(); + test_reverse_copy_impl< std::list >(); + test_reverse_copy_impl< std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.reverse_copy" ); + + test->add( BOOST_TEST_CASE( &::test_reverse_copy ) ); + + return test; +} diff --git a/test/algorithm_test/rotate.cpp b/test/algorithm_test/rotate.cpp index f8b394a..b6b7af2 100644 --- a/test/algorithm_test/rotate.cpp +++ b/test/algorithm_test/rotate.cpp @@ -42,10 +42,18 @@ namespace boost boost::rotate(test, test_where_it); - BOOST_CHECK_EQUAL_COLLECTIONS( - reference.begin(), reference.end(), - test.begin(), test.end() - ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + test = cont; + test_where_it = test.begin(); + std::advance(test_where_it, + std::distance(cont.begin(), where_it)); + + boost::rotate(boost::make_iterator_range(test), test_where_it); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); } template diff --git a/test/algorithm_test/rotate_copy.cpp b/test/algorithm_test/rotate_copy.cpp new file mode 100644 index 0000000..5615479 --- /dev/null +++ b/test/algorithm_test/rotate_copy.cpp @@ -0,0 +1,112 @@ +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template + void test_append(OutputIterator target, Value value) + { + *target++ = value; + } + + template + void test_rotate_copy_impl(Container& cont, Iterator where_it) + { + typedef BOOST_DEDUCED_TYPENAME boost::range_value::type value_type; + std::vector reference; + std::vector test; + + typedef BOOST_DEDUCED_TYPENAME boost::range_iterator::type iterator_t; + + test_append( + std::rotate_copy(cont.begin(), where_it, cont.end(), + std::back_inserter(reference)), + value_type() + ); + + test_append( + boost::rotate_copy(cont, where_it, std::back_inserter(test)), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + test.clear(); + + test_append( + boost::rotate_copy(boost::make_iterator_range(cont), where_it, + std::back_inserter(test)), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + } + + template + void test_rotate_copy_impl(Container& cont) + { + typedef BOOST_DEDUCED_TYPENAME boost::range_iterator::type iterator_t; + + iterator_t last = cont.end(); + for (iterator_t it = cont.begin(); it != last; ++it) + { + test_rotate_copy_impl(cont, it); + } + } + + template + void test_rotate_copy_impl() + { + using namespace boost::assign; + + Container cont; + test_rotate_copy_impl(cont); + + cont.clear(); + cont += 1; + test_rotate_copy_impl(cont); + + cont.clear(); + cont += 1,2,3,4,5,6,7,8,9; + test_rotate_copy_impl(cont); + } + + void test_rotate_copy() + { + test_rotate_copy_impl< std::vector >(); + test_rotate_copy_impl< std::list >(); + test_rotate_copy_impl< std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.rotate_copy" ); + + test->add( BOOST_TEST_CASE( &test_rotate_copy ) ); + + return test; +} diff --git a/test/algorithm_test/search.cpp b/test/algorithm_test/search.cpp index 460f70d..91f19bd 100644 --- a/test/algorithm_test/search.cpp +++ b/test/algorithm_test/search.cpp @@ -33,9 +33,25 @@ namespace boost const Container2& ccont2 = cont2; iterator1_t it = boost::search(cont1, cont2); + BOOST_CHECK( it == boost::search(boost::make_iterator_range(cont1), cont2) ); + BOOST_CHECK( it == boost::search(cont1, boost::make_iterator_range(cont2)) ); + BOOST_CHECK( it == boost::search(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2)) ); iterator1_t it2 = boost::search(cont1, ccont2); + BOOST_CHECK( it2 == boost::search(boost::make_iterator_range(cont1), ccont2) ); + BOOST_CHECK( it2 == boost::search(cont1, boost::make_iterator_range(ccont2)) ); + BOOST_CHECK( it2 == boost::search(boost::make_iterator_range(cont1), + boost::make_iterator_range(ccont2)) ); const_iterator1_t cit = boost::search(ccont1, cont2); + BOOST_CHECK( cit == boost::search(boost::make_iterator_range(ccont1), cont2) ); + BOOST_CHECK( cit == boost::search(ccont1, boost::make_iterator_range(cont2)) ); + BOOST_CHECK( cit == boost::search(boost::make_iterator_range(ccont1), + boost::make_iterator_range(cont2)) ); const_iterator1_t cit2 = boost::search(ccont1, ccont2); + BOOST_CHECK( cit2 == boost::search(boost::make_iterator_range(ccont1), ccont2) ); + BOOST_CHECK( cit2 == boost::search(ccont1, boost::make_iterator_range(ccont2)) ); + BOOST_CHECK( cit2 == boost::search(boost::make_iterator_range(ccont1), + boost::make_iterator_range(ccont2)) ); BOOST_CHECK( it == std::search(cont1.begin(), cont1.end(), cont2.begin(), cont2.end()) ); BOOST_CHECK( it2 == std::search(cont1.begin(), cont1.end(), ccont2.begin(), ccont2.end()) ); diff --git a/test/algorithm_test/search_n.cpp b/test/algorithm_test/search_n.cpp new file mode 100644 index 0000000..3b0aa91 --- /dev/null +++ b/test/algorithm_test/search_n.cpp @@ -0,0 +1,93 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +{ + template< class Container1, class Value > + void test_search_n_impl(Container1& cont1, Value value) + { + typedef BOOST_DEDUCED_TYPENAME Container1::const_iterator const_iterator1_t; + typedef BOOST_DEDUCED_TYPENAME Container1::iterator iterator1_t; + + const Container1& ccont1 = cont1; + + for (std::size_t n = 0; n < cont1.size(); ++n) + { + iterator1_t it = boost::search_n(cont1, n, value); + BOOST_CHECK( it == boost::search_n(boost::make_iterator_range(cont1), n, value) ); + BOOST_CHECK( it == std::search_n(cont1.begin(), cont1.end(), n, value) ); + + const_iterator1_t cit = boost::search_n(ccont1, n, value); + BOOST_CHECK( cit == boost::search_n(boost::make_iterator_range(ccont1), n, value) ); + BOOST_CHECK( cit == std::search_n(ccont1.begin(), ccont1.end(), n, value) ); + } + } + + template< class Container1, class Container2 > + void test_search_n_impl() + { + using namespace boost::assign; + + Container1 cont1; + + test_search_n_impl(cont1, 1); + + cont1 += 1; + test_search_n_impl(cont1, 1); + test_search_n_impl(cont1, 0); + + cont1.clear(); + cont1 += 1,1; + test_search_n_impl(cont1, 1); + test_search_n_impl(cont1, 0); + + cont1 += 1,1,1; + test_search_n_impl(cont1, 1); + test_search_n_impl(cont1, 0); + + cont1.clear(); + cont1 += 1,2,3,4,5,6,7,8,9; + test_search_n_impl(cont1, 1); + test_search_n_impl(cont1, 2); + test_search_n_impl(cont1, 5); + test_search_n_impl(cont1, 9); + } + + void test_search_n() + { + test_search_n_impl< std::list, std::list >(); + test_search_n_impl< std::vector, std::vector >(); + test_search_n_impl< std::set, std::set >(); + test_search_n_impl< std::list, std::vector >(); + test_search_n_impl< std::vector, std::list >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.search_n" ); + + test->add( BOOST_TEST_CASE( &test_search_n ) ); + + return test; +} diff --git a/test/algorithm_test/set_difference.cpp b/test/algorithm_test/set_difference.cpp index 7fb0974..84dc62c 100644 --- a/test/algorithm_test/set_difference.cpp +++ b/test/algorithm_test/set_difference.cpp @@ -62,6 +62,28 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_difference( + boost::make_iterator_range(cont1), cont2, + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_difference( + cont1, boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_difference( + boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); } template @@ -100,6 +122,28 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_difference( + boost::make_iterator_range(cont1), cont2, + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_difference( + cont1, boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_difference( + boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); } template diff --git a/test/algorithm_test/set_intersection.cpp b/test/algorithm_test/set_intersection.cpp index 5e2ce1b..213bbdf 100644 --- a/test/algorithm_test/set_intersection.cpp +++ b/test/algorithm_test/set_intersection.cpp @@ -62,6 +62,28 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_intersection( + boost::make_iterator_range(cont1), cont2, + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_intersection( + cont1, boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_intersection( + boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); } template @@ -100,6 +122,28 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_intersection( + boost::make_iterator_range(cont1), cont2, + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_intersection( + cont1, boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_intersection( + boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); } template diff --git a/test/algorithm_test/set_symmetric_difference.cpp b/test/algorithm_test/set_symmetric_difference.cpp index 149532c..b792fd8 100644 --- a/test/algorithm_test/set_symmetric_difference.cpp +++ b/test/algorithm_test/set_symmetric_difference.cpp @@ -63,6 +63,28 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_symmetric_difference( + boost::make_iterator_range(cont1), cont2, + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_symmetric_difference( + cont1, boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_symmetric_difference( + boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); } template @@ -102,6 +124,28 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_symmetric_difference( + boost::make_iterator_range(cont1), cont2, + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_symmetric_difference( + cont1, boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_symmetric_difference( + boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); } template diff --git a/test/algorithm_test/set_union.cpp b/test/algorithm_test/set_union.cpp index f9450b3..7f9f10a 100644 --- a/test/algorithm_test/set_union.cpp +++ b/test/algorithm_test/set_union.cpp @@ -62,6 +62,26 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_union(boost::make_iterator_range(cont1), + cont2, test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_union(cont1, + boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_union(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin()); + + check_result(reference, reference_result, + test_cont, test_result); } template @@ -100,6 +120,26 @@ namespace boost check_result(reference, reference_result, test_cont, test_result); + + test_result = boost::set_union(boost::make_iterator_range(cont1), + cont2, test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_union(cont1, + boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); + + test_result = boost::set_union(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + test_cont.begin(), pred); + + check_result(reference, reference_result, + test_cont, test_result); } template diff --git a/test/algorithm_test/sort.cpp b/test/algorithm_test/sort.cpp index b1b26e7..c6611f7 100644 --- a/test/algorithm_test/sort.cpp +++ b/test/algorithm_test/sort.cpp @@ -33,10 +33,13 @@ namespace boost boost::sort(test); std::sort(reference.begin(), reference.end()); - BOOST_CHECK_EQUAL_COLLECTIONS( - reference.begin(), reference.end(), - test.begin(), test.end() - ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + Container test2(cont); + boost::sort(boost::make_iterator_range(test2)); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); } template @@ -52,6 +55,11 @@ namespace boost reference.begin(), reference.end(), test.begin(), test.end() ); + + Container test2(cont); + boost::sort(boost::make_iterator_range(test2), pred); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test2.begin(), test2.end() ); } template diff --git a/test/algorithm_test/stable_partition.cpp b/test/algorithm_test/stable_partition.cpp index fad4bef..5f55b7d 100644 --- a/test/algorithm_test/stable_partition.cpp +++ b/test/algorithm_test/stable_partition.cpp @@ -41,7 +41,21 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::stable_partition(cont, UnaryPredicate()); + Container cont2(cont); + + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::stable_partition(cont, UnaryPredicate()); + + iter_t temp_result = boost::stable_partition( + boost::make_iterator_range(cont2), UnaryPredicate()); + + BOOST_CHECK_EQUAL( std::distance(cont.begin(), result), + std::distance(cont2.begin(), temp_result) ); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); + + return result; } UnaryPredicate pred() const { return UnaryPredicate(); } @@ -53,7 +67,17 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::stable_partition(cont, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + Container cont2(cont); + result_t result = boost::stable_partition(cont, policy.pred()); + + result_t result2 = boost::stable_partition( + boost::make_iterator_range(cont2), policy.pred()); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont2.begin(), cont2.end(), + cont.begin(), cont.end() ); + + return result; } }; diff --git a/test/algorithm_test/stable_sort.cpp b/test/algorithm_test/stable_sort.cpp index eb5518c..8372bd6 100644 --- a/test/algorithm_test/stable_sort.cpp +++ b/test/algorithm_test/stable_sort.cpp @@ -33,10 +33,13 @@ namespace boost boost::stable_sort(test); std::stable_sort(reference.begin(), reference.end()); - BOOST_CHECK_EQUAL_COLLECTIONS( - reference.begin(), reference.end(), - test.begin(), test.end() - ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + test = cont; + boost::stable_sort(boost::make_iterator_range(test)); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); } template @@ -48,10 +51,13 @@ namespace boost boost::stable_sort(test, pred); std::stable_sort(reference.begin(), reference.end(), pred); - BOOST_CHECK_EQUAL_COLLECTIONS( - reference.begin(), reference.end(), - test.begin(), test.end() - ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); + + test = cont; + boost::stable_sort(boost::make_iterator_range(test), pred); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + test.begin(), test.end() ); } template diff --git a/test/algorithm_test/swap_ranges.cpp b/test/algorithm_test/swap_ranges.cpp new file mode 100644 index 0000000..a96bfac --- /dev/null +++ b/test/algorithm_test/swap_ranges.cpp @@ -0,0 +1,116 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template + void test_swap_ranges_impl(const Container1& source1, const Container2& source2) + { + Container1 reference1(source1); + Container2 reference2(source2); + std::swap_ranges(reference1.begin(), reference1.end(), reference2.begin()); + + Container1 test1(source1); + Container2 test2(source2); + boost::swap_ranges(test1, test2); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference1.begin(), reference1.end(), + test1.begin(), test1.end() ); + + BOOST_CHECK_EQUAL_COLLECTIONS( reference2.begin(), reference2.end(), + test2.begin(), test2.end() ); + + test1 = source1; + test2 = source2; + boost::swap_ranges(boost::make_iterator_range(test1), test2); + BOOST_CHECK_EQUAL_COLLECTIONS( reference1.begin(), reference1.end(), + test1.begin(), test1.end() ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference2.begin(), reference2.end(), + test2.begin(), test2.end() ); + + test1 = source1; + test2 = source2; + boost::swap_ranges(test1, boost::make_iterator_range(test2)); + BOOST_CHECK_EQUAL_COLLECTIONS( reference1.begin(), reference1.end(), + test1.begin(), test1.end() ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference2.begin(), reference2.end(), + test2.begin(), test2.end() ); + + test1 = source1; + test2 = source2; + boost::swap_ranges(boost::make_iterator_range(test1), + boost::make_iterator_range(test2)); + BOOST_CHECK_EQUAL_COLLECTIONS( reference1.begin(), reference1.end(), + test1.begin(), test1.end() ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference2.begin(), reference2.end(), + test2.begin(), test2.end() ); + } + + template + void test_swap_ranges_impl() + { + using namespace boost::assign; + + Container1 c1; + Container2 c2; + + test_swap_ranges_impl(c1, c2); + + c1.clear(); + c1 += 1; + c2.clear(); + c2 += 2; + test_swap_ranges_impl(c1, c2); + + c1.clear(); + c1 += 1,2,3,4,5,6,7,8,9,10; + c2.clear(); + c2 += 10,9,8,7,6,5,4,3,2,1; + test_swap_ranges_impl(c1, c2); + } + + inline void test_swap_ranges() + { + test_swap_ranges_impl< std::vector, std::vector >(); + test_swap_ranges_impl< std::vector, std::list >(); + test_swap_ranges_impl< std::vector, std::deque >(); + test_swap_ranges_impl< std::list, std::vector >(); + test_swap_ranges_impl< std::list, std::list >(); + test_swap_ranges_impl< std::list, std::deque >(); + test_swap_ranges_impl< std::deque, std::vector >(); + test_swap_ranges_impl< std::deque, std::list >(); + test_swap_ranges_impl< std::deque, std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.swap_ranges" ); + + test->add( BOOST_TEST_CASE( &test_swap_ranges ) ); + + return test; +} diff --git a/test/algorithm_test/transform.cpp b/test/algorithm_test/transform.cpp index 7f016a2..3e37180 100644 --- a/test/algorithm_test/transform.cpp +++ b/test/algorithm_test/transform.cpp @@ -47,16 +47,23 @@ namespace boost BOOST_CHECK( test_it == target.end() ); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), - target.begin(), target.end() ); - + target.begin(), target.end() ); + + BOOST_CHECK( test_it == boost::transform(boost::make_iterator_range(cont), target.begin(), fn) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target.begin(), target.end() ); + target.clear(); target.resize(ccont.size()); test_it = boost::transform(ccont, target.begin(), fn); - + BOOST_CHECK( test_it == target.end() ); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), - target.begin(), target.end() ); + target.begin(), target.end() ); + BOOST_CHECK( test_it == boost::transform(boost::make_iterator_range(ccont), target.begin(), fn) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target.begin(), target.end() ); } template< class Container > @@ -97,10 +104,25 @@ namespace boost iterator_t test_it = boost::transform(cont1, cont2, target.begin(), fn); - + BOOST_CHECK( test_it == target.end() ); BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), - target.begin(), target.end() ); + target.begin(), target.end() ); + + BOOST_CHECK( test_it == boost::transform(boost::make_iterator_range(cont1), cont2, target.begin(), fn) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target.begin(), target.end() ); + + BOOST_CHECK( test_it == boost::transform(cont1, boost::make_iterator_range(cont2), target.begin(), fn) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target.begin(), target.end() ); + + BOOST_CHECK( test_it == boost::transform(boost::make_iterator_range(cont1), + boost::make_iterator_range(cont2), + target.begin(), fn) ); + BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(), + target.begin(), target.end() ); + target.clear(); target.resize(ccont1.size()); diff --git a/test/algorithm_test/unique.cpp b/test/algorithm_test/unique.cpp index 2e2ebfa..49af0e3 100644 --- a/test/algorithm_test/unique.cpp +++ b/test/algorithm_test/unique.cpp @@ -47,7 +47,18 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy&, Container& cont) { - return boost::unique(cont); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + + Container cont2(cont); + + result_t result = boost::unique(cont); + + boost::unique(boost::make_iterator_range(cont2)); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); + + return result; } }; @@ -82,7 +93,18 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::unique(cont, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + + Container cont2(cont); + + result_t result = boost::unique(cont, policy.pred()); + + boost::unique(boost::make_iterator_range(cont2), policy.pred()); + + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), + cont2.begin(), cont2.end() ); + + return result; } }; diff --git a/test/algorithm_test/unique_copy.cpp b/test/algorithm_test/unique_copy.cpp new file mode 100644 index 0000000..21f107a --- /dev/null +++ b/test/algorithm_test/unique_copy.cpp @@ -0,0 +1,158 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. 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 +#include +#include +#include + +namespace +{ + template + void test_append(OutputIterator target, Value value) + { + *target++ = value; + } + + template + void test_unique_copy_impl(Container& c) + { + typedef BOOST_DEDUCED_TYPENAME boost::range_value::type value_type; + std::vector reference; + std::vector test; + + test_append( + std::unique_copy(c.begin(), c.end(), std::back_inserter(reference)), + value_type() + ); + + test_append( + boost::unique_copy(c, std::back_inserter(test)), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS(reference.begin(), reference.end(), + test.begin(), test.end()); + + test.clear(); + + test_append( + boost::unique_copy(boost::make_iterator_range(c), + std::back_inserter(test)), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS(reference.begin(), reference.end(), + test.begin(), test.end()); + } + + template + void test_unique_copy_impl(Container& c, Pred pred) + { + typedef BOOST_DEDUCED_TYPENAME boost::range_value::type value_type; + std::vector reference; + std::vector test; + + test_append( + std::unique_copy(c.begin(), c.end(), std::back_inserter(reference), pred), + value_type() + ); + + test_append( + boost::unique_copy(c, std::back_inserter(test), pred), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS(reference.begin(), reference.end(), + test.begin(), test.end()); + + test.clear(); + + test_append( + boost::unique_copy(boost::make_iterator_range(c), + std::back_inserter(test), pred), + value_type() + ); + + BOOST_CHECK_EQUAL_COLLECTIONS(reference.begin(), reference.end(), + test.begin(), test.end()); + } + + template + void test_unique_copy_driver(Pred pred) + { + using namespace boost::assign; + + typedef BOOST_DEDUCED_TYPENAME Container::value_type value_t; + + Container cont; + + test_unique_copy_impl(cont); + test_unique_copy_impl(cont, pred); + + cont.clear(); + cont += 1; + + std::vector temp(cont.begin(), cont.end()); + std::sort(temp.begin(), temp.end()); + cont.assign(temp.begin(), temp.end()); + test_unique_copy_impl(cont); + + std::sort(temp.begin(), temp.end(), pred); + cont.assign(temp.begin(), temp.end()); + test_unique_copy_impl(cont, pred); + + cont.clear(); + cont += 1,2,2,2,2,3,4,5,6,7,8,9; + + temp.assign(cont.begin(), cont.end()); + std::sort(temp.begin(), temp.end()); + cont.assign(temp.begin(), temp.end()); + test_unique_copy_impl(cont); + + std::sort(temp.begin(), temp.end(), pred); + cont.assign(temp.begin(), temp.end()); + test_unique_copy_impl(cont, pred); + } + + template + void test_unique_copy_impl() + { + test_unique_copy_driver(std::less()); + test_unique_copy_driver(std::greater()); + } + + void test_unique_copy() + { + test_unique_copy_impl< std::vector >(); + test_unique_copy_impl< std::list >(); + test_unique_copy_impl< std::deque >(); + } +} + +boost::unit_test::test_suite* +init_unit_test_suite(int argc, char* argv[]) +{ + boost::unit_test::test_suite* test + = BOOST_TEST_SUITE( "RangeTestSuite.algorithm.unique_copy" ); + + test->add( BOOST_TEST_CASE( &test_unique_copy ) ); + + return test; +} diff --git a/test/algorithm_test/upper_bound.cpp b/test/algorithm_test/upper_bound.cpp index 2eb64cf..95e3965 100644 --- a/test/algorithm_test/upper_bound.cpp +++ b/test/algorithm_test/upper_bound.cpp @@ -32,7 +32,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::upper_bound(cont, 5); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::upper_bound(cont, 5); + BOOST_CHECK( result == boost::upper_bound(boost::make_iterator_range(cont), 5) ); + return result; } template @@ -42,7 +45,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy&, Container& cont) { - return boost::upper_bound(cont, 5); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + result_t result = boost::upper_bound(cont, 5); + BOOST_CHECK( result == boost::upper_bound(boost::make_iterator_range(cont), 5) ); + return result; } }; @@ -61,7 +67,10 @@ namespace boost BOOST_DEDUCED_TYPENAME range_iterator::type test_iter(Container& cont) { - return boost::upper_bound(cont, 5, BinaryPredicate()); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; + iter_t result = boost::upper_bound(cont, 5, BinaryPredicate()); + BOOST_CHECK( result == boost::upper_bound(boost::make_iterator_range(cont), 5, BinaryPredicate()) ); + return result; } template< range_return_value result_type> @@ -71,8 +80,14 @@ namespace boost BOOST_DEDUCED_TYPENAME range_return::type operator()(Policy& policy, Container& cont) { - return boost::upper_bound( - cont, 5, policy.pred()); + typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; + + result_t result = boost::upper_bound(cont, 5, policy.pred()); + + BOOST_CHECK( result == boost::upper_bound( + boost::make_iterator_range(cont), 5, policy.pred()) ); + + return result; } }; diff --git a/test/replace_copy.cpp b/test/replace_copy.cpp new file mode 100644 index 0000000..e69de29 diff --git a/test/string.cpp b/test/string.cpp index 127f70a..f73abb0 100644 --- a/test/string.cpp +++ b/test/string.cpp @@ -17,6 +17,7 @@ # pragma warn -8057 // unused argument argc/argv in Boost.Test #endif +#include #include #include #include @@ -29,6 +30,34 @@ #include #include +namespace +{ + template< class CharT, std::size_t Length > + class test_string + { + public: + typedef CharT value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef std::size_t size_type; + typedef value_type array_t[Length]; + typedef const value_type const_array_t[Length]; + + explicit test_string(const CharT literal_sz[]) + { + std::copy(literal_sz, literal_sz + Length, m_buffer.data()); + m_buffer[Length] = value_type(); + } + + const_pointer const_sz() const { return m_buffer.data(); } + pointer mutable_sz() { return m_buffer.data(); } + + private: + typedef boost::array buffer_t; + buffer_t m_buffer; + }; +} + template< class T > inline BOOST_DEDUCED_TYPENAME boost::range_iterator::type str_begin( T& r ) @@ -105,11 +134,15 @@ void check_char() { typedef char* char_iterator_t; typedef char char_array_t[10]; - const char* char_s = "a string"; - char my_string[] = "another string"; + + test_string a_string("a string"); + test_string another_string("another string"); + + const char* char_s = a_string.const_sz(); + char my_string[] = "another_string"; const char my_const_string[] = "another string"; - const unsigned my_string_length = 14; - char* char_s2 = "a string"; + const unsigned my_string_length = 14; + char* char_s2 = a_string.mutable_sz(); BOOST_STATIC_ASSERT(( is_same< range_value::type, detail::iterator_traits::value_type>::value )); @@ -181,10 +214,14 @@ void check_string() check_char(); #ifndef BOOST_NO_STD_WSTRING - typedef wchar_t* wchar_iterator_t; - const wchar_t* char_ws = L"a wide string"; + typedef wchar_t* wchar_iterator_t; + + test_string a_wide_string(L"a wide string"); + test_string another_wide_string(L"another wide string"); + + const wchar_t* char_ws = a_wide_string.const_sz(); wchar_t my_wstring[] = L"another wide string"; - wchar_t* char_ws2 = L"a wide string"; + wchar_t* char_ws2 = a_wide_string.mutable_sz(); BOOST_STATIC_ASSERT(( is_same< range_value::type, detail::iterator_traits::value_type>::value )); @@ -203,12 +240,17 @@ void check_string() BOOST_CHECK_EQUAL( sz, std::char_traits::length( char_ws ) ); wchar_t to_search = L'n'; - BOOST_CHECK( find( char_ws, to_search ) != str_end(char_ws) ); + BOOST_CHECK( find( char_ws, to_search ) != str_end(char_ws) ); + BOOST_CHECK( find( char_ws2, to_search ) != str_end(char_ws2) ); #if BOOST_WORKAROUND(_MSC_VER, BOOST_TESTED_AT(1300)) BOOST_CHECK( find( my_wstring, to_search ) != str_end(my_wstring) ); +#else + + boost::ignore_unused_variable_warning( my_wstring ); + #endif #endif diff --git a/test/test_function/true_predicate.hpp b/test/test_function/true_predicate.hpp new file mode 100644 index 0000000..87a0dca --- /dev/null +++ b/test/test_function/true_predicate.hpp @@ -0,0 +1,29 @@ +// 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/ +// +#ifndef BOOST_RANGE_TEST_TEST_FUNCTION_TRUE_PREDICATE_HPP_INCLUDED +#define BOOST_RANGE_TEST_TEST_FUNCTION_TRUE_PREDICATE_HPP_INCLUDED + +namespace boost +{ + namespace range_test_function + { + struct true_predicate + { + typedef bool result_type; + + bool operator()() const { return true; } + template bool operator()(Arg) const { return true; } + template bool operator()(Arg1,Arg2) const { return true; } + }; + } +} + +#endif // include guard