in a template, how can I get the parameter of a user defined attribute

2021-11-06 Thread Chris Bare via Digitalmars-d-learn
In the example below, one of the attributes is @dbForeignKey!Position. pragma (msg, attr) gives me: dbForeignKey!(Position). I want to be able to extract the Postion as a type so I can call another template like: save!Position (); Is this possible? ```d import std.stdio; import std.traits; im

Re: in a template, how can I get the parameter of a user defined attribute

2021-11-06 Thread Adam Ruppe via Digitalmars-d-learn
On Saturday, 6 November 2021 at 19:45:49 UTC, Chris Bare wrote: dbForeignKey!(Position) static if(is(T == dbForeignKey!Arg, Arg)) { // use Arg here }

Re: in a template, how can I get the parameter of a user defined attribute

2021-11-06 Thread Chris Bare via Digitalmars-d-learn
On Saturday, 6 November 2021 at 19:51:09 UTC, Adam Ruppe wrote: On Saturday, 6 November 2021 at 19:45:49 UTC, Chris Bare wrote: dbForeignKey!(Position) static if(is(T == dbForeignKey!Arg, Arg)) { // use Arg here } Thanks, that did it.