[Issue 10039] std.algorithm enhancements: min, max, clamp

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 21 14:12:34 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10039



--- Comment #4 from Diggory <diggsey at googlemail.com> 2013-06-21 14:12:30 PDT ---
(In reply to comment #3)
> Regarding max(x) and min(x) what are the use cases? I don't see any.
> 
> Regarding clamp(), sometimes I need a function like that. But I think it's
> better to design it like this: clamp(var, a, b) so it's usable in UFCS chains.

The single parameter cases come up when using min/max in generic code.
Otherwise it is necessary to special case it on every use.

With regards to clamp I have no strong feelings about parameter order, etc.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list