Boost logo

Boost :

From: Michael Goldshteyn (mgoldshteyn_at_[hidden])
Date: 2005-03-23 10:01:51


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.
Thanks,
Michael Goldshteyn

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