
Date: Tue, 13 Aug 2013 07:42:03 -0500 From: Larry Evans
To: boost@lists.boost.org Subject: Re: [boost] [cpo-proposal] presentation of the idea What if the class hierarchy is used to model a graph that contains cycles. For example, something like a spirit grammar where a non-terminal on the rhs of a non-terminals definition?
I don't see any problem, as long as they fulfill the requirements of the classifier container, i.e. the objects to be inserted should be copyable and derived from the base class in the template argument of the classifier.
Wouldn't this require some sort of smart pointer or other garbage collection method with the ability to collect cycles?
I don't think so, the classifier container should be able to replace any occurence of something like: vector< shared_ptr <base> > in almost in any circunstance. Beside, you could avoid virtual destructors because the classifier will destroy the object directly not from a base* pointer.