A
anonymous
I have a function that returns a map<string, vector<int> >.
Inside the function I load the map with this instruction:
loc_map["hello"].push_back(1);
I would like to remove the output data structure and to use a template
function with iterators.
My idea is to use an iterator in this way:
template <class Out>
void my_fun( Out m ) {...}
and call the function:
my_fun(back_inserter(my_map));
My problem is: Is it possible to write the instruction
loc_map["hello"].push_back(1); using the parameter m?
Thanks
Inside the function I load the map with this instruction:
loc_map["hello"].push_back(1);
I would like to remove the output data structure and to use a template
function with iterators.
My idea is to use an iterator in this way:
template <class Out>
void my_fun( Out m ) {...}
and call the function:
my_fun(back_inserter(my_map));
My problem is: Is it possible to write the instruction
loc_map["hello"].push_back(1); using the parameter m?
Thanks