【初心者歓迎】C/C++室 Ver.46【環境依存OK】
at TECH
103:デフォルトの名無しさん
07/12/31 04:10:07
>>102
ありがとうございます。
typenameをつけたら希望どおりの動作になりましたが、その後、
エラーメッセージを張ったら、実はそこに書いてありました。
$ g++ samp20.cpp
samp20.cpp: In function 'void show(T&)':
samp20.cpp:9: error: expected `;' before 'p'
samp20.cpp:10: error: 'p' was not declared in this scope
samp20.cpp: In function 'void show(T&) [with T = std::list<int, std::allocator<int> >]':
samp20.cpp:23: instantiated from here
samp20.cpp:9: error: dependent-name 'T::iterator' is parsed as a non-type, but instantiation yields a type
samp20.cpp:9: note: say 'typename T::iterator' if a type is meant
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4254日前に更新/166 KB
担当:undef