digitalmars.D.learn - Automatical generation of class member functions in respect of some interface
- Biga (6/6) Jan 10 2010 It was fun to implement the subj.
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
Jan 10 2010