>I've got a function that i need to return two maps from.
Passing them by reference to the function would work just fine. Or if you need to create them locally and return them, try returning a pair:
Code:
#include <utility>
// Replace with a more suitable typedef
typedef map<string, int> maptype;
pair<maptype, maptype> foo()
{
maptype a;
maptype b;
// ...
return make_pair ( a, b );
}
Then you have both maps in an easily accessed location that suggests a relationship. Of course, if they are completely unrelated, a pair may be confusing to readers.