signal: treat function-ref signals as if they were std::function
This commit is contained in:
parent
837b948435
commit
47d0e69b46
11
signal.hpp
11
signal.hpp
@ -189,6 +189,17 @@ namespace cruft {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------------
|
||||||
|
// Function references are _actually_ used as if they are std::function
|
||||||
|
// objects in our libraries.
|
||||||
|
//
|
||||||
|
// TODO: avoid this implicit conversion without need a massive rewrite.
|
||||||
|
template <typename ReturnT, typename ...ArgsT>
|
||||||
|
class signal<ReturnT(ArgsT...)> :
|
||||||
|
public signal<std::function<ReturnT(ArgsT...)>>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// wrap a value in a signal and trigger on assignment
|
// wrap a value in a signal and trigger on assignment
|
||||||
//template <typename T, template <typename> class ReductionT>
|
//template <typename T, template <typename> class ReductionT>
|
||||||
|
Loading…
Reference in New Issue
Block a user