diff --git a/doc/find_backward.qbk b/doc/find_backward.qbk index 838dbc9..aa92de9 100644 --- a/doc/find_backward.qbk +++ b/doc/find_backward.qbk @@ -28,7 +28,7 @@ the use of `std::find()`: auto rfirst = std::make_reverse_iterator(last); auto rlast = std::make_reverse_iterator(first); - auto it = std::find(rfirst, rlast); + auto it = std::find(rfirst, rlast, x); // Use it here... That seems nicer in that there is no raw loop, but it has two major drawbacks. diff --git a/doc/find_not.qbk b/doc/find_not.qbk index 6df0482..be14979 100644 --- a/doc/find_not.qbk +++ b/doc/find_not.qbk @@ -15,19 +15,19 @@ equal to the given value. Consider this use of `find()`: - auto std::vector vec = { 1, 1, 2 }; + std::vector vec = { 1, 1, 2 }; auto it = std::find(vec.begin(), vec.end(), 1); This gives us the first occurance of `1` in `vec`. What if we want to find the first occurrance of any number besides `1` in `vec`? We have to write an unfortunate amount of code: - auto std::vector vec = { 1, 1, 2 }; + std::vector vec = { 1, 1, 2 }; auto it = std::find_if(vec.begin(), vec.end(), [](int i) { return i != 1; }); With `find_not()` the code gets much more terse: - auto std::vector vec = { 1, 1, 2 }; + std::vector vec = { 1, 1, 2 }; auto it = find_not(vec.begin(), vec.end(), 1); The existing `find` variants are: `find()`, `find_if()`, and `find_if_not()`. diff --git a/doc/ordered-hpp.qbk b/doc/ordered-hpp.qbk index 9e860d4..bc8c1a4 100644 --- a/doc/ordered-hpp.qbk +++ b/doc/ordered-hpp.qbk @@ -15,7 +15,7 @@ http://www.boost.org/LICENSE_1_0.txt) The header file `` contains functions for determining if a sequence is ordered. [heading is_sorted] -The function `is_sorted(sequence)` determines whether or not a sequence is completely sorted according so some criteria. If no comparison predicate is specified, then std::less_equal is used (i.e, the test is to see if the sequence is non-decreasing) +The function `is_sorted(sequence)` determines whether or not a sequence is completely sorted according so some criteria. If no comparison predicate is specified, then `std::less` is used (i.e, the test is to see if the sequence is non-decreasing) `` namespace boost { namespace algorithm { diff --git a/include/boost/algorithm/apply_permutation.hpp b/include/boost/algorithm/apply_permutation.hpp index c844cfc..b9de0de 100644 --- a/include/boost/algorithm/apply_permutation.hpp +++ b/include/boost/algorithm/apply_permutation.hpp @@ -41,15 +41,16 @@ void apply_permutation(RandomAccessIterator1 item_begin, RandomAccessIterator1 item_end, RandomAccessIterator2 ind_begin, RandomAccessIterator2 ind_end) { - using Diff = typename std::iterator_traits::difference_type; + typedef typename std::iterator_traits::difference_type Diff; + typedef typename std::iterator_traits::difference_type Index; using std::swap; Diff size = std::distance(item_begin, item_end); for (Diff i = 0; i < size; i++) { - auto current = i; + Diff current = i; while (i != ind_begin[current]) { - auto next = ind_begin[current]; + Index next = ind_begin[current]; swap(item_begin[current], item_begin[next]); ind_begin[current] = current; current = next; @@ -75,7 +76,7 @@ apply_reverse_permutation( RandomAccessIterator2 ind_begin, RandomAccessIterator2 ind_end) { - using Diff = typename std::iterator_traits::difference_type; + typedef typename std::iterator_traits::difference_type Diff; using std::swap; Diff length = std::distance(item_begin, item_end); for (Diff i = 0; i < length; i++) diff --git a/minmax/test/Jamfile.v2 b/minmax/test/Jamfile.v2 index fcfba8a..384b359 100644 --- a/minmax/test/Jamfile.v2 +++ b/minmax/test/Jamfile.v2 @@ -15,7 +15,7 @@ alias unit_test_framework ; { - test-suite algorithm/minmax: + test-suite algorithm/minmax : [ run minmax_element_test.cpp unit_test_framework : : : : minmax_element ] [ run minmax_test.cpp unit_test_framework diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 30cb786..e7091e0 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -16,7 +16,7 @@ alias unit_test_framework { - test-suite algorithm: + test-suite algorithm # Search tests : [ run empty_search_test.cpp unit_test_framework : : : : empty_search_test ] [ run search_test1.cpp unit_test_framework : : : : search_test1 ] diff --git a/test/apply_permutation_test.cpp b/test/apply_permutation_test.cpp index e9ab970..3dbb7e1 100644 --- a/test/apply_permutation_test.cpp +++ b/test/apply_permutation_test.cpp @@ -12,7 +12,6 @@ #include -#define BOOST_TEST_DYN_LINK #define BOOST_TEST_MAIN #include