On Sunday, October 01, 2017 06:32:53 Nicholas Wilson via Digitalmars-d-learn
wrote:
> On Sunday, 1 October 2017 at 06:27:21 UTC, Nicholas Wilson wrote:
> > And am getting
> > util.d(72,12): Error: template instance helper!(foo) cannot use
> > local 'foo' as parameter to non-global template
> > hel
On Sunday, 1 October 2017 at 06:27:21 UTC, Nicholas Wilson wrote:
And am getting
util.d(72,12): Error: template instance helper!(foo) cannot use
local 'foo' as parameter to non-global template
helper(Fields...)
Fixed by making helper a global template.
Thanks Jonathan!
On Sunday, 1 October 2017 at 04:44:16 UTC, Jonathan M Davis wrote:
I don't see any reason why the compiler would be complaining
about 'this' being required.
Neither do I.
I would think that that would imply that the compiler thinks
that you're accessing the member rather than introspecting on
On Sunday, October 01, 2017 03:11:15 Nicholas Wilson via Digitalmars-d-learn
wrote:
> On Sunday, 1 October 2017 at 02:29:57 UTC, Jonathan M Davis wrote:
> > I would have thought that it would be pretty straightforward to
> > just write a recursive, eponymous template to solve the problem
> > and h
On Sunday, 1 October 2017 at 02:29:57 UTC, Jonathan M Davis wrote:
I would have thought that it would be pretty straightforward to
just write a recursive, eponymous template to solve the problem
and have it recursively build a single string to mix in for
everything.
In general though, without
On Sunday, October 01, 2017 02:07:26 Nicholas Wilson via Digitalmars-d-learn
wrote:
> On Sunday, 1 October 2017 at 01:05:56 UTC, Nicholas Wilson wrote:
> > struct MyType
> > {
> >
> > void* raw;
> > static struct Info
> > {
> >
> > @(42) int foo;
> >
> > }
> > mixin gen
On Sunday, 1 October 2017 at 01:05:56 UTC, Nicholas Wilson wrote:
struct MyType
{
void* raw;
static struct Info
{
@(42) int foo;
}
mixin generateGetInfo!MyTypeGetInfo;
}
extern(C) void MyTypeGetInfo(void*,int,size_t,void*size_t*);
mixin template generateGetInfo(alias
struct MyType
{
void* raw;
static struct Info
{
@(42) int foo;
}
mixin generateGetInfo!MyTypeGetInfo;
}
extern(C) void MyTypeGetInfo(void*,int,size_t,void*size_t*);
mixin template generateGetInfo(alias func)
{
foreach(field; typeof(this).Info.tupleof)
{