RE: [Boost-Users] Iterator adapters and maps
I think the problem is in the definition of Select2ndRef; if you use: template<class pair_type> struct Select2ndRef { typedef pair_type argument_type; typedef typename pair_type::second_type result_type; result_type & operator()(pair_type & source) const { return source.second; } }; then your code will compile. This has to do with an unusual meaning of "result_type" for projection iterator adaptors. -Steve
scleary@jerviswebb.com wrote:
I think the problem is in the definition of Select2ndRef; if you use: template<class pair_type> struct Select2ndRef { typedef pair_type argument_type; typedef typename pair_type::second_type result_type;
result_type & operator()(pair_type & source) const { return source.second; } }; then your code will compile.
This has to do with an unusual meaning of "result_type" for projection iterator adaptors.
Excellent, that seems to work fine. I've renamed Select2ndRef as Project2nd for use in such cases in the future <g> -- AlisdairM
participants (2)
-
Alisdair Meredith
-
sclearyï¼ jerviswebb.com