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

Method get_if

sample/Predicate-based-Discriminator.cpp:43–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41// Opt into Variant-Like protocol.
42template <String::Storage S>
43auto String::get_if()
44{
45 if constexpr (S == Local)
46 return index() == Local ? &local : nullptr;
47 else if constexpr (S == Remote)
48 return index() == Remote ? &remote : nullptr;
49}
50
51template <String::Storage S, typename Pat>
52auto asEnum(Pat &&pat)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected