On Fri, 06 Apr 2012 09:23:01 -0400, Steven Schveighoffer <schvei...@yahoo.com> wrote:

7. One can lookup whether an attribute exists on a symbol using __traits(hasAttribute, symbol). 8. One can retrieve the value of the CTFE result using __traits(getAttribute, symbol). If the CTFE function returns void, this is a compiler error.

Boy, this was underspecified!

__traits(hasAttribute, attribute, symbol)
__traits(getAttribute, attribute, symbol)

string serialize(T)(const ref T t) if (__traits(hasAttribute, serializable) && __traits(getAttribute, serializable))

again:

if (__traits(hasAttribute, serializable, T) && __traits(getAttribute, serializable, T))

-Steve

Reply via email to