mardi 13 août 2019

What does void mean, or how does it affect T in this case?

So I was doing some work with a friend of mine in C++, and we came across this in the documentation.

//(until C++14)
template<class T>
struct less;

//(since C++14)
template<class T = void>
struct less;

Now I know how it works with class T = int and the same for double and float and other types of classes. But the part I am very confused about, is how does void act in this case? And what are the limitations by using void?

I'm asking this because the C++ documentation is very helpful nor can I find anywhere else that explains it.

Aucun commentaire:

Enregistrer un commentaire