diff options
Diffstat (limited to 'include/dbus-c++/util.h')
-rw-r--r-- | include/dbus-c++/util.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/include/dbus-c++/util.h b/include/dbus-c++/util.h index b46732f..8b3806d 100644 --- a/include/dbus-c++/util.h +++ b/include/dbus-c++/util.h @@ -28,6 +28,8 @@ #include <sstream> #include <iostream> #include <iomanip> +#include <cassert> + #include "api.h" #include "debug.h" @@ -232,15 +234,29 @@ public: R operator()(P param) const { - /*if (_cb.get())*/ return _cb->call(param); + if (!empty()) + { + return _cb->call(param); + } + + // TODO: think about return type in this case + // this assert should help me to find the use case where it's needed... + //assert (false); } R call(P param) const { - /*if (_cb.get())*/ return _cb->call(param); + if (!empty()) + { + return _cb->call(param); + } + + // TODO: think about return type in this case + // this assert should help me to find the use case where it's needed... + //assert (false); } - bool empty() + bool empty() const { return _cb.get() == 0; } |