lundi 7 septembre 2020

Is there are any differences between different typename orders in class partial specializatoin definition?

code shows as below

template<typename t1, typename t2, typename t3>
class Test {

};

and there are two kinds of partial specializatoin when specify typename t1 as bool

// 1
template<typename t5, typename t6>
class Test<bool, t5, t6> {
public:
    t5 n1;
    t6 n2;
};


// 2
template<typename t5, typename t6>
class Test<bool, t6, t5> {
public:
    t5 n1;
    t6 n2;
};

It seems that both of them work the same, Is there are any differences between different typename orders in class partial specializatoin definition ?

Aucun commentaire:

Enregistrer un commentaire