|
Boost : |
From: Jared McIntyre (jmcintyre_at_[hidden])
Date: 2007-05-02 00:39:24
Jared McIntyre <jmcintyre <at> dfsoftware.com> writes:
>
> Peter Dimov <pdimov <at> mmltd.net> writes:
>
> > One reason that nobody caught it is that it fails only with class/struct
> > return types. Compilers are a lot of fun.
> >
> > Not.
> >
> > Here's a minimal example that demonstrates the issue, if someone
would like
> > to take this to MS. As a regression against 7.1, it might receive
a
> > priority:
>
> Thanks for looking into this. I can submit it to them when I get in on
Monday. I
> assume you meant to put it against VS8? I only have SP1 at work, did
you
> reproduce this on the base 8.0 release?
>
> Jared
Ok, I finally have some information to report back. The issue is definitely
a bug in the VS 8 and VS 8 SP1 compilers. Microsoft is now aware of the
bug, but does not believe that they will fix it in time for the VS 9 release.
Their recommendation is to prewrap the member function in a mem_fn
call before the bind:
#include <boost/bind.hpp>
#include <boost/mem_fn.hpp>
#include <string>
class WarningTest
{
public:
WarningTest(void)
{
boost::bind(boost::mem_fn(&WarningTest::Function), this);
}
std::string Function()
{
}
};
They warn not to trust the compiler without this workaround. They didn't
have any suggestions for workarounds in the boost::bind code.
Jared
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk