mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-15 03:45:30 +07:00
fix fixed_function deduction guides
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user