On 27.02.19 19:10, Dukc wrote:
I tested a bit, and it appears that attribute inference is not done at
all for templates inside structs -the attribute need not be a delegate:
struct S
{
static int fImpl(Ret)() { return Ret.init; }
pragma(msg,
On Wednesday, 27 February 2019 at 17:23:21 UTC, Q. Schroll wrote:
For whatever reason, when I put the code in a struct, the @safe
testing line tells me, it's @system now.
I tested a bit, and it appears that attribute inference is not
done at all for templates inside structs -the attribute
On Wednesday, 27 February 2019 at 18:06:49 UTC, Stefan Koch wrote:
the struct gets drawn into your delegate-context.
and I guess that taints the function.
Even if it did, it should not make the delegate @system. And it
does not, since this manifest with static functions and function
On Wednesday, 27 February 2019 at 17:23:21 UTC, Q. Schroll wrote:
I have a template function `fImpl` I whish to instantiate
manually using the new name `f`. Reason is simple: `f` should
not be a template, but overloading it makes it easier that way.
Nothing's more simple in D:
[...]
the
I have a template function `fImpl` I whish to instantiate
manually using the new name `f`. Reason is simple: `f` should not
be a template, but overloading it makes it easier that way.
Nothing's more simple in D:
int fImpl(T)(T value) { return cast(int) value; }
alias f = fImpl!int;