C++相談室 part45
レス数が900を超えています。1000を超えると表示できなくなるよ。
0911デフォルトの名無しさん
2006/01/04(水) 20:12:28仕様なら、綺麗な回避方法はあるでしょうか。
(typeを一緒にテンプレートパラメータとして渡すとか位?)
コンパイラはcygwinのgcc3.4.4です。
コード-----------------------------------------
template <class T>
struct foo {
typedef typename T::type type;
};
template <class T>
struct goo : foo<goo<T> > {
typedef T type;
};
main() {
goo<int>::type t;
}
コンパイル結果---------------------------------------------
test.cpp: In instantiation of `foo<goo<int> >':
test.cpp:8: instantiated from `goo<int>'
test.cpp:13: instantiated from here
test.cpp:4: error: no type named `type' in `struct goo<int>'
レス数が900を超えています。1000を超えると表示できなくなるよ。