Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F161E187CA for ; Mon, 21 Dec 2015 19:50:56 +0000 (UTC) Received: (qmail 48009 invoked by uid 500); 21 Dec 2015 19:50:56 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 47952 invoked by uid 500); 21 Dec 2015 19:50:56 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 47943 invoked by uid 99); 21 Dec 2015 19:50:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2015 19:50:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 88DDEE07EE; Mon, 21 Dec 2015 19:50:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aconway@apache.org To: commits@qpid.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: qpid-proton git commit: NO-JIRA: c++: Fix compile error on clang++ Date: Mon, 21 Dec 2015 19:50:56 +0000 (UTC) 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 Authored: Mon Dec 21 09:59:03 2015 -0500 Committer: Alan Conway 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 pn_ptr : public comparable >, 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(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 pn_ptr take_ownership(U* p); - friend pn_ptr take_ownership(T* p); }; -template pn_ptr take_ownership(T* p) { return pn_ptr(p, true); } +template pn_ptr take_ownership(T* p) { return pn_ptr::take_ownership(p); } ///@endcond INTERNAL --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org