]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: Define a new make_message that returns the message inside a unique_ptr
authorAmnon Hanuhov <ahanukov@redhat.com>
Thu, 8 Apr 2021 14:08:45 +0000 (17:08 +0300)
committerAmnon Hanuhov <ahanukov@redhat.com>
Thu, 6 May 2021 17:22:05 +0000 (20:22 +0300)
Currently under the crimson::net namespace

Signed-off-by: Amnon Hanuhov <ahanukov@redhat.com>
src/msg/Message.h

index 8e1c4f967f05942855a6f34e9f1135a8470eb190..d2f75397cac5af7ca6ca9c72c6a65aa7ba4f5319 100644 (file)
@@ -553,4 +553,10 @@ ceph::ref_t<T> make_message(Args&&... args) {
 }
 }
 
+namespace crimson::net {
+template<class T, typename... Args>
+MURef<T> make_message(Args&&... args) {
+  return {new T(std::forward<Args>(args)...), TOPNSPC::common::UniquePtrDeleter{}};
+}
+}
 #endif