From a35d11fdedf1d5da59ca51248307d73ec911cb73 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 30 Mar 2009 15:25:30 +0000 Subject: cpp/src/qpid/client/Handle.h: fix operator!() git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@760008 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/client/Handle.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/client/Handle.h b/qpid/cpp/src/qpid/client/Handle.h index d8b822d0f9..1a092b7209 100644 --- a/qpid/cpp/src/qpid/client/Handle.h +++ b/qpid/cpp/src/qpid/client/Handle.h @@ -46,8 +46,11 @@ template class Handle { /**@return true if handle is null. It is an error to call any function on a null handle. */ QPID_CLIENT_EXTERN bool isNull() const { return !impl; } + /** Conversion to bool supports idiom if (handle) { handle->... } */ QPID_CLIENT_EXTERN operator bool() const { return impl; } - QPID_CLIENT_EXTERN bool operator !() const { return impl; } + + /** Operator ! supports idiom if (!handle) { do_if_handle_is_null(); } */ + QPID_CLIENT_EXTERN bool operator !() const { return !impl; } QPID_CLIENT_EXTERN void swap(Handle&); -- cgit v1.2.1