Function hijack on selective import

rumbu rumbu at rumbu.ro
Tue Jan 16 19:14:00 UTC 2018


On Tuesday, 26 December 2017 at 20:21:11 UTC, Adam D. Ruppe wrote:
> On Tuesday, 26 December 2017 at 19:41:47 UTC, rumbu wrote:
>> "Custom" is a templated struct. I cannot imagine all the 
>> instantiations of Custom to write template specialisations for 
>> each of them.
>
> You can specialize on templated structs generically.
>
> int foo(T : Bar!(X, Y), X, Y)
>
> that kind of thing covers any case of Bar!(X,y)

Even specialized, now I have another problem:

std.math:

int signbit(X)(X x) { ... }

mylibrary:

int signbit(D: Decimal!bits, int bits) { ... }

=============

end user:

import std.math;
import mylibrary;

Decimal!32 d;
float f;

auto y = signbit(f); //ok, call to std.math.signbit
auto x = signbit(d); //error, also calls std.math.signbit



More information about the Digitalmars-d-learn mailing list