From 42bbfdeb4c18cc3d816932cb27bdfbaddd1fa602 Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 16 Aug 2016 16:18:21 +0300 Subject: [PATCH] Deleted support for nullptr, NULL and 0. I think user shouldn't send to 'is_palindrome' zero, NULL or nullptr as parameter. As value of const char* it's possible, of course. But cases 'is_palindrome(0)', 'is_palindrome(NULL)' and 'is_palindrome(nullptr)' is silly and it should be restricted by design. --- include/boost/algorithm/is_palindrome.hpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/include/boost/algorithm/is_palindrome.hpp b/include/boost/algorithm/is_palindrome.hpp index 714c833..8649ad6 100644 --- a/include/boost/algorithm/is_palindrome.hpp +++ b/include/boost/algorithm/is_palindrome.hpp @@ -102,7 +102,7 @@ bool is_palindrome(BidirectionalIterator begin, BidirectionalIterator end) /// \note This function will return true for empty sequences and for palindromes. /// For other sequences function will return false. /// Complexity: O(N). -template ::value_type>::type> +template bool is_palindrome(const R& range) { return is_palindrome(boost::begin(range), boost::end(range)); @@ -117,7 +117,7 @@ bool is_palindrome(const R& range) /// \note This function will return true for empty sequences and for palindromes. /// For other sequences function will return false. /// Complexity: O(N). -template ::value_type>::type> +template bool is_palindrome(const R& range, Predicate p) { return is_palindrome(boost::begin(range), boost::end(range), p); @@ -161,17 +161,6 @@ bool is_palindrome(const char* str, Predicate p) return is_palindrome(str, str + strlen(str), p); } -bool is_palindrome (nullptr_t) -{ - return true; -} - -template -bool is_palindrome (T) -{ - return true; -} - }} #endif // BOOST_ALGORITHM_IS_PALINDROME_HPP