Boost logo

Boost :

Subject: Re: [boost] 'is_palindrome' and 'const char*'
From: Зайцев Александр (zamazan4ik_at_[hidden])
Date: 2016-08-12 18:46:46


Sorry, i forgot about link. You can find this algo in Boost.Algorithm: https://github.com/boostorg/algorithm/blob/develop/include/boost/algorithm/is_palindrome.hpp

--
Best regards, Alexander Zaitsev
12.08.2016, 04:00, "Зайцев Александр" <zamazan4ik_at_[hidden]>:
> Hello. I have some question about some case for 'is_palindrome' algo.
>
> 'is_palindrome' algorithm checks a sequence - if sequence is a palindromeor empty, function returns true, in other cases returns false.
>
> But in case e.g. "a" (is_palindrome("a")) result is false, because "a" = {'a', '\0'}. And maybe this behaviour is unexpected for users.
>
> So... what do you think about it? Should I implement special version for const char* or not?
>
> --
> Best regards, Zaitsev Alexander
-- 
С уважением, Зайцев Александр.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk