Repository: qpid-proton
Updated Branches:
  refs/heads/master b6248ba74 -> 23d2686bb


PROTON-1212: [C++ binding] Fix bool conversions of pn_unique_ptr


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

Branch: refs/heads/master
Commit: 23d2686bb5d2c8963dea2d8810e8a574a33785ac
Parents: b6248ba
Author: Andrew Stitcher <[email protected]>
Authored: Tue May 24 10:56:25 2016 -0400
Committer: Andrew Stitcher <[email protected]>
Committed: Tue May 24 16:35:36 2016 -0400

----------------------------------------------------------------------
 .../bindings/cpp/include/proton/internal/pn_unique_ptr.hpp     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/23d2686b/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp 
b/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
index 4983883..cc29ba0 100644
--- a/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
+++ b/proton-c/bindings/cpp/include/proton/internal/pn_unique_ptr.hpp
@@ -51,8 +51,10 @@ template <class T> class pn_unique_ptr {
     T* get() const { return ptr_; }
     void reset(T* p = 0) { pn_unique_ptr<T> tmp(p); std::swap(ptr_, tmp.ptr_); 
}
     T* release() { T *p = ptr_; ptr_ = 0; return p; }
-    operator bool() const { return get(); }
-    bool operator !() const { return get(); }
+#if PN_CPP_HAS_EXPLICIT_CONVERSIONS
+    explicit operator bool() const { return get(); }
+#endif
+    bool operator !() const { return !get(); }
 
 #if PN_CPP_HAS_STD_PTR
     operator std::unique_ptr<T>() { T *p = ptr_; ptr_ = 0; return 
std::unique_ptr<T>(p); }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to