Re: [cpp] 嵌套模板的使用问题
qiaojie
qiaojie at gmail.com
Wed Dec 6 11:19:44 CST 2006
他这是学Lisp啊
在06-12-6,Chen Shuo <giantchen at gmail.com> 写道:
>
> typedef vector<pair<pair<pair<T1, T2>, T3>, T4> >::iterator itePair;
> 改为:
> typedef typename vector<pair<pair<pair<T1, T2>, T3>, T4> >::iterator
> itePair;
>
> 另外,你为什么不用一个struct,而要用一堆的pair?
> On 12/6/06, 苏亚 <su1981ya at 163.com> wrote:
> > 模板中使用嵌套:
> > template<typename T1, typename T2, typename T3, typename T4>
> > class InferenceData
> > {
> > typedef vector<pair<pair<pair<T1, T2>, T3>, T4> > VecPair;
> > typedef vector<pair<pair<pair<T1, T2>, T3>, T4> >::iterator itePair;
> > }
> >
> > 编译出错:
> > type `std::vector<std::pair<std::pair<std::pair<_T1, _T2>, T3>, T4>,
> > std::allocator<std::pair<std::pair<std::pair<_T1, _T2>, T3>, T4> > >' is
> > not derived from type `InferenceData<T1, T2, T3, T4>'
> >
> > 不知什么问题?
> >
> > _______________________________________________
> > Cpp mailing list
> > Cpp at codingnow.com
> > http://codingnow.com/mailman/listinfo/cpp
> >
>
> _______________________________________________
> Cpp mailing list
> Cpp at codingnow.com
> http://codingnow.com/mailman/listinfo/cpp
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://codingnow.com/pipermail/cpp/attachments/20061206/634e45e4/attachment.html
More information about the Cpp
mailing list