9 Mar
2013
9 Mar
'13
7:34 a.m.
2013/3/8 Niitsuma Hirotaka
There are two type is_foo_type functor For example is_double can be
--------- template<typename T> struct is_double_template : boost::is_same
{}; --------- or
--------- struct is_double_runtime { template<typename T> bool operator()(T x){return false;} bool operator()(double x){return true;} };
Why don't you just use BOOST_TYPEOF(x) macro?
T d;
std::cout << is_double<T>::value << std::endl;
std::cout << is_double