Skip to content

Commit cb5c559

Browse files
authored
Merge pull request #13567 from ethereum/ranges-filter
Replace use of boost::adapters::filtered with ranges::views::filter
2 parents 311b205 + 0f484ec commit cb5c559

File tree

7 files changed

+7
-13
lines changed

7 files changed

+7
-13
lines changed

liblangutil/ErrorReporter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
#include <liblangutil/SourceLocation.h>
3131
#include <libsolutil/StringUtils.h>
3232

33-
#include <boost/range/adaptor/filtered.hpp>
33+
#include <range/v3/range/conversion.hpp>
34+
#include <range/v3/view/filter.hpp>
3435

3536
namespace solidity::langutil
3637
{
@@ -106,9 +107,8 @@ class ErrorReporter
106107
std::initializer_list<std::string> const descs = { _descriptions... };
107108
solAssert(descs.size() > 0, "Need error descriptions!");
108109

109-
auto filterEmpty = boost::adaptors::filtered([](std::string const& _s) { return !_s.empty(); });
110-
111-
std::string errorStr = util::joinHumanReadable(descs | filterEmpty, " ");
110+
auto nonEmpty = [](std::string const& _s) { return !_s.empty(); };
111+
std::string errorStr = util::joinHumanReadable(descs | ranges::views::filter(nonEmpty) | ranges::to_vector, " ");
112112

113113
error(_error, Error::Type::TypeError, _location, errorStr);
114114
}

libyul/AsmJsonConverter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <libyul/ASTForward.h>
2727
#include <liblangutil/SourceLocation.h>
2828
#include <json/json.h>
29-
#include <boost/variant.hpp>
29+
#include <boost/variant/static_visitor.hpp>
3030
#include <optional>
3131
#include <vector>
3232

libyul/optimiser/UnusedFunctionParameterPruner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#include <libsolutil/CommonData.h>
3333

34-
#include <boost/algorithm/cxx11/all_of.hpp>
34+
#include <range/v3/algorithm/all_of.hpp>
3535

3636
#include <optional>
3737
#include <variant>
@@ -64,7 +64,7 @@ void UnusedFunctionParameterPruner::run(OptimiserStepContext& _context, Block& _
6464
{
6565
FunctionDefinition const& f = std::get<FunctionDefinition>(statement);
6666

67-
if (tooSimpleToBePruned(f) || boost::algorithm::all_of(f.parameters + f.returnVariables, used))
67+
if (tooSimpleToBePruned(f) || ranges::all_of(f.parameters + f.returnVariables, used))
6868
continue;
6969

7070
usedParametersAndReturnVariables[f.name] = {

solc/CommandLineInterface.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666

6767
#include <boost/filesystem.hpp>
6868
#include <boost/filesystem/operations.hpp>
69-
#include <boost/range/adaptor/filtered.hpp>
7069
#include <boost/algorithm/string.hpp>
7170

7271
#ifdef _WIN32 // windows

test/libyul/ObjectParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include <string>
4444
#include <sstream>
4545

46-
using namespace ranges;
4746
using namespace std;
4847
using namespace solidity::frontend;
4948
using namespace solidity::langutil;

test/tools/ossfuzz/protoToAbiV2.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
#include <liblangutil/Exceptions.h>
1212

13-
#include <boost/variant/static_visitor.hpp>
1413
#include <boost/algorithm/string.hpp>
15-
#include <boost/variant.hpp>
1614

1715
#include <ostream>
1816
#include <random>

test/tools/yulInterpreter/Interpreter.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
#include <libsolutil/FixedHash.h>
3636

37-
#include <boost/algorithm/cxx11/all_of.hpp>
38-
3937
#include <range/v3/view/reverse.hpp>
4038

4139
#include <ostream>

0 commit comments

Comments
 (0)