mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-29 02:29:56 +01:00
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...));
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
template <typename T, typename Unused, typename... Args>
|
||||
_detail::ClosureBase* NewClosure(
|
||||
QObject* sender,
|
||||
const char* signal,
|
||||
T* receiver, void (T::*callback)(Args...),
|
||||
T* receiver, Unused (T::*callback)(Args...),
|
||||
const Args&... args) {
|
||||
return NewClosure(sender, signal, boost::bind(callback, receiver, args...));
|
||||
}
|
||||
|
@ -107,8 +107,9 @@ namespace {
|
||||
class Bar {
|
||||
public:
|
||||
explicit Bar(int a) : foo_(a) {}
|
||||
void Foo(int* answer) {
|
||||
bool Foo(int* answer) {
|
||||
*answer = foo_;
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user