Boost logo

Boost Users :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-06-13 11:07:48


Andrej van der Zee ha escrito:

> Hi,
>
> Thanks for your fast feedback and sorry for the lack
> of information I gave you in my last email.
>
> I stripped down everything I could and found the
> problem. There are two overloaded member functions and
> somehow in a template-context, the compiler gets
> confused. Is there any way to solve this without
> renaming one of the methods?

The compiler should do this automatically without you having
to disambiguate the overload, see 14.3.2/5:

"For a non-type template-parameter of type pointer to member
function, no conversions apply. If the template-argument represents
a set of overloaded member functions, the matching member
function is selected from the set (13.4)."

> Below the stripped down version of main.cpp that
> doesn't compile.[...]

This program compiles fine with GCC 3.2 and Comeau C++ 4.3.9.
I think you've got a compiler bug, you might want to report it to

  http://gcc.gnu.org/bugzilla/

Anyway, the following might be a workaround (I don't have your
GCC version to try myself):

  mi::const_mem_fun<
    field_ts, ts_type,
    (ts_type (field_ts::*)()const)&field_ts::ts>

HTH,

Joaquín M López Muñoz
Telefónica, Inevstigación y Desarrollo


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