#include "any_stream.hpp" #include #include struct CB { typedef void RET; std::ostream &m_r; CB(std::ostream &_r) :m_r(_r) { } void operator()(const std::string &_r) const { m_r << "string(" << _r << ")"; } void operator()(void) const { m_r << "void"; } }; int main(int argc, char **argv) { boost::any sAny; sAny = std::string("test"); CB sCB(std::cout); sAny.apply(sCB); return 0; }