[問題] class template內的class template ...
template<class T>
class A
{
public:
template<class U>
struct inner
{
typedef A<U> other;
};
T val;
};
template<class T, class U>
class B
{
public:
/* ??? */
typedef typename U::template inner<T>::other value_type;
};
int main()
{
cout << sizeof( A<int>::inner<char>::other ) << endl;
cout << sizeof( B< double, A<int> >::value_type ) << endl;
return 0;
}
/* ??? */ 下面那一行, 有人看過這種寫法嗎?
是什麼意思呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.164.87
→
05/09 17:38, , 1F
05/09 17:38, 1F
→
05/09 17:39, , 2F
05/09 17:39, 2F