
6 Dec
2004
6 Dec
'04
12:51 p.m.
Jeff Garland wrote:
I was asking because I was curious if the construction idiom based on string could be applied consistently throughout an application even if in some places in the code I had exact knowledge and hence wouldn't be constructing a base class pointer. My interpretation of the above is that in this case I have to drop back to doing a regular constructor because the virtual constructor doesn't handle this elegantly....
In the module where you would want to use it you could simply: TYPE_MAP(square); TYPE_REGISTER(square, square); square* ps = dynamic_new<square>("square"); This is exactly the same as square* ps = new square; I am not sure if I got your point? Roland