| 89 | } |
| 90 | |
| 91 | static constexpr vtable make_vtable() noexcept { |
| 92 | void (*move_destroy_fn)(void* src, void* dst) noexcept = nullptr; |
| 93 | void (*destroy_fn)(void* target) noexcept = nullptr; |
| 94 | |
| 95 | if constexpr (std::is_trivially_copy_constructible_v<callable_type> && std::is_trivially_destructible_v<callable_type> && |
| 96 | is_inlinable()) { |
| 97 | move_destroy_fn = nullptr; |
| 98 | } else { |
| 99 | move_destroy_fn = move_destroy; |
| 100 | } |
| 101 | |
| 102 | if constexpr (std::is_trivially_destructible_v<callable_type> && is_inlinable()) { |
| 103 | destroy_fn = nullptr; |
| 104 | } else { |
| 105 | destroy_fn = destroy; |
| 106 | } |
| 107 | |
| 108 | return vtable(move_destroy_fn, execute_destroy, destroy_fn); |
| 109 | } |
| 110 | |
| 111 | template<class passed_callable_type> |
| 112 | static void build_inlinable(void* dst, passed_callable_type&& callable) { |