[phobos] Bug 4455: Taking sqrt of an integer

Andrei Alexandrescu andrei at erdani.com
Tue Jul 13 14:48:26 PDT 2010


On 07/13/2010 04:46 PM, Don Clugston wrote:
> On 13 July 2010 23:25, David Simcha<dsimcha at gmail.com>  wrote:
>> What's wrong w/ adding sqrt(long) and sqrt(ulong) overloads that just
>> forward to sqrt(real)?
>
> Doesn't work -- it's ambiguous for ints.
>   You need an explicit specialisation for every type: byte, ubyte,
> short, ushort, int, uint, long, ulong.
> Yuck.

Or templates that dispatch using constraints.

Andrei


More information about the phobos mailing list