How to create a template template

I have a 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 create a comparison structure. How do I get the value on line 121?

+2


source to share


2 answers


You probably want a pattern before comparing:



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

      

+6


source


Oh I think you need:



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

      

+1


source







All Articles