mrmocool at gmx.de
Fri Mar 20 08:35:24 PDT 2009
Got the following code:
public LuaState wrapClass (T) (T instance)
auto ptr = cast (T *) newUserdata ( (T *).sizeof);
*ptr = instance;
Am I right in assuming that a different wrapClass will be created in the
final executable for each template instantiation (e.g. calls with class
A,B,C,... instances) and would thus bloat up the executable a bit when
used with many classes?
Apart from that, couldn't you just use wrapClass (Object instance)? In
the end each class instance pointer takes up the same amount of memory?!
More information about the Digitalmars-d-learn