Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define so_convenient(x) value = some_func(x,#x)
- mixin("value = 123;");
- string soConvenient(alias A)()
- {
- return std.string.format(
- 'value = someFunc(%1$s, "%1$s");',
- __traits(identifier, A));
- }
- mixin(soConvenient!x); // equivalent to 'so_convenient(x) in C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement