Commit 53edc0bb authored by Paul's avatar Paul
Browse files

Fix tidy error

parent 9ca52537
...@@ -269,6 +269,14 @@ struct match_fold_f ...@@ -269,6 +269,14 @@ struct match_fold_f
return fold([&](auto x, auto y) { return op(always(x), matched(y)); })(Start, ms...); return fold([&](auto x, auto y) { return op(always(x), matched(y)); })(Start, ms...);
} }
template <class Pack>
static bool fold_matchers_pack(matcher_context& ctx, instruction_ref ins, Pack p)
{
return p([&](auto... ms) {
return match_fold_f::fold_matchers(ctx, ins, ms...);
});
}
template <class... Ts> template <class... Ts>
auto operator()(Ts... ms) const auto operator()(Ts... ms) const
{ {
...@@ -283,17 +291,15 @@ struct match_fold_f ...@@ -283,17 +291,15 @@ struct match_fold_f
template <class Selector> template <class Selector>
auto operator[](Selector select) const auto operator[](Selector select) const
{ {
return [=](auto... mms) { return [=](auto... ms) {
// Workaround ICE on gcc by packing matchers into an object // Workaround ICE on gcc by packing matchers into an object
auto mpack = pack(mms...); auto mpack = pack(ms...);
return make_bf_matcher([=](matcher_context& ctx, instruction_ref start) { return make_bf_matcher([=](matcher_context& ctx, instruction_ref start) {
Op op; Op op;
bool matches = Start; bool matches = Start;
select(start, [&](auto ins) { select(start, [&](auto ins) {
auto fm = [&] { auto fm = [&] {
return mpack([&](auto... ms) { return match_fold_f::fold_matchers_pack(ctx, ins, mpack);
return match_fold_f::fold_matchers(ctx, ins, ms...);
});
}; };
matches = op(always(matches), fm); matches = op(always(matches), fm);
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment