Replace use of boost::adapters::filtered with ranges::views::filter

This commit is contained in:
Alex Beregszaszi 2022-09-27 02:55:26 +02:00
parent 311b2054af
commit 565423c934
3 changed files with 4 additions and 6 deletions

View File

@ -30,7 +30,8 @@
#include <liblangutil/SourceLocation.h> #include <liblangutil/SourceLocation.h>
#include <libsolutil/StringUtils.h> #include <libsolutil/StringUtils.h>
#include <boost/range/adaptor/filtered.hpp> #include <range/v3/range/conversion.hpp>
#include <range/v3/view/filter.hpp>
namespace solidity::langutil namespace solidity::langutil
{ {
@ -106,9 +107,8 @@ public:
std::initializer_list<std::string> const descs = { _descriptions... }; std::initializer_list<std::string> const descs = { _descriptions... };
solAssert(descs.size() > 0, "Need error descriptions!"); solAssert(descs.size() > 0, "Need error descriptions!");
auto filterEmpty = boost::adaptors::filtered([](std::string const& _s) { return !_s.empty(); }); auto nonEmpty = [](std::string const& _s) { return !_s.empty(); };
std::string errorStr = util::joinHumanReadable(descs | ranges::views::filter(nonEmpty) | ranges::to_vector, " ");
std::string errorStr = util::joinHumanReadable(descs | filterEmpty, " ");
error(_error, Error::Type::TypeError, _location, errorStr); error(_error, Error::Type::TypeError, _location, errorStr);
} }

View File

@ -66,7 +66,6 @@
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <boost/range/adaptor/filtered.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#ifdef _WIN32 // windows #ifdef _WIN32 // windows

View File

@ -43,7 +43,6 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
using namespace ranges;
using namespace std; using namespace std;
using namespace solidity::frontend; using namespace solidity::frontend;
using namespace solidity::langutil; using namespace solidity::langutil;