Replace ranges::all_of wrapper by range-v3.

This commit is contained in:
Daniel Kirchner 2021-01-12 21:44:42 +01:00
parent 75bed10be5
commit 4505889481
2 changed files with 2 additions and 14 deletions

View File

@ -49,16 +49,4 @@ erase_if(std::unordered_map<Key,T,Hash,KeyEqual,Alloc>& c, Pred pred)
return old_size - c.size();
}
namespace ranges
{
template<typename R, typename Pred>
inline constexpr bool all_of(R&& r, Pred pred)
{
for (auto it = std::begin(r), end = std::end(r); it != end; ++it)
if (!std::invoke(pred, *it))
return false;
return true;
}
}
}

View File

@ -26,7 +26,7 @@
#include <libyul/Exceptions.h>
#include <libyul/AST.h>
#include <libsolutil/cxx20.h>
#include <range/v3/algorithm/all_of.hpp>
using namespace std;
using namespace solidity;
@ -88,7 +88,7 @@ void Rematerialiser::visit(Expression& _e)
)
{
assertThrow(m_referenceCounts[name] > 0, OptimizerException, "");
if (cxx20::ranges::all_of(m_references[name], [&](auto const& ref) { return inScope(ref); }))
if (ranges::all_of(m_references[name], [&](auto const& ref) { return inScope(ref); }))
{
// update reference counts
m_referenceCounts[name]--;