http://d.puremagic.com/issues/show_bug.cgi?id=10039
yebblies <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #6 from yebblies <[email protected]> 2013-08-03 14:36:04 EST --- (In reply to comment #5) > (In reply to comment #4) > > > The single parameter cases come up when using min/max in generic code. > > Otherwise it is necessary to special case it on every use. > > Can you show one real example of such generic code where this happens? import std.algorithm; import std.stdio; int minpos(T...)(T args) { auto minv = min(args); foreach(i, v; args) if (v == minv) return i; return -1; } void main() { writeln(minpos(3, 2, 1)); writeln(minpos(2, 1)); writeln(minpos(1)); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
