I want to define a std::map with key as std::pair<std::string, std::string> something like follow
typedef std::map< std::pair<std::string, std::string>, std::string> my_map
Is this allowed, and how do i write comparasion operator for such map.
I want to define a std::map with key as std::pair<std::string, std::string> something like follow
typedef std::map< std::pair<std::string, std::string>, std::string> my_map
Is this allowed, and how do i write comparasion operator for such map.
Yes, it is allowed.
std::pair already has an operator< which compares the two values in order, so you may not need to do anything special for a comparator at all.