Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Function template is_palindrome

boost::algorithm::is_palindrome

Synopsis

// In header: <boost/algorithm/is_palindrome.hpp>


template<typename BidirectionalIterator, typename Predicate> 
  bool is_palindrome(BidirectionalIterator begin, BidirectionalIterator end, 
                     Predicate p);

Description

[Note] Note

This function will return true for empty sequences and for palindromes. For other sequences function will return false. Complexity: O(N).

Parameters:

begin

The start of the input sequence

end

One past the end of the input sequence

p

A predicate used to compare the values.

Returns:

true if the entire sequence is palindrome


PrevUpHomeNext