mirror of
https://github.com/matrix-construct/construct
synced 2024-06-16 08:58:20 +02:00
ircd::util::returns: Eliminate std::function w/ template lambda.
This commit is contained in:
parent
364f7d9c3e
commit
6b62fb1fe6
|
@ -37,7 +37,9 @@ struct ircd::util::returns
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
returns(const std::function<T ()> &func)
|
template<class F>
|
||||||
|
returns(F&& func,
|
||||||
|
typename std::enable_if<std::is_invocable_r<T, F>::value, int>::type = 0)
|
||||||
:ret{func()}
|
:ret{func()}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue