【C++】template 統合スレ -- Part6
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
800:デフォルトの名無しさん 05/08/07 16:48:53 template<class A> struct Foo { template<class B> struct Bar { }; }; このBarだけを特殊化するのって、GCCでは template<>template<> struct Foo<int>::Bar<int> って書かなきゃならないんだね。 VC++7.1では template<> struct Foo<int>::Bar<int> で通るんだけど、これはバグなのかな? 801:デフォルトの名無しさん 05/08/07 16:55:26 >>800 どっちが規格に準じてるかによるね 802:デフォルトの名無しさん 05/08/07 17:00:26 >>800 14.7.3.17 より "If the declaration of an explicit specialization for such a member appears in namespace scope, the member declaration shall be preceded by a template<> for each enclosing class template that is explicitly specialized." template<> template<> ... と繰り返すのが正解っぽい。
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
5384日前に更新/262 KB
担当:undef