There is a default value for Less
provided and it is the type xless<Key>
. So if you do not provide the third parameter you will be using xless<string>
(in your case).
c++ template class clarification
Вопрос
How come I could use the template class 'listmap' in this fashion.
In which, I could typedef listmap in .
typedef listmap<string,string> str_str_map;
The template of listmap is the following.
template <typename Key, typename Value, class Less=xless<Key>>
class listmap
I could see the strings are the correspondence to typename key, and typename value, but why is class Less not needed in the typedef?
Решение
Не связан с StackOverflow