Repository: qpid-proton Updated Branches: refs/heads/0.13.x 404352047 -> cdc4346ec
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/cdc4346e Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/cdc4346e Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/cdc4346e Branch: refs/heads/0.13.x Commit: cdc4346ecf8064ee874ba0f362a059c01d9f7b74 Parents: 4043520 Author: Andrew Stitcher <[email protected]> Authored: Tue May 24 10:56:25 2016 -0400 Committer: Andrew Stitcher <[email protected]> Committed: Wed May 25 00:03:40 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/cdc4346e/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]
