Is it possible to pass a pointer to a type as an argument to a function?
e.g.
Or something like that??Code:void Function(void *type) { type Variable; }
Is it possible to pass a pointer to a type as an argument to a function?
e.g.
Or something like that??Code:void Function(void *type) { type Variable; }
"The most important thing about acting is honesty. If you can fake that you've got it made" - George Burns
One solution is an object factory as Andrei Alexandrescu describes in Modern C++ Design.
The code above is an example and requires much more modifications to solve your problem. Nonetheless, the concept is the same.Code:typeplate <typename T, typename U> class A { ... T * CreateObject(); };
Kuphryn
This seems to work:
Code:template<class T> void Function(const T& obj) { T innerobj; // ... Other Stuff }
Cheers guys, I have a look :-)
dt
"The most important thing about acting is honesty. If you can fake that you've got it made" - George Burns