mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02:00
ircd::util::returns: Eliminate std::function w/ template lambda.
This commit is contained in:
parent
364f7d9c3e
commit
6b62fb1fe6
1 changed files with 3 additions and 1 deletions
|
@ -37,7 +37,9 @@ struct ircd::util::returns
|
|||
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()}
|
||||
{}
|
||||
|
||||
|
|
Loading…
Reference in a new issue