another cool RTInfo trick - i want in runtime
Adam D. Ruppe
destructionator at gmail.com
Thu Jan 16 10:59:36 PST 2014
On Thursday, 16 January 2014 at 18:15:39 UTC, Vladimir Panteleev
wrote:
> 1. I guess TypeCheck is a temporary name? I would suggest e.g.
> CustomRTInfo.
My first thought when writing this was the TypeCheck would just
contain a bunch of static asserts to ensure the type matches
whatever your project's special requirements are; it would act
kinda like a plugin to the compiler's semantic check. (Actually,
it does the bool because my first try was to use it as a template
constraint, but if that fails, ti just stops the RTInfo from
instantiating; it doesn't actually fail the compile like static
assert inside does.)
But CustomRTInfo is a good name too, especially if we are adding
data.
> 2. How about using a template mixin instead of a template?
If we actually mix it in that could change the binary layout of
the thing though.
We don't need the dummy bool btw, I just tried and it works the
same without it.
> It all fits together quite nicely. You can access stuff in your
> main program by importing its modules within the template mixin.
yes
More information about the Digitalmars-d
mailing list