[glibmm/glibmm-2-62] examples/thread/dispatcher.cc: Make C++17 compliant
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-62] examples/thread/dispatcher.cc: Make C++17 compliant
- Date: Wed, 4 Mar 2020 07:50:13 +0000 (UTC)
commit cf1ee65e6cd0599653922049a4f34f55ba67a856
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Mar 2 17:05:09 2020 +0800
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.
examples/thread/dispatcher.cc | 8 +++++---
1 file 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();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]