Boost logo

Boost :

Subject: Re: [boost] [cpo-proposal] presentation of the idea
From: Santiago Tapia (santiago.tapia_at_[hidden])
Date: 2013-08-15 11:10:35


>Date: Tue, 13 Aug 2013 07:42:03 -0500
>From: Larry Evans <cppljevans_at_[hidden]>
>To: boost_at_[hidden]
>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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk