10/04/23 23:52:02
>>493
自分で書いておいてなかなかひどい
template<class T> T cast(typename identity<T>::type v){ return v; }と
typedef boost::mpl::eval_if<is_const<T>, identity<const int>, identity<int> >::type iint;
だな
前者はTの型の推論ができなくなる(=明示的に型を指定してほしい関数に使える)
template<class T>void f(T v);
char c;
f(cast<int>(c));
的な