diff --git a/include/zenoh/api/reply.hxx b/include/zenoh/api/reply.hxx index 1f12dad..6f00a74 100644 --- a/include/zenoh/api/reply.hxx +++ b/include/zenoh/api/reply.hxx @@ -84,7 +84,16 @@ class Reply : public Owned<::z_owned_reply_t> { return {}; } #endif + + /// @brief Construct a shallow copy of this Reply. + /// + /// The reply will be sent only when the last clone is destroyed. + Reply clone() const { + Reply reply(zenoh::detail::null_object); + ::z_reply_clone(&reply._0, interop::as_loaned_c_ptr(*this)); + return reply; + }; }; } // namespace zenoh -#endif \ No newline at end of file +#endif