$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Alexander Shyrokov (shirokov_at_[hidden])
Date: 2006-09-15 21:33:47
> template<class It, class F> void for_each_pair( It first, It last, F f )
> {
>     for( ; first != last; ++first )
>     {
>         f( first->first, first->second );
>     }
> }
> 
> for_each_pair( a.begin(), a.end(), boost::bind( f, _2 ) );
Could you explain why _2 is used? It looks like f parameter should have 
two parameters and we are using bind to use only 2nd parameter and 
ignore the first one? Is it correct?
The second question: why last is not a constant and maybe taken by 
reference? void for_each_pair( It first, const It& last, F f )
Thanks.
-- 
Regards,
     Alexander.                http://sjcomp.com