Boost logo

Boost :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2004-12-06 07:51:53

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_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?


Boost list run by bdawes at, gregod at, cpdaniel at, john at