【初心者歓迎】C/C++室 Ver.72【環境依存OK】
at TECH
498:デフォルトの名無しさん
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));
的な
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4159日前に更新/255 KB
担当:undef