Use range-based-for instead of std::for_each and std::mem_fun
std::mem_fun is deprecated in C++11, and removed in C++17. Using C++17 option for building libwebrtc causes build failure. This is found during upgrading WebKit tree from C++14 to C++17. This patch replaces std::for_each and std::mem_fun with range-based-for. We also merge loops for streams_ into one. Bug: webrtc:9277 Change-Id: I44a7e44ea21fc33ffa9a586ddfea570f97dfacb6 Reviewed-on: https://webrtc-review.googlesource.com/77280 Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23285}
This commit is contained in:

committed by
Commit Bot

parent
c475ac14a9
commit
f8d8d6d00c
1
AUTHORS
1
AUTHORS
@ -61,6 +61,7 @@ Hans Knoechel <hans@hans-knoechel.de>
|
||||
Korniltsev Anatoly <korniltsev.anatoly@gmail.com>
|
||||
Todd Wong <todd.wong.ndq@gmail.com>
|
||||
Maxim Pavlov <pavllovmax@gmail.com>
|
||||
Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
||||
&yet LLC <*@andyet.com>
|
||||
Agora IO <*@agora.io>
|
||||
|
@ -136,13 +136,11 @@ class BitrateEstimatorTest : public test::CallTest {
|
||||
|
||||
virtual void TearDown() {
|
||||
task_queue_.SendTask([this]() {
|
||||
std::for_each(streams_.begin(), streams_.end(),
|
||||
std::mem_fun(&Stream::StopSending));
|
||||
|
||||
while (!streams_.empty()) {
|
||||
delete streams_.back();
|
||||
streams_.pop_back();
|
||||
for (auto* stream : streams_) {
|
||||
stream->StopSending();
|
||||
delete stream;
|
||||
}
|
||||
streams_.clear();
|
||||
|
||||
send_transport_.reset();
|
||||
receive_transport_.reset();
|
||||
|
Reference in New Issue
Block a user