aboutsummaryrefslogtreecommitdiffstats
path: root/filedistribution
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-09-13 21:37:52 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-09-14 09:16:59 +0000
commitb991bdf1e0808bfc2149727e52a498bda6bb4b22 (patch)
treeef03d22b238eda8d86b8657cf7e2fcb3618c7a50 /filedistribution
parentebaf0ea31790d1e7251f49ccb889b8e379e6024c (diff)
c++11 lambdas
Diffstat (limited to 'filedistribution')
-rw-r--r--filedistribution/src/tests/filedownloader/testfiledownloader.cpp1
-rw-r--r--filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp9
-rw-r--r--filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp6
3 files changed, 3 insertions, 13 deletions
diff --git a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp
index f4e002899b8..a276887ca7e 100644
--- a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp
+++ b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp
@@ -10,7 +10,6 @@
#include <boost/test/unit_test.hpp>
#include <boost/filesystem.hpp>
-#include <boost/lambda/bind.hpp>
#include <boost/filesystem/fstream.hpp>
#include <libtorrent/session.hpp>
diff --git a/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp b/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp
index 733d60d91bb..1e80ff375a4 100644
--- a/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp
+++ b/filedistribution/src/vespa/filedistribution/model/deployedfilestodownload.cpp
@@ -5,9 +5,6 @@
#include <sstream>
#include <iterator>
-#include <boost/lambda/lambda.hpp>
-#include <boost/lambda/bind.hpp>
-
#include <vespa/filedistribution/common/logfwd.h>
using filedistribution::DeployedFilesToDownload;
@@ -37,8 +34,7 @@ DeployedFilesToDownload::addNewDeployNode(Path parentPath, const FileReferences&
std::ostringstream filesStream;
if (!files.empty()) {
filesStream << files[0];
- std::for_each(files.begin() +1, files.end(),
- filesStream <<boost::lambda::constant('\n') <<boost::lambda::_1);
+ std::for_each(files.begin() +1, files.end(), [&](const auto & v) { filesStream << '\n' << v; });
}
Path retPath = _zk.createSequenceNode(path, filesStream.str().c_str(), filesStream.str().length());
return retPath;
@@ -74,8 +70,7 @@ DeployedFilesToDownload::deleteExpiredDeployNodes(Path parentPath, StringVector
size_t numberOfNodesToDelete = children.size() - numberOfDeploysToKeepFiles;
std::for_each(children.begin(), children.begin() + numberOfNodesToDelete,
- boost::lambda::bind(&ZKFacade::remove, &_zk,
- boost::lambda::ret<Path>(parentPath / boost::lambda::_1)));
+ [&](const std::string & s) {_zk.remove(parentPath / s); });
}
}
diff --git a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp
index 79ce38fd2a0..c0326db209b 100644
--- a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp
+++ b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp
@@ -8,8 +8,6 @@
#include <cstdlib>
#include <boost/filesystem.hpp>
-#include <boost/lambda/lambda.hpp>
-#include <boost/lambda/bind.hpp>
#include <zookeeper/zookeeper.h>
#include <vespa/log/log.h>
@@ -109,9 +107,7 @@ FileDistributionModelImpl::getPeers(const std::string& fileReference, size_t max
PeerEntries result;
result.reserve(end - peers.begin());
- namespace ll=boost::lambda;
- std::for_each(peers.begin(), end,
- ll::bind(&addPeerEntry, boost::lambda::_1, boost::ref(result)));
+ std::for_each(peers.begin(), end, [&] (const std::string & s) { addPeerEntry(s, result); });
LOG(debug, "Found %zu peers for path '%s'", result.size(), path.string().c_str());
return result;