Hi all, I have started finding lots of uses for abstract classes to define interfaces for common functionality using polymorphism and i know that using polymorphism and virtual functions incurrs some additional call cost of functions. So what im wondering is can i get the best of both worlds? consider the following basic example [code] class iShape { public: iShape(); virtual ~iShape(); virtual float GetArea( void ) = 0; virtual 3dPos GetPos( void ) = 0; }; [/code] Using an abstract class like this gives me a good interface and hides the implimentation and all that stuff and i really …

Member Avatar
Member Avatar
+0 forum 3

Dear knowledgeable ones. Some time ago I made a few of my routines kind of universal, and I wonder if there is any way in Delphi (My version is Delphi9) that can be used to reuse this code in example below. As you see, the two procedures are almost identical, it is just the typedeclaration that is different in the parameters passed to the procedures. Maybe it is possible to use some kind of typecasting but my experience there is limited. The code is not bad if only 2 similar blocks, I just see that it would be better with …

Member Avatar
Member Avatar
+0 forum 3

The End.