Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/BowenFu/matchit.cpp
/ sample1
Function
sample1
sample/Wildcard-pattern.cpp:6–14 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
4
using namespace matchit;
5
6
void sample1()
7
{
8
constexpr auto x = 20;
9
Id<int32_t> a;
10
match(10, x)(
11
// the x is always matched by _
12
pattern | ds(a, _) = [&]
13
{ assert(*a == 10); });
14
}
15
16
void sample2()
17
{
Callers
1
main
Function · 0.70
Calls
2
match
Function · 0.50
ds
Function · 0.50
Tested by
no test coverage detected