Andrei Alexandrescu wrote:
I think you need to operate exclusively with string mixins in Finalize, so __ident would be of marginal help there. Also, static foreach is much more necessary.

That is a huge problem.

Let's say that the class you want to finalize, Target, has a method like this:
void foo(SomeClass){}

Let's say that SomeClass is private and in the same module as Target.

You *may* be able to do this with templates. Probably.

You *can never* do this with a string mixin.

Let's say you have another method:
void bar(SomeOtherClass!(int)){}

SomeOtherClass!(int).stringof == "SomeOtherClass". That is also guaranteed fail.


What you can do is:
void foo(ParameterTupleOf!(__traits(getVirtualFunctions, Target, "foo")[0] u) { super.foo(u); }

Here, the only string you need to mix in is for the identifier.

Reply via email to