|
Boost : |
From: Karl Mutch (karlmutc_at_[hidden])
Date: 2003-12-18 21:58:40
Strangely something that used to work in 1.29 now does not in 1.30.2?
Having switched to Microsoft Visual C++ 7.1 the following code that uses
member functions fails which used to work on Visual C++ 6.0 SP4 and 1.29.
This is specific to operator () member functions. Named member functions
and also operator methods such as "operator bool ()" or "operator ++ ()"
work. Could be a compiler issue?
class X
{
public:
void operator () () {}
void operator ++ () {}
void test ()
{
// Works
boost::thread thread_works(boost::bind(&X::operator (), this));
boost::scoped_ptr<boost::thread> thread_fails(new boost::thread(
boost::bind(&X::operator ++, this)));
// Fails with
// error C2059: syntax error : ')'
// error C2143: syntax error : missing ')' before ';'
boost::scoped_ptr<boost::thread> thread_fails(new boost::thread(
boost::bind(&X::operator (), this)));
}
};
Any ideas from people? Better than adding wrappers?
Thanks
Karl
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk