I am confused as to how to get the elements in the set. I think I have to use the iterator but how do I step through it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Replace
typewith, for example,int.. Andvarwith the name of the setThe best way though is to use boost::foreach. The code above would simply become:
You can also do
#define foreach BOOST_FOREACHso that you can do this:For example: