Multicomponent pairs?

Is it possible for a multimap to contain pairs inside it? IE, but not defined as multimap<char,int>, for example, it will be defined as multimap<pair, pair>?

How will this multimap be sorted? In addition, how to access the individual content of each pair?

+3
source share
1 answer

Is it possible for a multi-frame to contain pairs inside it?

Yes it is possible.

How will this multimap be sorted?

Key / first pair (i.e. first the first element of the first pair, then the second element of the first pair).

Also, how would I access the individual contents of each pair?

multimap<pair <T1, T2>, pair<T3, T4> >::iterator it = mymultimap.begin();
it->first.first;
it->first.second;
it->second.first;
it->second.second;

, , !

: , , , , .

+9

Source: https://habr.com/ru/post/1751344/


All Articles