diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-03-02 17:05:09 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-03-02 17:05:09 +0800 |
commit | 5f7f9b2ff378924f5d66bed2036df578188d96e1 (patch) | |
tree | d0be73976ebd222fe315b5d06aaef145dcd0f481 /examples | |
parent | 150bee0c68e4e293a5630159b2666e103805df8c (diff) | |
download | glibmm-5f7f9b2ff378924f5d66bed2036df578188d96e1.tar.gz |
examples/thread/dispatcher.cc: Make C++17 compliant
std::mem_fun() and std::unary() have been removed from C++17, so port
away from using these.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/thread/dispatcher.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/thread/dispatcher.cc b/examples/thread/dispatcher.cc index ecd18a7d..2ec35780 100644 --- a/examples/thread/dispatcher.cc +++ b/examples/thread/dispatcher.cc @@ -76,8 +76,10 @@ private: }; template <class T> -class DeletePtr : public std::unary_function<void, T> +class DeletePtr { + typedef void argument_type; + typedef T result_type; public: void operator()(T ptr) const { delete ptr; } }; @@ -193,7 +195,7 @@ Application::launch_threads() std::cout << "Launching " << progress_threads_.size() << " threads:" << std::endl; std::for_each( - progress_threads_.begin(), progress_threads_.end(), std::mem_fun(&ThreadProgress::launch)); + progress_threads_.begin(), progress_threads_.end(), std::mem_fn(&ThreadProgress::launch)); } void @@ -205,7 +207,7 @@ Application::on_progress_finished(ThreadProgress* thread_progress) // Quit if it was the last thread to be joined. if (std::find_if(progress_threads_.begin(), progress_threads_.end(), - std::mem_fun(&ThreadProgress::unfinished)) == progress_threads_.end()) + std::mem_fn(&ThreadProgress::unfinished)) == progress_threads_.end()) { main_loop_->quit(); } |