Video: Andrei Alexandrescu at @ Lang.NEXT 2012

David Nadlinger see at klickverbot.at
Thu Apr 12 15:27:02 PDT 2012


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


More information about the Digitalmars-d-announce mailing list