Closed John-Colvin closed 7 years ago
IsVirtual is used only a compile time. But indeed I saw in the std lib code that they use enum
for this sort of things. static
: dunni remember why, maybe I initially nested this class into another?? Regardless, thanks for the patch.
@jll63 as a rule of thumb, if something is only needed at compile-time, always use enum
. If the result would be used more than once at runtime, use static immutable
, which in addition to what enum
gives you (forcing compile-time evaluation) will store the literal as a global variable, so that multiple uses at runtime would not cause re-evaluation. See also: http://dlang.org/blog/2017/06/05/compile-time-sort-in-d/
Don't want to allocate runtime space in TLS (or anywhere else) for
IsVirtual
, so change toenum
static
isn't doing anything onCallParams