Skip to content

Commit c0bf85a

Browse files
authored
Merge pull request #13 from matyasselmeci/pr/el8-build
Add C++17 compatibility by using std::remove_if instead of std::erase_if and adding explicit include of `atomic`
2 parents e8a8dd0 + 369f423 commit c0bf85a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Prestage.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ void PrestageRequestManager::PrestageQueue::PrestageWorker::Run() {
110110
void PrestageRequestManager::PrestageQueue::Done(PrestageWorker *worker) {
111111
std::unique_lock lock(m_mutex);
112112
m_done = true;
113-
std::erase_if(m_workers, [&](std::unique_ptr<PrestageWorker> &other) {
114-
return other.get() == worker;
115-
});
113+
auto it = std::remove_if(m_workers.begin(), m_workers.end(),
114+
[&](std::unique_ptr<PrestageWorker> &other) {
115+
return other.get() == worker;
116+
});
117+
m_workers.erase(it, m_workers.end());
116118

117119
if (m_workers.empty()) {
118120
lock.unlock();

src/XrdHttpPelican.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "private/XrdHttp/XrdHttpExtHandler.hh"
2020

21+
#include <atomic>
2122
#include <chrono>
2223
#include <condition_variable>
2324
#include <deque>

0 commit comments

Comments
 (0)