From 1da90fcc4af793b95f3617f8feafa48e11f139e4 Mon Sep 17 00:00:00 2001 From: Kolya Matteo Date: Fri, 29 Apr 2016 15:37:09 -0400 Subject: [PATCH 1/4] Remove unnecessary #include and correct some comments --- include/boost/algorithm/cxx11/all_of.hpp | 3 --- include/boost/algorithm/cxx11/any_of.hpp | 1 - include/boost/algorithm/cxx11/copy_if.hpp | 4 +--- include/boost/algorithm/cxx11/copy_n.hpp | 4 ---- include/boost/algorithm/cxx11/find_if_not.hpp | 4 ---- include/boost/algorithm/cxx11/iota.hpp | 4 ---- include/boost/algorithm/cxx11/is_partitioned.hpp | 4 ---- include/boost/algorithm/cxx11/is_permutation.hpp | 8 ++------ include/boost/algorithm/cxx11/is_sorted.hpp | 1 - include/boost/algorithm/cxx11/none_of.hpp | 1 - include/boost/algorithm/cxx11/partition_copy.hpp | 5 +---- include/boost/algorithm/cxx11/partition_point.hpp | 4 +--- 12 files changed, 5 insertions(+), 38 deletions(-) diff --git a/include/boost/algorithm/cxx11/all_of.hpp b/include/boost/algorithm/cxx11/all_of.hpp index 39cab39..8280b18 100644 --- a/include/boost/algorithm/cxx11/all_of.hpp +++ b/include/boost/algorithm/cxx11/all_of.hpp @@ -12,7 +12,6 @@ #ifndef BOOST_ALGORITHM_ALL_OF_HPP #define BOOST_ALGORITHM_ALL_OF_HPP -#include // for std::all_of, if available #include #include @@ -27,8 +26,6 @@ namespace boost { namespace algorithm { /// \param p A predicate for testing the elements of the sequence /// /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template bool all_of ( InputIterator first, InputIterator last, Predicate p ) { diff --git a/include/boost/algorithm/cxx11/any_of.hpp b/include/boost/algorithm/cxx11/any_of.hpp index cf69348..e68135a 100644 --- a/include/boost/algorithm/cxx11/any_of.hpp +++ b/include/boost/algorithm/cxx11/any_of.hpp @@ -14,7 +14,6 @@ #ifndef BOOST_ALGORITHM_ANY_OF_HPP #define BOOST_ALGORITHM_ANY_OF_HPP -#include // for std::any_of, if available #include #include diff --git a/include/boost/algorithm/cxx11/copy_if.hpp b/include/boost/algorithm/cxx11/copy_if.hpp index d869caf..73e85d9 100644 --- a/include/boost/algorithm/cxx11/copy_if.hpp +++ b/include/boost/algorithm/cxx11/copy_if.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_ALGORITHM_COPY_IF_HPP #define BOOST_ALGORITHM_COPY_IF_HPP -#include // for std::copy_if, if available +#include // for std::pair, std::make_pair #include #include @@ -28,8 +28,6 @@ namespace boost { namespace algorithm { /// \param result An output iterator to write the results into /// \param p A predicate for testing the elements of the range /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template OutputIterator copy_if ( InputIterator first, InputIterator last, OutputIterator result, Predicate p ) { diff --git a/include/boost/algorithm/cxx11/copy_n.hpp b/include/boost/algorithm/cxx11/copy_n.hpp index ebfe889..ac88085 100644 --- a/include/boost/algorithm/cxx11/copy_n.hpp +++ b/include/boost/algorithm/cxx11/copy_n.hpp @@ -12,8 +12,6 @@ #ifndef BOOST_ALGORITHM_COPY_N_HPP #define BOOST_ALGORITHM_COPY_N_HPP -#include // for std::copy_n, if available - namespace boost { namespace algorithm { /// \fn copy_n ( InputIterator first, Size n, OutputIterator result ) @@ -25,8 +23,6 @@ namespace boost { namespace algorithm { /// \param n The number of elements to copy /// \param result An output iterator to write the results into /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template OutputIterator copy_n ( InputIterator first, Size n, OutputIterator result ) { diff --git a/include/boost/algorithm/cxx11/find_if_not.hpp b/include/boost/algorithm/cxx11/find_if_not.hpp index 414697c..02ff4dc 100644 --- a/include/boost/algorithm/cxx11/find_if_not.hpp +++ b/include/boost/algorithm/cxx11/find_if_not.hpp @@ -12,8 +12,6 @@ #ifndef BOOST_ALGORITHM_FIND_IF_NOT_HPP #define BOOST_ALGORITHM_FIND_IF_NOT_HPP -#include // for std::find_if_not, if it exists - #include #include @@ -27,8 +25,6 @@ namespace boost { namespace algorithm { /// \param last One past the end of the input sequence /// \param p A predicate for testing the elements of the range /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template InputIterator find_if_not ( InputIterator first, InputIterator last, Predicate p ) { diff --git a/include/boost/algorithm/cxx11/iota.hpp b/include/boost/algorithm/cxx11/iota.hpp index 2e638ec..675093f 100644 --- a/include/boost/algorithm/cxx11/iota.hpp +++ b/include/boost/algorithm/cxx11/iota.hpp @@ -12,8 +12,6 @@ #ifndef BOOST_ALGORITHM_IOTA_HPP #define BOOST_ALGORITHM_IOTA_HPP -#include - #include #include @@ -26,8 +24,6 @@ namespace boost { namespace algorithm { /// \param last One past the end of the input sequence /// \param value The initial value of the sequence to be generated /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template void iota ( ForwardIterator first, ForwardIterator last, T value ) { diff --git a/include/boost/algorithm/cxx11/is_partitioned.hpp b/include/boost/algorithm/cxx11/is_partitioned.hpp index cdabd97..cb6c71e 100644 --- a/include/boost/algorithm/cxx11/is_partitioned.hpp +++ b/include/boost/algorithm/cxx11/is_partitioned.hpp @@ -12,8 +12,6 @@ #ifndef BOOST_ALGORITHM_IS_PARTITIONED_HPP #define BOOST_ALGORITHM_IS_PARTITIONED_HPP -#include // for std::is_partitioned, if available - #include #include @@ -26,8 +24,6 @@ namespace boost { namespace algorithm { /// \param last One past the end of the input sequence /// \param p The predicate to test the values with /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template bool is_partitioned ( InputIterator first, InputIterator last, UnaryPredicate p ) { diff --git a/include/boost/algorithm/cxx11/is_permutation.hpp b/include/boost/algorithm/cxx11/is_permutation.hpp index ec902dc..0098cd5 100644 --- a/include/boost/algorithm/cxx11/is_permutation.hpp +++ b/include/boost/algorithm/cxx11/is_permutation.hpp @@ -12,8 +12,8 @@ #ifndef BOOST_ALGORITHM_IS_PERMUTATION11_HPP #define BOOST_ALGORITHM_IS_PERMUTATION11_HPP -#include // for std::less, tie, mismatch and is_permutation (if available) -#include // for std::make_pair +#include // for std::find_if, count_if, mismatch +#include // for std::pair #include // for std::equal_to #include @@ -108,8 +108,6 @@ namespace detail { /// \param p The predicate to compare elements with /// /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template< class ForwardIterator1, class ForwardIterator2, class BinaryPredicate > bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, BinaryPredicate p ) @@ -135,8 +133,6 @@ bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, /// \param last2 One past the end of the input sequence /// \param first2 The start of the second sequence /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template< class ForwardIterator1, class ForwardIterator2 > bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2 ) { diff --git a/include/boost/algorithm/cxx11/is_sorted.hpp b/include/boost/algorithm/cxx11/is_sorted.hpp index f6062da..f4dbb38 100644 --- a/include/boost/algorithm/cxx11/is_sorted.hpp +++ b/include/boost/algorithm/cxx11/is_sorted.hpp @@ -13,7 +13,6 @@ #ifndef BOOST_ALGORITHM_ORDERED_HPP #define BOOST_ALGORITHM_ORDERED_HPP -#include #include #include diff --git a/include/boost/algorithm/cxx11/none_of.hpp b/include/boost/algorithm/cxx11/none_of.hpp index 67be3d1..36f0aa8 100644 --- a/include/boost/algorithm/cxx11/none_of.hpp +++ b/include/boost/algorithm/cxx11/none_of.hpp @@ -12,7 +12,6 @@ #ifndef BOOST_ALGORITHM_NONE_OF_HPP #define BOOST_ALGORITHM_NONE_OF_HPP -#include // for std::none_of, if available #include #include diff --git a/include/boost/algorithm/cxx11/partition_copy.hpp b/include/boost/algorithm/cxx11/partition_copy.hpp index 2d8c3e9..f347f21 100644 --- a/include/boost/algorithm/cxx11/partition_copy.hpp +++ b/include/boost/algorithm/cxx11/partition_copy.hpp @@ -12,8 +12,7 @@ #ifndef BOOST_ALGORITHM_PARTITION_COPY_HPP #define BOOST_ALGORITHM_PARTITION_COPY_HPP -#include // for std::partition_copy, if available -#include // for make_pair +#include // for std::pair #include #include @@ -34,8 +33,6 @@ namespace boost { namespace algorithm { /// \param p A predicate for dividing the elements of the input sequence. /// /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template std::pair diff --git a/include/boost/algorithm/cxx11/partition_point.hpp b/include/boost/algorithm/cxx11/partition_point.hpp index f1310c3..2c2767a 100644 --- a/include/boost/algorithm/cxx11/partition_point.hpp +++ b/include/boost/algorithm/cxx11/partition_point.hpp @@ -12,7 +12,7 @@ #ifndef BOOST_ALGORITHM_PARTITION_POINT_HPP #define BOOST_ALGORITHM_PARTITION_POINT_HPP -#include // for std::partition_point, if available +#include // for std::distance, advance #include #include @@ -27,8 +27,6 @@ namespace boost { namespace algorithm { /// \param last One past the end of the input sequence /// \param p The predicate to test the values with /// \note This function is part of the C++2011 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template ForwardIterator partition_point ( ForwardIterator first, ForwardIterator last, Predicate p ) { From f06dc424dda4823ddee83a65e5b4532563d48a27 Mon Sep 17 00:00:00 2001 From: Kolya Matteo Date: Fri, 29 Apr 2016 16:04:17 -0400 Subject: [PATCH 2/4] In cxx14, remove unnecessary #include and correct some comments --- include/boost/algorithm/cxx14/equal.hpp | 3 ++- include/boost/algorithm/cxx14/is_permutation.hpp | 7 +------ include/boost/algorithm/cxx14/mismatch.hpp | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/boost/algorithm/cxx14/equal.hpp b/include/boost/algorithm/cxx14/equal.hpp index cfc62d5..f1539f8 100644 --- a/include/boost/algorithm/cxx14/equal.hpp +++ b/include/boost/algorithm/cxx14/equal.hpp @@ -13,7 +13,8 @@ #define BOOST_ALGORITHM_EQUAL_HPP #include // for std::equal -#include // for std::equal_to +#include // for std::binary_function +#include namespace boost { namespace algorithm { diff --git a/include/boost/algorithm/cxx14/is_permutation.hpp b/include/boost/algorithm/cxx14/is_permutation.hpp index 9346881..639446b 100644 --- a/include/boost/algorithm/cxx14/is_permutation.hpp +++ b/include/boost/algorithm/cxx14/is_permutation.hpp @@ -12,8 +12,7 @@ #ifndef BOOST_ALGORITHM_IS_PERMUTATION14_HPP #define BOOST_ALGORITHM_IS_PERMUTATION14_HPP -#include // for std::less, tie, mismatch and is_permutation (if available) -#include // for std::make_pair +#include // for std::pair #include // for std::equal_to #include @@ -31,8 +30,6 @@ namespace boost { namespace algorithm { /// \param first2 The start of the second sequence /// \param last1 One past the end of the second sequence /// \note This function is part of the C++2014 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template< class ForwardIterator1, class ForwardIterator2 > bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2 ) @@ -62,8 +59,6 @@ bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, /// \param pred The predicate to compare elements with /// /// \note This function is part of the C++2014 standard library. -/// We will use the standard one if it is available, -/// otherwise we have our own implementation. template< class ForwardIterator1, class ForwardIterator2, class BinaryPredicate > bool is_permutation ( ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, diff --git a/include/boost/algorithm/cxx14/mismatch.hpp b/include/boost/algorithm/cxx14/mismatch.hpp index 926ab19..c3de418 100644 --- a/include/boost/algorithm/cxx14/mismatch.hpp +++ b/include/boost/algorithm/cxx14/mismatch.hpp @@ -12,7 +12,6 @@ #ifndef BOOST_ALGORITHM_MISMATCH_HPP #define BOOST_ALGORITHM_MISMATCH_HPP -#include // for std::mismatch #include // for std::pair namespace boost { namespace algorithm { From e066bfae81c627758aec4440e4ca7adda981091c Mon Sep 17 00:00:00 2001 From: Kolya Matteo Date: Fri, 29 Apr 2016 16:12:49 -0400 Subject: [PATCH 3/4] Fix documentation to reflect commit 4dac507 --- doc/all_of.qbk | 2 +- doc/any_of.qbk | 2 +- doc/is_partitioned.qbk | 2 +- doc/is_permutation.qbk | 2 +- doc/none_of.qbk | 2 +- doc/partition_point.qbk | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/all_of.qbk b/doc/all_of.qbk index 91b7b36..5b0b8af 100644 --- a/doc/all_of.qbk +++ b/doc/all_of.qbk @@ -73,7 +73,7 @@ All of the variants of `all_of` and `all_of_equal` take their parameters by valu [heading Notes] -* The routine `all_of` is part of the C++11 standard. When compiled using a C++11 implementation, the implementation from the standard library will be used. +* The routine `all_of` is also available as part of the C++11 standard. * `all_of` and `all_of_equal` both return true for empty ranges, no matter what is passed to test against. When there are no items in the sequence to test, they all satisfy the condition to be tested against. diff --git a/doc/any_of.qbk b/doc/any_of.qbk index 61a6603..4a50861 100644 --- a/doc/any_of.qbk +++ b/doc/any_of.qbk @@ -73,7 +73,7 @@ All of the variants of `any_of` and `any_of_equal` take their parameters by valu [heading Notes] -* The routine `any_of` is part of the C++11 standard. When compiled using a C++11 implementation, the implementation from the standard library will be used. +* The routine `any_of` is also available as part of the C++11 standard. * `any_of` and `any_of_equal` both return false for empty ranges, no matter what is passed to test against. diff --git a/doc/is_partitioned.qbk b/doc/is_partitioned.qbk index 16dce6a..7a6c458 100644 --- a/doc/is_partitioned.qbk +++ b/doc/is_partitioned.qbk @@ -55,7 +55,7 @@ Both of the variants of `is_partitioned` take their parameters by value or const [heading Notes] -* The iterator-based version of the routine `is_partitioned` is part of the C++11 standard. When compiled using a C++11 implementation, the implementation from the standard library will be used. +* The iterator-based version of the routine `is_partitioned` is also available as part of the C++11 standard. * `is_partitioned` returns true for empty ranges, no matter what predicate is passed to test against. diff --git a/doc/is_permutation.qbk b/doc/is_permutation.qbk index 267bfab..e8753ba 100644 --- a/doc/is_permutation.qbk +++ b/doc/is_permutation.qbk @@ -71,7 +71,7 @@ All of the variants of `is_permutation` take their parameters by value, and do n [heading Notes] -* The three iterator versions of the routine `is_permutation` are part of the C++11 standard. When compiled using a C++11 implementation, the implementation from the standard library will be used. +* The three iterator versions of the routine `is_permutation` are also available as part of the C++11 standard. * The four iterator versions of the routine `is_permutation` are part of the proposed C++14 standard. When C++14 standard libraries become available, the implementation should be changed to use the implementation from the standard library (if available). diff --git a/doc/none_of.qbk b/doc/none_of.qbk index 3cda5f9..cf0b143 100644 --- a/doc/none_of.qbk +++ b/doc/none_of.qbk @@ -74,7 +74,7 @@ All of the variants of `none_of` and `none_of_equal` take their parameters by va [heading Notes] -* The routine `none_of` is part of the C++11 standard. When compiled using a C++11 implementation, the implementation from the standard library will be used. +* The routine `none_of` is also available aspart of the C++11 standard. * `none_of` and `none_of_equal` both return true for empty ranges, no matter what is passed to test against. diff --git a/doc/partition_point.qbk b/doc/partition_point.qbk index 8d1f76c..813a27b 100644 --- a/doc/partition_point.qbk +++ b/doc/partition_point.qbk @@ -54,7 +54,7 @@ Both of the variants of `partition_point` take their parameters by value or cons [heading Notes] -* The iterator-based version of the routine `partition_point` is part of the C++11 standard. When compiled using a C++11 implementation, the implementation from the standard library will be used. +* The iterator-based version of the routine `partition_point` is also available as part of the C++11 standard. * For empty ranges, the partition point is the end of the range. From c11878cd8acb477713cd9b35ef070e8433ed3e89 Mon Sep 17 00:00:00 2001 From: Kolya Matteo Date: Fri, 29 Apr 2016 16:20:43 -0400 Subject: [PATCH 4/4] typo --- doc/none_of.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/none_of.qbk b/doc/none_of.qbk index cf0b143..f0b93b7 100644 --- a/doc/none_of.qbk +++ b/doc/none_of.qbk @@ -74,7 +74,7 @@ All of the variants of `none_of` and `none_of_equal` take their parameters by va [heading Notes] -* The routine `none_of` is also available aspart of the C++11 standard. +* The routine `none_of` is also available as part of the C++11 standard. * `none_of` and `none_of_equal` both return true for empty ranges, no matter what is passed to test against.