You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/12/21 20:50:56 UTC

qpid-proton git commit: NO-JIRA: c++: Fix compile error on clang++

Repository: qpid-proton
Updated Branches:
  refs/heads/master e9e0f31c6 -> c41ff0658


NO-JIRA: c++: Fix compile error on clang++

The compile error doesn't happen on gcc, and to my eye the original code looks fine but this
version compiles on gcc/clang x 03/11 + MSVC


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c41ff065
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c41ff065
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c41ff065

Branch: refs/heads/master
Commit: c41ff065887d99740af31dba41cca113d67bc2e8
Parents: e9e0f31
Author: Alan Conway <ac...@redhat.com>
Authored: Mon Dec 21 09:59:03 2015 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Mon Dec 21 14:49:59 2015 -0500

----------------------------------------------------------------------
 proton-c/bindings/cpp/include/proton/object.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c41ff065/proton-c/bindings/cpp/include/proton/object.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/object.hpp b/proton-c/bindings/cpp/include/proton/object.hpp
index 34fc5a0..a2457bb 100644
--- a/proton-c/bindings/cpp/include/proton/object.hpp
+++ b/proton-c/bindings/cpp/include/proton/object.hpp
@@ -54,17 +54,17 @@ template <class T> class pn_ptr : public comparable<pn_ptr<T> >, private pn_ptr_
   friend bool operator==(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ == b.ptr_; }
   friend bool operator<(const pn_ptr& a, const pn_ptr& b) { return a.ptr_ < b.ptr_; }
 
+    static pn_ptr take_ownership(T* p) { return pn_ptr<T>(p, true); }
+
   private:
     T *ptr_;
 
     // Note that it is the presence of the bool in the constructor signature that matters
     // to get the "transfer ownership" constructor: The value of the bool isn't checked.
     pn_ptr(T* p, bool) : ptr_(p) {}
-    template <class U> pn_ptr<U> take_ownership(U* p);
-    friend pn_ptr take_ownership<T>(T* p);
 };
 
-template <class T> pn_ptr<T> take_ownership(T* p) { return pn_ptr<T>(p, true); }
+template <class T> pn_ptr<T> take_ownership(T* p) { return pn_ptr<T>::take_ownership(p); }
 
 ///@endcond INTERNAL
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org