MCPcopy Create free account
hub / github.com/BowenFu/matchit.cpp / recursiveSymmetric

Function recursiveSymmetric

sample/symmetric.cpp:5–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4template <typename Range>
5constexpr bool recursiveSymmetric(Range const &range)
6{
7 using namespace matchit;
8 Id<int32_t> i;
9 Id<SubrangeT<Range const>> subrange;
10 return match(range)(
11 // clang-format off
12 pattern | ds(i, subrange.at(ooo), i) = [&] { return recursiveSymmetric(*subrange); },
13 pattern | ds(_, ooo, _) = expr(false),
14 pattern | _ = expr(true)
15 // clang-format on
16 );
17}
18
19constexpr bool symmetricArray(std::array<int32_t, 5> const &arr)
20{

Callers 1

mainFunction · 0.70

Calls 4

matchFunction · 0.50
dsFunction · 0.50
exprFunction · 0.50
atMethod · 0.45

Tested by

no test coverage detected