views:

109

answers:

2

hello

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 && 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?

+1  A: 

Oh, I think you need:

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

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
Tomek
actually tried it before, however overlooked stray (. But now it compiles, thanks.
aaa