Boost logo

Boost Users :

From: ClassyK_Danad (classyk_at_[hidden])
Date: 2006-11-08 22:58:08


#include <iostream>
#include <boost/any.hpp>

template<typename A, typename B>
boost::any min(const A& a,const B& b)
{
    return a < b ? a : b;
}

void main()
{
 //got a bad_any_cast exception !
 std::cout << boost::any_cast<int>( min( 1, 1.1)) << std::endl;
}

how could this happen?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net