[Dlang-internal] Modifying vtbl in ClassInfo
Jean-Louis Leroy via Dlang-internal
dlang-internal at puremagic.com
Sat Jul 22 18:08:21 PDT 2017
On Saturday, 22 July 2017 at 01:18:12 UTC, Walter Bright wrote:
> You could make it work by making a copy of the vtbl[],
> modifying it as you please, and seeing __vptr to it.
>
> If you're trying to implement signals and slots, it's already
> in the library:
>
> http://dlang.org/phobos/std_signals.html
Thanks for the suggestion. I am working on open methods, not
signals. So far I've hijacked the 'deallocator' field but now I
am experimenting with a perfect hash of the vptr. Seems to work
quite well...
More information about the Dlang-internal
mailing list