[vlc-devel] [PATCH] mkv: remove deprecated std function

Alexandre Janniaux ajanni at videolabs.io
Wed Dec 11 11:57:13 CET 2019


std::mem_fun and std::bind2nd have been deprecated in C++11 and will be
removed in C++17. They were replaced by std::mem_fn and std::bind which
are easier to use.
---
 modules/demux/mkv/chapters.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mkv/chapters.cpp b/modules/demux/mkv/chapters.cpp
index 8d9f5da899..3d69da52df 100644
--- a/modules/demux/mkv/chapters.cpp
+++ b/modules/demux/mkv/chapters.cpp
@@ -147,13 +147,14 @@ bool chapter_item_c::EnterLeaveHelper_ ( bool do_subs,
     bool f_result = false;
 
     f_result |= std::count_if ( codecs.begin (), codecs.end (),
-      std::mem_fun (co_cb)
+      std::mem_fn (co_cb)
     );
 
     if ( do_subs )
     {
+        using std::placeholders::_1;
         f_result |= count_if ( sub_chapters.begin (), sub_chapters.end (),
-          std::bind2nd( std::mem_fun( ch_cb ), true )
+          std::bind( std::mem_fn( ch_cb ), _1, true )
         );
     }
 
-- 
2.24.1



More information about the vlc-devel mailing list