samedi 29 juillet 2017

how to use unnamed non-type parameters for a template

I am reading a text book on meta programming. It mentions that typically non-type template parameters should named as UPPERCASE, and this could result in naming conflict with macro names. One way to resolve this is to avoid naming the non-type template as illustrated below. My question, if the parameter does not have a name, how can it be used in the coding? Would I just use a literal in its place?

example:

template <typename A, bool = false>
class test

Aucun commentaire:

Enregistrer un commentaire