Created
April 15, 2015 01:21
-
-
Save extrawurst/82864f72bb97dfea2481 to your computer and use it in GitHub Desktop.
d demplate for Type member
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto foo(T)() | |
{ | |
pragma(msg, T.stringof); | |
return __traits(getAttributes, T); | |
} | |
pragma(msg, foo(MyType.member)); // leads to "Error: need 'this' for 'member' of type 'bool'" | |
pragma(msg, __traits(getAttributes, MyType.member)); // works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
auto foo(alias T)()
does not change anything