std.algorithm.remove and principle of least astonishment

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Oct 16 14:28:17 PDT 2010


On 10/16/2010 02:58 PM, Tomek Sowiński wrote:
> Andrei Alexandrescu napisał:
>
>> On 10/16/2010 01:39 PM, Steven Schveighoffer wrote:
>>> I suggest wrapping a char[] or wchar[] (of all constancies) with a
>>> special range that imposes the restrictions.
>>
>> I did so. It was called byDchar and it would accept a string type. It
>> sucked.
>
> Why it sucked?

Because 99% of the times you'd want to pass byDchar, but it was easy to 
forget. Then the algorithm would compile and run without byDchar, just 
with useless semantics.

Andrei


More information about the Digitalmars-d mailing list