0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-23 21:33:44 +02:00

ircd::util::returns: Eliminate std::function w/ template lambda.

This commit is contained in:
Jason Volk 2023-02-21 18:23:45 -08:00
parent 364f7d9c3e
commit 6b62fb1fe6

View file

@ -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()}
{}