Skip to content

Commit

Permalink
Replace use of boost::adapters::filtered with ranges::views::filter
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Sep 27, 2022
1 parent 311b205 commit 565423c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions liblangutil/ErrorReporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
#include <liblangutil/SourceLocation.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
{
Expand Down Expand Up @@ -106,9 +107,8 @@ class ErrorReporter
std::initializer_list<std::string> const descs = { _descriptions... };
solAssert(descs.size() > 0, "Need error descriptions!");

auto filterEmpty = boost::adaptors::filtered([](std::string const& _s) { return !_s.empty(); });

std::string errorStr = util::joinHumanReadable(descs | filterEmpty, " ");
auto nonEmpty = [](std::string const& _s) { return !_s.empty(); };
std::string errorStr = util::joinHumanReadable(descs | ranges::views::filter(nonEmpty) | ranges::to_vector, " ");

error(_error, Error::Type::TypeError, _location, errorStr);
}
Expand Down
1 change: 0 additions & 1 deletion solc/CommandLineInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@

#include <boost/filesystem.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/range/adaptor/filtered.hpp>
#include <boost/algorithm/string.hpp>

#ifdef _WIN32 // windows
Expand Down
1 change: 0 additions & 1 deletion test/libyul/ObjectParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <string>
#include <sstream>

using namespace ranges;
using namespace std;
using namespace solidity::frontend;
using namespace solidity::langutil;
Expand Down

0 comments on commit 565423c

Please sign in to comment.