Always inline Allocator::construct/destroy
This commit is contained in:
parent
1af82e2e24
commit
1170277e91
|
@ -112,12 +112,14 @@ struct Allocator
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class U, class... Args>
|
template<class U, class... Args>
|
||||||
|
[[gnu::always_inline]]
|
||||||
void construct(U* p, Args&&... args)
|
void construct(U* p, Args&&... args)
|
||||||
{
|
{
|
||||||
new ((void*)p) U(std::forward<Args>(args)...);
|
new ((void*)p) U(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class U>
|
template<class U>
|
||||||
|
[[gnu::always_inline]]
|
||||||
void destroy(U* p) { p->~U(); }
|
void destroy(U* p) { p->~U(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user