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

Function contains

sample/contains.cpp:6–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5template <typename Map, typename Key>
6constexpr bool contains(Map const &map, Key const &key)
7{
8 using namespace matchit;
9 return match(map.find(key))(
10 // clang-format off
11 pattern | map.end() = expr(false),
12 pattern | _ = expr(true)
13 // clang-format on
14 );
15}
16
17int32_t main()
18{

Callers 1

mainFunction · 0.85

Calls 3

endMethod · 0.80
matchFunction · 0.50
exprFunction · 0.50

Tested by

no test coverage detected