Boost logo

Boost Users :

From: Marc VIALA (mviala_at_[hidden])
Date: 2006-01-24 03:30:48


Thanks a lot... and I'm sorry to have not seen the args mismatch in your
first mail.

With this explicit cast, the bind function compiles.

Thanks for your help.

Marc Viala
mailto:mviala_at_[hidden]

-----Message d'origine-----
De : boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] De la part de Rene Rivera
Envoyé : lundi 23 janvier 2006 20:40
À : boost-users_at_[hidden]
Objet : Re: [Boost-users] [Boost][Bind] How to bind template function member

Marc VIALA wrote:
> Thanks for your help, but...
>
> boost::function<void (void)> pg = boost::bind((void(X::*)(int,int))&X::g,
> &x, a, b) ;
>
> Oups, with the correction same result, compilation failed, but not with
the
> same first message error: " can't convert 'overloaded-function' in 'void
> (__thiscall X::* )(int,int)' " now?

Oops, I read you example more clearly now. The arg types don't match, it
should be a cast to (void (X::*)(int&,int&)).

> Could you give some feedbacks about the reason of the compilation failure?
> Is this due to some restrictions on VC++ 7.1?

I'm not sure where the restriction is, just that it works. I think VC8
handles the specialization syntax correctly. Be gald you are only
getting a compile error. I tried doing something slightly more
complicated recently and got an ICE with VC71, but not with VC8. Doing
the cast gives the compiler the context it needs to decide on which
overload to use.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users

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