signal: treat function-ref signals as if they were std::function

This commit is contained in:
Danny Robson 2020-07-21 15:01:33 +10:00
parent 837b948435
commit 47d0e69b46

View File

@ -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>