On Tuesday, 11 June 2019 at 02:24:49 UTC, Adam D. Ruppe wrote:
On Tuesday, 11 June 2019 at 02:04:13 UTC, Machine Code wrote:
I also, quite disappointed how UDAs doesn't work with enums. I
end up using struct + enum to simulate that, sometimes it's
quite a work.
They do now...
struct foo {}
On Tuesday, 11 June 2019 at 02:04:13 UTC, Machine Code wrote:
I also, quite disappointed how UDAs doesn't work with enums. I
end up using struct + enum to simulate that, sometimes it's
quite a work.
They do now...
struct foo {}
enum Foo {
@foo a
}
void main() {
On Wednesday, 14 November 2018 at 16:28:19 UTC, Radu wrote:
Looks like that there is no easy way to extract a function
parameters UDA list.
The following:
```
import std.traits;
struct s { string foo; }
void foo(@s("aaa") int a, bool x);
void main()
{
alias P = Parameters!foo;
enum
On 11.06.19 01:12, Johannes Loher wrote:
I would like to iterate over all parameters of a function using static
foreach and then process each parameter's UDAs. But by using static
foreach on the parameter tuple, slicing it is not possible anymore, so
the suggested workaround does not work in
On Wednesday, 14 November 2018 at 18:05:55 UTC, Adam D. Ruppe
wrote:
On Wednesday, 14 November 2018 at 16:28:19 UTC, Radu wrote:
Looks like that there is no easy way to extract a function
parameters UDA list.
Indeed, the only way I can find is kinda crazy:
---
void foo(int f, @("test")
On Wednesday, 14 November 2018 at 18:05:55 UTC, Adam D. Ruppe
wrote:
On Wednesday, 14 November 2018 at 16:28:19 UTC, Radu wrote:
Looks like that there is no easy way to extract a function
parameters UDA list.
Indeed, the only way I can find is kinda crazy:
---
void foo(int f, @("test")
On Wednesday, 14 November 2018 at 16:28:19 UTC, Radu wrote:
Looks like that there is no easy way to extract a function
parameters UDA list.
Indeed, the only way I can find is kinda crazy:
---
void foo(int f, @("test") string s) {}
void main() {
static if(is(typeof(foo) Params ==
Looks like that there is no easy way to extract a function
parameters UDA list.
The following:
```
import std.traits;
struct s { string foo; }
void foo(@s("aaa") int a, bool x);
void main()
{
alias P = Parameters!foo;
enum udas = __traits(getAttributes, P);
pragma(msg, udas);
}