Support arbitrary return type in closure for member function pointer.
This commit is contained in:
parent
020f08438f
commit
195e1cb2ad
|
@ -213,11 +213,11 @@ _detail::ClosureBase* NewClosure(
|
||||||
return NewClosure(sender, signal, boost::bind(callback, args...));
|
return NewClosure(sender, signal, boost::bind(callback, args...));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename... Args>
|
template <typename T, typename Unused, typename... Args>
|
||||||
_detail::ClosureBase* NewClosure(
|
_detail::ClosureBase* NewClosure(
|
||||||
QObject* sender,
|
QObject* sender,
|
||||||
const char* signal,
|
const char* signal,
|
||||||
T* receiver, void (T::*callback)(Args...),
|
T* receiver, Unused (T::*callback)(Args...),
|
||||||
const Args&... args) {
|
const Args&... args) {
|
||||||
return NewClosure(sender, signal, boost::bind(callback, receiver, args...));
|
return NewClosure(sender, signal, boost::bind(callback, receiver, args...));
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,8 +107,9 @@ namespace {
|
||||||
class Bar {
|
class Bar {
|
||||||
public:
|
public:
|
||||||
explicit Bar(int a) : foo_(a) {}
|
explicit Bar(int a) : foo_(a) {}
|
||||||
void Foo(int* answer) {
|
bool Foo(int* answer) {
|
||||||
*answer = foo_;
|
*answer = foo_;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue