Avoid using std::bind1st that is removed in C++17

Use a lambda instead now that we require C++11.
This commit is contained in:
Brad King
2017-09-22 14:06:33 -04:00
parent 4609aaf513
commit 44d3a76d4a
2 changed files with 2 additions and 4 deletions

View File

@@ -370,8 +370,7 @@ std::string cmWrap(char prefix, Range const& r, char suffix,
template <typename Range, typename T>
typename Range::const_iterator cmFindNot(Range const& r, T const& t)
{
return std::find_if(r.begin(), r.end(),
std::bind1st(std::not_equal_to<T>(), t));
return std::find_if(r.begin(), r.end(), [&t](T const& i) { return i != t; });
}
template <typename Range>

View File

@@ -5,7 +5,6 @@
#include "cmsys/FStream.hxx"
#include "cmsys/Terminal.h"
#include <algorithm>
#include <functional>
#include <sstream>
#include <stdio.h>
#include <utility>
@@ -2073,7 +2072,7 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
std::string outputForExisting = this->ConvertToOutputForExisting(tgtDir);
std::string prefix = cd_cmd + outputForExisting + " && ";
std::transform(commands.begin(), commands.end(), commands.begin(),
std::bind1st(std::plus<std::string>(), prefix));
[&prefix](std::string const& s) { return prefix + s; });
}
}