|
Boost Users : |
From: ClassyK_Danad (classyk_at_[hidden])
Date: 2006-11-09 00:07:40
only boost::any_cast<double> can work..
"ClassyK_Danad" <classyk_at_[hidden]> ???? news:eiu90m$48t$1_at_sea.gmane.org...
> #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