jeudi 1 avril 2021

C++: Way around dependent templates

I have a class template like this:

    template <typename T1, typename T2>
    class ClassName {
        // Members variables and Functions based on the template parameter types
    };

(T1, T2) can either be (class A, class B) or (class C, class D) only. So, T1 alone is enough to determine T2. Is there any way to only take T1 as a parameter and write the same class? If yes, how?

Aucun commentaire:

Enregistrer un commentaire