Boost logo

Boost :

From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-03-23 10:49:56


On Wed, 23 Mar 2005 09:01:51 -0600
"Michael Goldshteyn" <mgoldshteyn_at_[hidden]> wrote:

> There is a bug in the sample code which cause me a lot of grief in
> understanding how boost::any functions, this morning. At:
>
> http://www.boost.org/doc/html/any/s02.html
>
> The code:
> ---
> bool is_string(const boost::any & operand)
> {
> return any_cast<std::string>(&operand);
> }
>
> should read:
>
> bool is_string(const boost::any & operand)
> {
> return any_cast<std::string *>(&operand);
> }
> ---
>
> Notice the addition of the asterisk.

The original example looks fine to me. Why do you think it is
incorrect?


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