On Wednesday, 7 May 2014 at 09:51:01 UTC, John Colvin wrote:
On Wednesday, 7 May 2014 at 09:47:20 UTC, Yuriy wrote:
Hello, is there any way to static if(__ctfe)? I want to
declare class members which are only available in ctfe. Thanx.
Sadly not as far as I know. What's the use-case? There may be a
nice solution none-the-less.
Well, i'm currently playing with std.variant so it can be
ctfe-friendly. And it works pretty much, however i need to use
T.stringof.ptr/length instead of typeid (typeid is ctfeable), and
i'm not sure if it's good for performance in runtime. So for type
comparison i'd like to compare TypeInfos in rt, and T.stringof in
ct. Using both with rt if will likely generate more code.