Again, maybe I'm missing something, but the following seems clearer/simpler 

```
  while (it != vals.end()) {
    colss << it->first;
    valss << valAsString(it->second);
    ++it;
    colss << ", ";
    valss << ", ";
  }
```

Interested in what it is I'm missing here.