Boost logo

Boost Users :

Subject: [Boost-users] phoenix for_each and std::cout
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2009-03-22 21:05:00


Hi,
 I am trying to use phoenix::for_each to print each element of
iterator range. Would appreciate if any clarification as to why
statements 1 and 2 are giving compile errors.

Thanks
sandeep

//-------------code snippet

int x;
counting_iterator<int> first(0), last(10);
iterator_range<counting_iterator<int> > ir(first, last);
phoenix::for_each(ir, std::cout<<x<<' ')();
  //stmt 1 ; compile error
phoenix::for_each(ir, std::cout<<arg1<<' ')();
//stmt 2; compile error


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net