Question

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?

Was it helpful?

Solution

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top