I want to create a class that will see two lists of logic lists, to see if all the logic of the first list Other things may have been added so far I have something like this:
template & lt; Typename org & gt; Class config {public: template & lt; Typename iArg & gt; Static bool check () {return std :: is_convertible & lt; IArg, OArg & gt; :: value; }}; Template & lt; Typename OArg, type name ... OArgs & gt; Class config {public: template & lt; Typename iArg, typename ... IArgs & gt; Static Bull Check () {Return OP & lt; OArg & gt; :: Check & lt; IArg & gt; () & Amp; Amp; The & lt; OArgs ... & gt; :: Check & lt; IArgs ... & gt; (); }};
I want to use it this way:
bool pass = conv & lt; Char, a_class, float & gt; :: check & lt; Float, int, b_class & gt; ();
When I compile:
recursive.cpp: 19: 7: Error: Rejected again with 2 template parameter class Conv {^ recursive. Cpp: 10: 7: Note: Previous announcement template & lt; Square org & gt; I use a class convent 1 template parameter class convocation. I have no example of any IArgs
or OArgs
in check time Any solution?
You can not overload the class templates. You can partly specialize them, but there is no need to do this here. Borrow is @ Columbo:
Template & lt; Bool ... & gt; Struct bool_pack; Template & lt; Bool ... b & gt; All_true = std :: is_same & lt; Bool_pack & lt; True, b ... & gt;, bool_pack & lt; B ..., true & gt; & Gt ;; Template & lt; Typename ... oargs & gt; Class config {public: template & lt; Typename ... IArgs & gt; Static bool check () {all_true & lt; Std :: is_convertible & lt; IArgs, OArgs & gt; :: value ... & gt; :: Values; }};
No comments:
Post a Comment