vendredi 4 mars 2022

Is there a way to limit the number of times we type template

In my cpp file, before every function I need to include the line:

template <typename T>

Is there some short hand notation so that instead of typing this before every function, I can type the statement just once for a group of functions ? Also,

I also need to include after the class name, for example:

void MyClassName<T>::setDefaultValues()

Is there some way I can group all the template functions so I don't have to repeatedly type this for each function ?

Aucun commentaire:

Enregistrer un commentaire