Doc Comments /
Traits
Difference (last change) (Author, normal page display)
Added: 1a2
=== Virtual Functions = |
Added: 2a4,9
=== Determining if something compiles = __traits(compiles) will die on something with mismatched parentheses (and some other problems). To avoid these problems, use a string mixin: static if (__traits (compiles, mixin ("&(foo"))) {} |
Messages
Virtual Functions
__traits defines a virtual function as any function that appears in a vtbl. This includes final functions. In order to get functions that can be overridden, you must filter the list with (!__traits(isFinalFunction)).
Determining if something compiles
__traits(compiles) will die on something with mismatched parentheses (and some other problems). To avoid these problems, use a string mixin:static if (__traits (compiles, mixin ("&(foo"))) {}
Links
