Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-02-07 09:34:33


Michiel Salters wrote:

> The class options_description_easy_init is supposed to
> provide "convenient creation syntax to option_description"
> but I find it's a bit less convenient than advertised.
> The problem is that the class isn't documented, and
> that's a serious problem if you take raw pointers.
>
> I found out that a value_semantic object was being
> desroyed by a shared_ptr<value_semantic> dtor, even
> though I had passed the address of a local object.

This usage was never intended, and docs should say this.

> Besides the fact that it's undocumented, shouldn't it
> take a shared_ptr<value_semantic> in the first place?
> The orginal owner miught like to keep a pointer to
> the object as well.

Why? Can you explain what are you trying to do?

>
> ( I'm porting Wave to boost 1.32, so I'm not writing the
> program_options code from scratch.

Porting to 1.32? I though it works with 1.32 already...

> Even so, I found the
> documentation under par - wouldn't use it myself. For
> instance, the 'overview' section talks a lot about
> the value_semantic class but uses the value<T> class. )

There's no 'value<T>' class! There's value<T> *function* which produces
instances of class derived from 'value_semantic<T>'.

- Volodya


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