Boost logo

Boost Users :

Subject: Re: [Boost-users] [lambda] Initializing a std::list of unsigned short points
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-10-12 17:49:53


> std::generate(m_list.begin(), m_list.end(),
> bl::bind(bl::new_ptr<unsigned short>(), bl::var(startValue)++);
> std::for_each(m_list.begin(), m_list.end(), bl::bind(bl::delete_ptr(),
> bl::_1));
Thanks, that worked. Is there an advantage to using std::generate vs
std::for_each for the assignment?

Ryan

std::generate(m_list.begin(), m_list.end(),
bl::bind(bl::new_ptr<unsigned short>(), bl::var(startValue)++));

vs.

std::for_each(m_list.begin(), m_list.end(), bl::_1 =
bl::bind(bl::new_ptr<unsigned short>(), bl::var(startValue)++));


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