--

Why bother?

import std.algorithm : max;

F fun (F a, F b) { return max(a,b) + 1.; }
unittest { assert (gun(1, 2) == gun(2, 1)); } // Passes

F pun (F a, F b) { return sin(max(a,b)); }
unittest { assert (fun(1, 2) == fun(2, 1)); } // Fails

// Fun, gun, pun...
unittest { assert (fun(1, 2) == fun(2, 1)); } // Passes
unittest { assert (pun(1, 2) == pun(2, 1)); } // Fails
  • Bug? deed via Digitalmars-d-learn
    • Re: Bug? deed via Digitalmars-d-learn
    • Re: Bug? Steven Schveighoffer via Digitalmars-d-learn
      • Re: Bug? deed via Digitalmars-d-learn
        • Re: Bug? Steven Schveighoffer via Digitalmars-d-learn

Reply via email to