0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 19:28:52 +02:00

ircd::util: Propagate closure noexcept through template.

This commit is contained in:
Jason Volk 2022-06-25 13:38:30 -07:00
parent a0071c7956
commit 888f99e205

View file

@ -65,11 +65,13 @@ struct ircd::util::closure<F, bool, A...>
template<class lambda>
closure(lambda &&o,
typename std::enable_if<!std::is_constructible<func_bool_type, lambda>::value, int>::type = 0) noexcept;
typename std::enable_if<!std::is_constructible<func_bool_type, lambda>::value, int>::type = 0)
noexcept(std::is_nothrow_invocable<lambda, void, A...>());
template<class lambda>
closure(lambda &&o,
typename std::enable_if<std::is_constructible<func_bool_type, lambda>::value, int>::type = 0) noexcept;
typename std::enable_if<std::is_constructible<func_bool_type, lambda>::value, int>::type = 0)
noexcept(std::is_nothrow_invocable<lambda, bool, A...>());
};
template<template<class, class...>
@ -80,10 +82,11 @@ template<class lambda>
inline
ircd::util::closure<F, bool, A...>::closure(lambda &&o,
typename std::enable_if<!std::is_constructible<func_bool_type, lambda>::value, int>::type)
noexcept
noexcept(std::is_nothrow_invocable<lambda, void, A...>())
:F<bool (A...)>
{
[o(std::move(o))](A&&... a)
noexcept(std::is_nothrow_invocable<lambda, void, A...>())
{
static_assert
(
@ -104,7 +107,7 @@ template<class lambda>
inline
ircd::util::closure<F, bool, A...>::closure(lambda &&o,
typename std::enable_if<std::is_constructible<func_bool_type, lambda>::value, int>::type)
noexcept
noexcept(std::is_nothrow_invocable<lambda, bool, A...>())
:F<bool (A...)>
{
std::forward<lambda>(o)