开发者

how to instantiate template of template

I have template that looks like this:

100 template<size_t A0, size_t A1, size_t A2, size_t A3>
101 struct mask {
103     template<size_t B0, size_t B1, size_t B2, size_t B3>
104     struct compare {
105         static const bool value = (A0 == B0 && A1 == B1 && A2 == B2 &开发者_JAVA技巧amp;& A3 == B3);
106     };
107 };
...
120 const typename boost::enable_if_c<
121 mask<a,b,c,d>::compare<2,3,0,1>::value || ...>::type

I am trying to instantiate compare structure. How do I do get value in line 121?


You probably need template before compare:

120 const typename boost::enable_if_c<
121 mask<a,b,c,d>::template compare<2,3,0,1>::value || ...>::type


Oh, I think you need:

const typename boost::enable_if_c< __typename__ mask<a,b,c,d>::compare<2,3,0,1>::value || ...>::type
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜