diff options
author | Noah Eisen <ncteisen@gmail.com> | 2018-07-09 09:12:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-09 09:12:50 -0700 |
commit | 7ff678c718a9b27ced9c695bf1e4eb2bab33484c (patch) | |
tree | f6ff8870bf5b625c69fe43162625c0237d1c8025 /src/core/lib/gprpp | |
parent | 7c312e3d657ddf63975835d699b05d6613233e3d (diff) | |
parent | caa85b2a4340c54904a41f1c2fc1ffc17e7f8dbb (diff) |
Merge pull request #15906 from ncteisen/channelz
Fix Channelz Linkage Error
Diffstat (limited to 'src/core/lib/gprpp')
-rw-r--r-- | src/core/lib/gprpp/memory.h | 4 | ||||
-rw-r--r-- | src/core/lib/gprpp/ref_counted_ptr.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/core/lib/gprpp/memory.h b/src/core/lib/gprpp/memory.h index 28fcdf1779..e90bedcd9b 100644 --- a/src/core/lib/gprpp/memory.h +++ b/src/core/lib/gprpp/memory.h @@ -31,12 +31,12 @@ // protected destructor. #define GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_DELETE \ template <typename T> \ - friend void Delete(T*); + friend void grpc_core::Delete(T*); // Add this to a class that want to use New(), but has a private or // protected constructor. #define GPRC_ALLOW_CLASS_TO_USE_NON_PUBLIC_NEW \ template <typename T, typename... Args> \ - friend T* New(Args&&...); + friend T* grpc_core::New(Args&&...); namespace grpc_core { diff --git a/src/core/lib/gprpp/ref_counted_ptr.h b/src/core/lib/gprpp/ref_counted_ptr.h index 388e2ec410..534d3d03cb 100644 --- a/src/core/lib/gprpp/ref_counted_ptr.h +++ b/src/core/lib/gprpp/ref_counted_ptr.h @@ -107,6 +107,11 @@ inline RefCountedPtr<T> MakeRefCounted(Args&&... args) { return RefCountedPtr<T>(New<T>(std::forward<Args>(args)...)); } +template <typename Parent, typename Child, typename... Args> +inline RefCountedPtr<Parent> MakePolymorphicRefCounted(Args&&... args) { + return RefCountedPtr<Parent>(New<Child>(std::forward<Args>(args)...)); +} + } // namespace grpc_core #endif /* GRPC_CORE_LIB_GPRPP_REF_COUNTED_PTR_H */ |