fix fixed_function deduction guides

This commit is contained in:
BlackMATov
2022-02-06 12:08:45 +07:00
parent 65b30fdbc2
commit 33faf7f5f2
2 changed files with 21 additions and 10 deletions

View File

@@ -178,17 +178,23 @@ namespace meta_hpp::detail
template < typename F >
struct strip_signature_impl;
template < typename R, typename C, bool NoExcept, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) noexcept(NoExcept)> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...)> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) const> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) &> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) const &> { using type = R(Args...); };
template < typename R, typename C, bool NoExcept, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) const noexcept(NoExcept)> { using type = R(Args...); };
template < typename R, typename C, bool NoExcept, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) & noexcept(NoExcept)> { using type = R(Args...); };
template < typename R, typename C, bool NoExcept, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) const & noexcept(NoExcept)> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) noexcept> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) const noexcept> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) & noexcept> { using type = R(Args...); };
template < typename R, typename C, typename... Args >
struct strip_signature_impl<R(C::*)(Args...) const & noexcept> { using type = R(Args...); };
template < typename F >
using strip_signature_impl_t = typename strip_signature_impl<F>::type;

View File

@@ -37,6 +37,11 @@ TEST_CASE("meta/meta_base/fixed_function") {
ff = std::move(f2);
CHECK(ff() == 2);
}
{
auto f1 = []() noexcept {return 1;};
fixed_function ff{f1};
CHECK(ff() == 1);
}
}
SUBCASE("reset") {