Skip to content

Commit 0417ee2

Browse files
committed
Replace boost::adaptors with range-v3
Signed-off-by: soroosh-sdi <[email protected]>
1 parent a39eb7a commit 0417ee2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

libsolidity/ast/Types.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
#include <boost/algorithm/string/predicate.hpp>
4242
#include <boost/algorithm/string/replace.hpp>
4343
#include <boost/algorithm/string/split.hpp>
44-
#include <boost/range/adaptor/sliced.hpp>
4544
#include <boost/range/algorithm/copy.hpp>
4645

4746
#include <range/v3/view/enumerate.hpp>
4847
#include <range/v3/view/reverse.hpp>
48+
#include <range/v3/view/tail.hpp>
4949
#include <range/v3/view/transform.hpp>
5050

5151
#include <limits>
@@ -3694,7 +3694,7 @@ MemberList::MemberMap TypeType::nativeMembers(ASTNode const* _currentScope) cons
36943694
auto bases = contract.annotation().linearizedBaseContracts;
36953695
solAssert(bases.size() >= 1, "linearizedBaseContracts should at least contain the most derived contract.");
36963696
// `sliced(1, ...)` ignores the most derived contract, which should not be searchable from `super`.
3697-
for (ContractDefinition const* base: bases | boost::adaptors::sliced(1, bases.size()))
3697+
for (ContractDefinition const* base: bases | ranges::views::tail)
36983698
for (FunctionDefinition const* function: base->definedFunctions())
36993699
{
37003700
if (!function->isVisibleInDerivedContracts() || !function->isImplemented())

solc/CommandLineParser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include <boost/algorithm/string.hpp>
2626

2727
#include <range/v3/view/transform.hpp>
28+
#include <range/v3/view/filter.hpp>
29+
#include <range/v3/range/conversion.hpp>
2830

2931
using namespace std;
3032
using namespace solidity::langutil;
@@ -961,7 +963,7 @@ General Information)").c_str(),
961963
if (countEnabledOptions(nonAssemblyModeOptions) >= 1)
962964
{
963965
auto optionEnabled = [&](string const& name){ return m_args.count(name) > 0; };
964-
auto enabledOptions = boost::copy_range<vector<string>>(nonAssemblyModeOptions | boost::adaptors::filtered(optionEnabled));
966+
auto enabledOptions = nonAssemblyModeOptions | ranges::views::filter(optionEnabled) | ranges::to_vector;
965967

966968
serr() << "The following options are invalid in assembly mode: ";
967969
serr() << joinOptionNames(enabledOptions) << ".";

0 commit comments

Comments
 (0)