core: Allow bool<std::string> callback functions

This commit is contained in:
Gabriel Ferreira
2024-04-07 14:01:27 +02:00
parent e2fa301904
commit 3005ac54ef

View File

@@ -490,8 +490,10 @@ class Callback : public CallbackBase
* of the first argument is a class derived from CallbackBase (i.e., a Callback).
*/
template <typename T,
std::enable_if_t<!std::is_base_of_v<CallbackBase, T>, int> = 0,
typename... BArgs>
typename... BArgs,
std::enable_if_t<!std::is_base_of_v<CallbackBase, T> &&
std::is_invocable_r_v<R, T, BArgs..., UArgs...>,
int> = 0>
Callback(T func, BArgs... bargs)
{
// store the function in a std::function object