diff options
author | Josh Blum <josh@joshknows.com> | 2021-01-22 21:01:09 -0600 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-01-27 07:31:08 -0800 |
commit | aa42a5cc57ab6750a103fccac9468321a9a795ef (patch) | |
tree | 2dcacc80243585dab3d09adaa265ba536ead2e38 | |
parent | 3d7546149051705b37bf7374f0969575246c4bea (diff) |
runtime: replace use of std::unary_function
std::unary_function is deprecated of as c++11 and removed in c++17
https://en.cppreference.com/w/cpp/utility/functional/unary_function
The solution was to replace unary_function with std::function.
Signed-off-by: Josh Blum <josh@joshknows.com>
-rw-r--r-- | gnuradio-runtime/include/gnuradio/rpcserver_aggregator.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gnuradio-runtime/include/gnuradio/rpcserver_aggregator.h b/gnuradio-runtime/include/gnuradio/rpcserver_aggregator.h index 9a08a03884..d98eab6297 100644 --- a/gnuradio-runtime/include/gnuradio/rpcserver_aggregator.h +++ b/gnuradio-runtime/include/gnuradio/rpcserver_aggregator.h @@ -13,6 +13,7 @@ #include <gnuradio/rpcmanager_base.h> #include <gnuradio/rpcserver_base.h> +#include <functional> #include <string> #include <vector> @@ -42,7 +43,7 @@ public: private: template <class T, typename Tcallback> - struct registerConfigureCallback_f : public std::unary_function<T, void> { + struct registerConfigureCallback_f : public std::function<void(T)> { registerConfigureCallback_f(const std::string& _id, const Tcallback _callback) : id(_id), callback(_callback) { @@ -55,7 +56,7 @@ private: }; template <class T, typename Tcallback> - struct unregisterConfigureCallback_f : public std::unary_function<T, void> { + struct unregisterConfigureCallback_f : public std::function<void(T)> { unregisterConfigureCallback_f(const std::string& _id) : id(_id) { ; } void operator()(T& x) { x->i()->unregisterConfigureCallback(id); } @@ -63,7 +64,7 @@ private: }; template <class T, typename Tcallback> - struct registerQueryCallback_f : public std::unary_function<T, void> { + struct registerQueryCallback_f : public std::function<void(T)> { registerQueryCallback_f(const std::string& _id, const Tcallback _callback) : id(_id), callback(_callback) { @@ -76,7 +77,7 @@ private: }; template <class T, typename Tcallback> - struct unregisterQueryCallback_f : public std::unary_function<T, void> { + struct unregisterQueryCallback_f : public std::function<void(T)> { unregisterQueryCallback_f(const std::string& _id) : id(_id) { ; } void operator()(T& x) { x->i()->unregisterQueryCallback(id); } @@ -85,7 +86,7 @@ private: template <class T, typename Tcallback> - struct registerHandlerCallback_f : public std::unary_function<T, void> { + struct registerHandlerCallback_f : public std::function<void(T)> { registerHandlerCallback_f(const std::string& _id, const Tcallback _callback) : id(_id), callback(_callback) { @@ -98,7 +99,7 @@ private: }; template <class T, typename Tcallback> - struct unregisterHandlerCallback_f : public std::unary_function<T, void> { + struct unregisterHandlerCallback_f : public std::function<void(T)> { unregisterHandlerCallback_f(const std::string& _id) : id(_id) { ; } void operator()(T& x) { x->i()->unregisterHandlerCallback(id); } |