From: Stefan Slapeta (stefan_at_[hidden])
Date: 2003-05-06 09:41:07


Hi everybody,

at the moment, there are 3 versions of any_cast:

    template<typename ValueType> ValueType * any_cast(any * operand);

    template<typename ValueType> const ValueType * any_cast(const any *
operand);

    template<typename ValueType> ValueType any_cast(const any & operand);

The last of these returns its content per value and is the only one which
throws bad_any_cast;

I propose to add a new any_ref_cast

    template<typename ValueType> ValueType & any_ref_cast(any & operand);

    template<typename ValueType> const ValueType & any_ref_cast(const any &
operand);

which should also throw but does not make copies of any's content.

What do you think?

Regards,

Stefan