[Libreoffice] [REVIEW] Fix for fdo#37226

Noel Power nopower at novell.com
Wed May 18 07:12:08 PDT 2011


Hi Kohei
On 18/05/11 12:52, Kohei Yoshida wrote:
> On Wed, 2011-05-18 at 12:08 +0100, Noel Power wrote:
[...]
> So, we (Rafael, Norbert, Joseph and I) talked about this last night on
> IRC, and one question raised was whether or not boost::bind allows
> pointers to data members rather than member functions.  The
> documentation clearly mentions of members functions, but is a bit
> ambiguous with data members.
aha, you know I didn't even notice that it was dealing with member 
variables instead of member functions :-))))
>   In fact, the standard function adapters
> that boost::bind wraps seems to only support member functions which made
> me believe that the use of bind with data members is not allowed and
> that if it works with some compilers it's just by accident and is not
> really guaranteed with different compilers.
>
> Having said that, if boost::bind is guaranteed to work with data
> members, then I prefer keeping that piece in&  prefer your patch over
> mine.  Otherwise, I'd rather we don't use it with data members.
the way I see it is that member function pointers and member data 
pointers ( I never even heard of those before ) are different, just some 
experimentation with some simple test code shows you can't exchange 
them. Since boost is heavily templatized ( and hence quite type-safe ) 
it would seem to be certain that there is some overloading in the 
boost::bind implementation to ensure that pointer to member mojo is 
supported. In otherwords I would expect compile time failures rather 
than runtime ones. Of course you are right to ask do all compilers 
support this, but I guess since we know of no failures sofar we can say 
for certain that the compilers and platforms we care about cater for this.

Anyway +1 from me regardless of which version of the patch ( really 
referring the patch I attached as *mine* is rich ;-)  I only omitted 
some changes you did )

Noel

p.s. I tried to have a quick look at the boost headers to see if I could 
confirm any of my suspicions... the feeling of getting my brains sucked 
out of my head was too much and I had to look away ( that stuff is far 
to complicated for me )


More information about the LibreOffice mailing list