priority queue and boost foreach

Oct 19, 2010 at 7:46pm
is there any reason why a priority queue wouldn't work with BOOST_FOREACH.

I have a function declared like this:
 
void load_asn_data(priority_queue<mc::ASN>& queue,view::DataGrid * grid);


inside I try and iterate over the queue like this:
1
2
3
BOOST_FOREACH(mc::ASN & current, queue){
  do_something();
}



I'm getting a ton of errors that don't make sense. I do this all the time with vectors and lists, but this is the first time I've tried a priority queue. Do they not work correctly with BOOST_FOREACH?
Oct 28, 2010 at 11:44am
Unfortunately you cannot iterate trough priority queue. BOOST_FOREACH requires that.
Topic archived. No new replies allowed.