|
|
@ -24,14 +24,14 @@ namespace grpc_core { |
|
|
|
|
|
|
|
|
|
|
|
// Call the destructor of p without having to name the type of p.
|
|
|
|
// Call the destructor of p without having to name the type of p.
|
|
|
|
template <typename T> |
|
|
|
template <typename T> |
|
|
|
void Destruct(T* p) { |
|
|
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void Destruct(T* p) { |
|
|
|
p->~T(); |
|
|
|
p->~T(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Call the constructor of p without having to name the type of p and forward
|
|
|
|
// Call the constructor of p without having to name the type of p and forward
|
|
|
|
// any arguments
|
|
|
|
// any arguments
|
|
|
|
template <typename T, typename... Args> |
|
|
|
template <typename T, typename... Args> |
|
|
|
void Construct(T* p, Args&&... args) { |
|
|
|
GPR_ATTRIBUTE_ALWAYS_INLINE_FUNCTION void Construct(T* p, Args&&... args) { |
|
|
|
new (p) T(std::forward<Args>(args)...); |
|
|
|
new (p) T(std::forward<Args>(args)...); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|