C++上級者が集まるスレ
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
800:デフォルトの名無しさん 08/08/31 22:25:51 MS-DOS、WindowsコンソールアプリならErrorLevel 801:デフォルトの名無しさん 08/08/31 22:30:09 WindowsのGUIアプリだと確か捨てられるんだよな 802:デフォルトの名無しさん 08/08/31 22:31:22 >>801 それでも欲しければ、GetExitCodeProcess 803:デフォルトの名無しさん 08/09/07 15:22:14 俺上級者。なんでも聞いて。 804:デフォルトの名無しさん 08/09/25 01:58:01 質問: gccなら一応これでやりたいことが出来るんだが #include <iostream> #include <typeinfo> template <typename X> struct wrap { X val; wrap(const X x=X()) : val(x) {} }; template <typename X> wrap<X> make_wrap(const X &x) { return wrap<X>(x);} template <typename X> void print_typeid(const wrap<X> &x, const char *name) { std::cout << "typeid(" << name << ")=" << typeid(X).name() << std::endl; } template <typename X, typename Y> struct operator_lshift { typedef typeof(X()<<Y()) result_type; }; template <typename X, typename Y> wrap<typename operator_lshift<X,Y>::result_type> //wrap<typeof(X()<<Y())> // gcc 3.4.4でinternal error operator <<(const wrap<X> &x, const wrap<Y> &y) { return make_wrap(x.val<<y.val); } int main() { wrap<short> s; wrap<long> l; wrap<int> i; print_typeid(s, "s"); print_typeid(i, "i"); print_typeid(l, "i"); print_typeid(s<<i, "s<<i"); print_typeid(l<<i, "l<<i"); }
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
5265日前に更新/170 KB
担当:undef