I'm a little new to maps (and c programming in general) and am trying to insert some values into a map that takes a string
as a key, and a paired <double,double>
as the corresponding values.
When I try and compile the code, I am presented with the error:
error: expected primary-expression before ‘,’ token
values.insert(make_pair(string, pair<double,double>("test", 0.123456,0.98765 ) ) );
^
std::map<std::string, std::pair<double, double> > values;
values.insert(make_pair(string, pair<double,double>("test", 0.123456,0.98765 ) ) );
Do I need to utilise the iterator type in order to do this? Otherwise I have a feeling it's how I have structured this: "test", 0.123456,0.98765
.