vendredi 18 juin 2021

Is it possible to specialize part of traits class

Suppose I have a traits structure:

template<typename T>
struct FooTraits {
    typedef typename T* Pointer;
    typedef typename size_t Index;  
};

Now I want to specialize only the Index trait for some type X and I want the Pointer trait for that same type to use the general traits structure.

How is that done?

Aucun commentaire:

Enregistrer un commentaire