[phobos] std.string.cmp

Andrei Alexandrescu andrei at erdani.com
Mon Jan 10 23:11:38 PST 2011


I reverted to int. I was worried about a slight inefficiency but I guess 
it's hardly measurable.

Andrei

On 1/10/11 10:56 PM, Brad Roberts wrote:
> Hrm.. I think I'd like to object to today's change of std.string.cmp to return
> sizediff_t rather than int.  The reason.. Object.opCmp returns int.  So, using
> cmp is needlessly painful.  A simple cast is dangerous.. consider what happens
> if some how the cmp returns a multiple of 2^32.  But I guarantee that a simple
> cast is what most people that run into the mismatch will do.
>
> Thoughts?
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list