|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger 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 |
D - Template Struct Member Functions, and lengthy template instantiations.
I can see why one would wish to avoid virtual template class template member functions to keep a fixed size vtable (I miss them however!) Is that a feature that will be added? How about template struct template member functions: these are just syntactic sugar for making a static function... Speaking of making a static function...I made 2 vector classes, one for float vectors one for double, and I wish to multiply them. I am stuck with XVector!(double) k=XVector!(double).opCall(1,2,3); XVector!(float) l=XVector!(float).opCall(3,4,1);//why must call opCall? XVector!(double) m = VecOp!(typeof(k.x),typeof(l.x)). Mul(k,l); typing VecOp!(typeof(k.x),typeof(l.x).Mul(k,l) is lengthy, and obscures the function of the code, which is to multiply k with l. in C++ I would make a macro at the very worst (an overloaded operator at best) that did it #define VecMul(k,l) VecOp!(typeof(k.x),typeof(l.x).Mul(k,l) is there any shorthand for this, short of running gcc -E before gdc? PS: Typeof is really cool! Apr 29 2004
"Daniel Horn" <hellcatv hotmail.com> wrote in message news:c6rlj9$2aga$1 digitaldaemon.com...I can see why one would wish to avoid virtual template class template member functions to keep a fixed size vtable (I miss them however!) Is that a feature that will be added? Apr 29 2004
|