Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-11-30 14:48:51


Chris Goller wrote:

> Sadly, the same problem: works with msvc 7.1 put not intel 9.0:
>
> error: more than one instance of overloaded function "mem_fn" matches
> the argument list:
> function template "boost::mem_fn(R (T::*)() const)"
> function template "boost::mem_fn(R (T::*)())"
> argument types are: (<unknown-type>)
>
>
> This problem initially came up when I was using boost::bind in this
> way:
>
> make_transform_iterator(v.begin(), bind(&array_type::at, _1, 0))

This is a bug in MSVC 7.1, I guess. You need to disambiguate:

array_type::reference (array_type::* pmf) (array_type::size_type) =
&array_type::at;

make_transform_iterator( v.begin(), bind(pmf, _1, 0) );

Unfortunately, there is no way to tell from bind(&array_type::at, _1, 0)
whether you need the const or non-const overload, and it is not possible to
somehow store both overloads for later use.


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