|
@@ -148,7 +148,9 @@ public:
|
|
|
using result_type = Ret;
|
|
|
|
|
|
private:
|
|
|
- char _data[sizeof(void*) * 2];
|
|
|
+ static constexpr std::size_t STACK_ALLOCATED_SIZE = 12;
|
|
|
+
|
|
|
+ char _data[STACK_ALLOCATED_SIZE];
|
|
|
using fb_t = __inner::_function_base<Ret, Args...>;
|
|
|
constexpr fb_t* _f(void) const
|
|
|
{
|
|
@@ -181,7 +183,7 @@ public:
|
|
|
Ret,
|
|
|
decltype(std::declval<std::decay_t<FuncLike>>()(std::declval<Args>()...))
|
|
|
>
|
|
|
- && (sizeof(std::decay_t<FuncLike>) <= sizeof(_data))
|
|
|
+ && (sizeof(std::decay_t<FuncLike>) <= STACK_ALLOCATED_SIZE - sizeof(void*))
|
|
|
&& !std::is_same_v<std::decay_t<FuncLike>, function>
|
|
|
, bool> = true
|
|
|
>
|