Do you mean something like this?
std::set<double> &prices = exPricesData[exchange]; //returns existing value, or inserts a new one if key is not yet in map
prices.insert(lastprice.begin(), lastprice.end());
Oh, and be careful when using a std::set<double>
. If the numbers are the result of computation, numerical inaccuracies can result in distinct members of the set where you don't expect them.