Automatical generation of class member functions in respect of some interface

Biga bigasoft at gmail.com
Sun Jan 10 02:26:50 PST 2010


It was fun to implement the subj.

At first, I wrote it using ParameterTypeTuple!() template. Hence, no storage classes (ref, out, lazy etc.) are supported. But it works.

http://paste.dprogramming.com/dplyvf4d

---

Then I was suggested to implement the same thing by means of parsing function type .stringof, which contains full function declaration (including storage classes). So I did this. This version supports storage classes, but it won't work if there are functions with default parameters or variadics. My lame parser doesn't support such things, but I guess it's possible to implement them as well.

http://paste.dprogramming.com/dpnpgcdm




More information about the Digitalmars-d-learn mailing list