Boost logo

Boost :

From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-05-21 09:46:52

"Peter Dimov" <pdimov_at_[hidden]> writes:

> Markus Schöpflin:
>> Anthony Williams wrote:
>>> Could you try adding the following overload of the thread constructor
>>> to boost/thread/pthread/thread.hpp
>>> template <class T,class R,class P1,class A1>
>>> thread(R (T::*f)(P1),A1 a1):
>>> thread_info(make_thread_info(boost::bind<void>(boost::mem_fn(f),a1)))
>>> {
>>> start_thread();
>>> }
>>> If that makes the problem go away, I'll commit the change.
>> I tried, but the compiler prefers the other constructor when resolving the
>> overload, so the error persists.
> Try
> template <class T, class R, class A1>
> thread(R (T::*f)(),A1 a1):
> without the P1.

Oops. I was too quick off the mark, and forgot that the first argument
was the "this" pointer.

> This would only work for no-argument non-const member
> functions though. More overloads are needed to cover all cases. I'll think
> about fixing that somehow on the bind side.

Shall I hold off committing a fix to boost::thread for now, then?

> A more systematic thread::thread
> test that covers all possibilities would be nice to have.

I've updates test_thread_launching to cover more options


Anthony Williams            | Just Software Solutions Ltd
Custom Software Development |
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Boost list run by bdawes at, gregod at, cpdaniel at, john at