I have the following structures

```
struct Obj
{
  int a;
  int b;
};
class ObjCollection
{
   map<int,Obj> collMap;
 public:
   string getCsvA();
   string getCsvB();
};

```

`getCsvA` returns a csv of all the `a` values in the objects of `collMap`. `getCsvB` returns the same for all the `b` values.

Is there a way I can template this function? The reason it becomes complicated for me is that i cannot pass the address of which member i want to generate the csv for, from outside this class ie from my client code. Is there a way to do this?
Note: I can not use C++11.