On Thursday, 12 April 2012 at 22:15:42 UTC, Andrei Alexandrescu wrote:
On 4/12/12 4:57 PM, Martin Nowak wrote:
The generalized palindrome doesn't work with odd lengths.
simple fix:

bool palindrome(Range)(Range range) {
for (; !range.empty; range.popFront(), range.empty || range.popBack()) {
if (range.front != range.back)
return false;
}
return true;
}

Ouch. Thanks.

Call me stupid, but how exactly is the version from Andrei's slides broken?

David

Reply via email to