This is wrong:
multimap < u_int32_t, u_int32_t,string> lines;
The template parameters for multimap
are listed at en.cppreference.com:
template<
class Key,
class T,
class Compare = std::less<Key>,
class Allocator = std::allocator<std::pair<const Key, T> >
> class multimap;
The first template parameter is the key, the second is the type stored, and the third is the comparator.
You have specified std::string
as the comparator. Clearly this won't do what you want, and I'm somewhat suprised this even compiles. basic_string
does have an operator<
-- that must be why it compiles.
I think you are confused as to what multimap
really is. multimap
is not something that can be used to map between a key and one of mopre different kinds of values. multimap
is the same as map
in that it maps between a single key and a value, except the difference is that with multimap
you can have more than just one value mapped to a single key.