astitcher commented on a change in pull request #315: URL: https://github.com/apache/qpid-proton/pull/315#discussion_r639138782
########## File path: c/tests/pn_test.hpp ########## @@ -46,13 +46,14 @@ namespace pn_test { template <class T, void (*Free)(T *)> class auto_free { T *ptr_; auto_free &operator=(auto_free &x); - auto_free(auto_free &x); +public: + auto_free(auto_free &x) = delete; public: - auto_free(T *p = 0) : ptr_(p) {} + explicit auto_free(T *p = 0) : ptr_(p) {} ~auto_free() { Free(ptr_); } T *get() const { return ptr_; } - operator T *() const { return ptr_; } + operator T *() const { return ptr_; } // not marking explicit for convenience Review comment: Actually it could be replaced with unique_ptr now - this version will work with C++03 which isn't needed any more. [std::unique_ptr has an optional deleter capability] -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org