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

Class MatchHelper

develop/matchit/core.h:30–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29 template <typename Value, bool byRef>
30 class MatchHelper
31 {
32 private:
33 using ValueT = typename ValueType<Value, byRef>::ValueT;
34 ValueT mValue;
35 using ValueRefT = ValueT &&;
36
37 public:
38 template <typename V>
39 constexpr explicit MatchHelper(V &&value) : mValue{std::forward<V>(value)} {}
40 template <typename... PatternPair>
41 constexpr auto operator()(PatternPair const &...patterns)
42 {
43 return matchPatterns(std::forward<ValueRefT>(mValue), patterns...);
44 }
45 };
46
47 template <typename Value>
48 constexpr auto match(Value &&value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected