
9 Jun
2011
9 Jun
'11
7:26 p.m.
On Thu, Jun 9, 2011 at 9:21 PM, Stewart, Robert <Robert.Stewart@sig.com> wrote:
std::vector< int > v{ 1, 2, 3 }; auto it = std::find( v.begin(), v.end(), 2 );
But Boost.Range provides "less flexible" solution:
std::vector< int > v{ 1, 2, 3 }; auto it = boost::range::find( v, 2 );
IMO, this solution is much easier and safer, but less flexible.
Since I suggested iterators and ranges as the interface, and your examples implied neither, I fail to understand how your answer actually bears on my suggestion. Does your interface support ranges without your having shown it? Is there output iterator support?
I assume it's pretty easy to provide both APIs. Olaf