[phobos] Bug 4455: Taking sqrt of an integer

Sean Kelly sean at invisibleduck.org
Thu Jul 15 20:04:20 PDT 2010


I think it should work. If the signature changes it just won't be recognized as an intrinsic any more, right?

Sent from my iPhone

On Jul 15, 2010, at 6:22 PM, Don Clugston <dclugston at googlemail.com> wrote:

> On 16 July 2010 01:04, David Simcha <dsimcha at gmail.com> wrote:
>> So is everyone on board for this?  If not, please say something.  Otherwise
>> I'll make the changes.
> 
> It won't work. sqrt is a compiler intrinsic, and can't be changed to a
> template without modifying the compiler.
> 
>> 
>> On 7/13/2010 6:12 PM, David Simcha wrote:
>> 
>> This is probably the way to go, though I really wish the bug that prevents
>> overloading functions against templates would get fixed so it wouldn't mean
>> that the floating point case would have to be templated, too.
>> 
>> On Tue, Jul 13, 2010 at 5:48 PM, Andrei Alexandrescu <andrei at erdani.com>
>> wrote:
>>> 
>>> 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
>>> _______________________________________________
>>> phobos mailing list
>>> phobos at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/phobos
>> 
>> 
>> 
>> _______________________________________________
>> phobos mailing list
>> phobos at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/phobos
>> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list