www.digitalmars.com         C & C++   DMDScript  
Archives

D Programming
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger
D.gnu
D

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics


digitalmars.D.learn - Automatical generation of class member functions in respect of some interface

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