10 static constexpr bool isLarge =
sizeof(Obj) > Obj::smallObjSize ||
alignof(Obj) >
alignof(std::max_align_t)
13 template <
class Obj,
class... Args>
15 constructImpl(
void* to, Args&&... args)
noexcept(std::is_nothrow_constructible_v<Obj, Args...>) {
16 if constexpr (isLarge<Obj>) {
17 return ::new Obj(std::forward<Args>(args)...);
19 return ::new (to) Obj(std::forward<Args>(args)...);
23 static constexpr void destroyImpl(Obj* self)
noexcept {
24 if constexpr (isLarge<Obj>) {
39 virtual AnyObjBase* move(
void* to)
noexcept = 0;
40 virtual void tidy()
noexcept = 0;