Typically you don't want to use large object for a key.
You might also be able to keep a
std::pair<a,>
somewhere and pass it by reference to
SomeMethod
to avoid extra construction particulary in a loop.
Are you using the whole
A
object for ordering ? If not, then maybe a better design would be to have a simpler key and a more complete value.
Generally your key should be simple and a small object and the value would have all the information. Something similar to this:
struct PairAndString
{
A first;
int second;
std::string third;
};
std::map<a_key,> myMap;