Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-04-23 19:40:01


On Wednesday 23 April 2003 01:39 pm, David Abrahams wrote:
> 1. Why can't I find a regular html version of the any docs in my CVS
> checkout somewhere? Is this the effect of the new doc system? Not
> too happy about that!

We don't yet have an adequate solution for this (obviously). Putting the HTML
directly into CVS could cause the CVS repository to grow monstrous, unless
someone wants to cook up an easy way to get rid of old versions (there is a
cvs admin command for this, but I haven't tried it). We could also build the
documentation nightly on sourceforge, if we free up some space.

Ideas welcome.

>
> 2. Consider:
>
> template<typename ValueType> ValueType any_cast(const any & operand);
> template<typename ValueType> const ValueType * any_cast(const any *
> operand); template<typename ValueType> ValueType * any_cast(any * operand);
>
> Description
>
> Returns: If passed a pointer, it returns a similarly qualified pointer
> to the value content if successful, otherwise null is returned. If
> passed a value or reference, it returns a copy of the value content if
> successful.
>
> When this says "passed", does it mean as an explicit template
> argument or as a function argument?
>
> I surmise it's the former, but IMO it badly needs to be clarified.

The latter, actually. If you pass a "cv any*", you'll get back a "cv
ValueType*" (may be NULL); if you pass a value/reference, you get back a
copy.

> If it's the former, the doc is inconsistent with the signature.
>
> Clearly
>
> any_cast<X&>(y);
>
> cannot return a copy of the value content, since it returns an X&.

That's not currently supported, unfortunately, but Kevlin has expressed
interest in making it work (it just hasn't been done portably yet).

        Doug


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