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 | a35d11fdedf1d5da59ca51248307d73ec911cb73 (patch) | |
| tree | 352d2534915a6f8e5c2f709b5f5527606a33bde7 /qpid/cpp/src | |
| parent | d66d576676f8fcc0ee3fc11fb34322f499c43ca8 (diff) | |
| download | qpid-python-a35d11fdedf1d5da59ca51248307d73ec911cb73.tar.gz | |
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
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/client/Handle.h | 5 |
1 files changed, 4 insertions, 1 deletions
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 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>&); |
