diff options
author | Alan Conway <aconway@apache.org> | 2009-03-30 15:25:30 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2009-03-30 15:25:30 +0000 |
commit | 6c66415656a66692f97bf6d6c2597282a7163578 (patch) | |
tree | 1058051108bd3ccb24d0448274c45948127d4adf /cpp/src | |
parent | b264a276f994526ce24062c3f852fdd658857d29 (diff) | |
download | qpid-python-6c66415656a66692f97bf6d6c2597282a7163578.tar.gz |
cpp/src/qpid/client/Handle.h: fix operator!()
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@760008 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/client/Handle.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/qpid/client/Handle.h b/cpp/src/qpid/client/Handle.h index d8b822d0f9..1a092b7209 100644 --- a/cpp/src/qpid/client/Handle.h +++ b/cpp/src/qpid/client/Handle.h @@ -46,8 +46,11 @@ template <class T> 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<T>&); |