On Saturday, June 03, 2017 14:22:11 David Nadlinger via Digitalmars-d-learn
wrote:
> On Saturday, 3 June 2017 at 14:19:00 UTC, Jacob Carlborg wrote:
> > Perhaps using the variadic template with a constraint on one
> > element trick will work. Ugly, but I think that will work.
>
> We could also fin
On 2017-06-03 16:22, David Nadlinger wrote:
We could also finally fix the frontend to get around this. At DConf
2015, Walter officially agreed that this is a bug that needs fixing. ;)
That would be nice.
--
/Jacob Carlborg
On Saturday, 3 June 2017 at 14:19:00 UTC, Jacob Carlborg wrote:
Perhaps using the variadic template with a constraint on one
element trick will work. Ugly, but I think that will work.
We could also finally fix the frontend to get around this. At
DConf 2015, Walter officially agreed that this i
Jacob Carlborg wrote:
Perhaps using the variadic template with a constraint on one element
trick will work. Ugly, but I think that will work.
yeah. that's what Phobos does, for example.
On 2017-06-03 16:03, Nicholas Wilson wrote:
I think an alias template parameter will work here as aliases take
anything(types, literals, symbols).
No, it doesn't work for types:
void foo(alias a)() {}
void main()
{
foo!(int)();
}
Results in:
Error: template instance foo!int does not ma
On Saturday, 3 June 2017 at 13:17:46 UTC, Russel Winder wrote:
Is this a problem in D or a problem in DStep?
It's a limitation of DStep – for that use case, it would need to
transform one of the macro arguments into a template argument
rather than a runtime function parameter.
If you need t
On Saturday, 3 June 2017 at 13:17:46 UTC, Russel Winder wrote:
A stripped down problem to avoid fluff. The C macro:
#define FLOB(t) (sizeof(t))
Can be used in another macro:
#define THINGY(a, b) (_THING(a, FLOB(b)))
We can use this as in:
THINGY(10, __u32)
Now the D Way says use
Russel Winder wrote:
Now the D Way says...
..use templates! ;-)
it is not really possible to guess what macro author means (to do that,
dstep should be able to actually *understand* the code), so it tries to do
what is used more often.
that is, it's dstep failed guess.