On 02.07.16 05.44, Mark wrote:
> The factory pattern is suitable for one aspect of my code but the factory design is predicated upon dynamic allocation - at least my experience. Can I use factory design with static allocation?
Yes.
The storage for the target need to be provided by the caller and the
factory can use placement new to do its job. You might also use this
with polymorphism as long as the target storage is large enough to keep
any variant.
Marcel