Rothbard
asked on
Question about BOOST_FOREACH
Suppose I have a std::vector of double called myVec, and a std::map of type <int, double> called myMap. Why is it that the following works
BOOST_FOREACH(double x, myVec) x = 10.0;
and the following gives an errorBOOST_FOREACH(pair<int,double> y, myMap)
cout << y.first << "\t" << y.second << endl;
so that I need to usepair<int,double> y;
BOOST_FOREACH(y, myMap) cout << y.first << "\t" << y.second << endl;
instead?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.