mercredi 18 mars 2015

What does "typename =" mean in the template parameters?


I have seen this expression in page 189 of the book "Effective Modern C++":



template<typename T,
typename = typename std::enable_if<condition>::type>
explicit Person(T&& n);


I am just wondering what does the part "typename =" mean. It certainly looks like a default argument for a template parameter. But don't you need something like "typename some_name = ..." in a default argument? There is no name for the second template argument, and I don't see the second template argument being used in this case.


P.S. When I search on google (or any other search engine) for an answer, the equal sign is always discarded, and this just makes finding an answer almost impossible...




Aucun commentaire:

Enregistrer un commentaire