diff --git a/libyul/optimiser/ASTWalker.h b/libyul/optimiser/ASTWalker.h index cd98a90ca..b937f7eae 100644 --- a/libyul/optimiser/ASTWalker.h +++ b/libyul/optimiser/ASTWalker.h @@ -111,8 +111,7 @@ template < > struct ForEach: Base { - template - ForEach(Callable&& _visitor): visitor(std::forward(_visitor)) {} + ForEach(Visitor& _visitor): visitor(_visitor) {} using Base::operator(); void operator()(Node& _node) override @@ -121,7 +120,7 @@ struct ForEach: Base Base::operator()(_node); } - Visitor visitor; + Visitor& visitor; }; } @@ -130,7 +129,7 @@ struct ForEach: Base template void forEach(Entry&& _entry, Visitor&& _visitor) { - detail::ForEach>{std::forward(_visitor)}(std::forward(_entry)); + detail::ForEach{_visitor}(_entry); } }