On Tuesday, 16 January 2018 at 20:30:43 UTC, H. S. Teoh wrote:
On Tue, Jan 16, 2018 at 07:14:00PM +, rumbu via
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
On Tue, Jan 16, 2018 at 07:14:00PM +, rumbu via Digitalmars-d-learn wrote:
> 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
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
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
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
On Tuesday, 26 December 2017 at 16:15:55 UTC, Adam D. Ruppe wrote:
The mistake you're making is using a constraint when you should
try a specialization:
int signbit(T:Custom)(T x)
{
return 0;
}
That means to use this specialized function when T is Custom.
Now, you just need to merge
The mistake you're making is using a constraint when you should
try a specialization:
int signbit(T:Custom)(T x)
{
return 0;
}
That means to use this specialized function when T is Custom.
Now, you just need to merge the overload sets:
import std.math;
alias signbit =