const debacle

Janice Caron caron800 at googlemail.com
Mon Mar 24 12:22:53 PDT 2008


On 24/03/2008, Craig Black <cblack at ara.com> wrote:
> I must have missed something.  What's wrong with this:
>
>  T min(T)(const T a, const T b) { return a < b ? a : b; }

Surely, that won't compile, because the type of (a < b ? a : b) is
const(T), and const(T) won't implicitly convert to T.



More information about the Digitalmars-d mailing list