mardi 5 juillet 2016

Vector with pairs

I have written a program where I needed a hashmap with key as integer but value as pointer to a vector.

The vector contains pair of two values which are of double type.

std::vector<std::pair<double,double> > *dictionary;
dictionary=new std::vector<std::pair<double,double> >;

I tried to insert elements like this:

dictionary->push_back(std::make_pair(x,y));

But it is giving me an error 'Invalid arguments'.

What could be the problem and how should I resolve ?

Aucun commentaire:

Enregistrer un commentaire