25#ifndef MYSQLROUTER_MATCHER_INCLUDED
26#define MYSQLROUTER_MATCHER_INCLUDED
39template <
char S,
char E>
42 static constexpr bool match(
char c) {
43 static_assert(S <= E,
"S <= E");
44 return (S <= c) && (c <= E);
53bool contains(
char c,
const std::initializer_list<char> &l) {
54 return std::find(l.begin(), l.end(), c) != l.end();
66 static bool match(
char c) {
return Arg == c; }
78template <
class... Rules>
85 static bool match(
char ) {
return false; }
89template <
class... Rules>
102 using swallow =
bool[
sizeof...(Rules)];
static bool match(char c)
Definition: matcher.h:66
matches one character in a list of possible candidates.
Definition: matcher.h:70
static bool match(char c)
Definition: matcher.h:72
matches a Range of characters.
Definition: matcher.h:40
static constexpr bool match(char c)
Definition: matcher.h:42
static bool match(char)
Definition: matcher.h:85
matches Rules left-to-right with OR.
Definition: matcher.h:90
static bool match(char c)
Definition: matcher.h:92
bool contains(char c, const std::initializer_list< char > &l)
check if a initizalizer list contains a character.
Definition: matcher.h:53
const byte * find(const Pages *pages, const page_id_t &page_id) noexcept
Find a doublewrite copy of a page.
Definition: buf0dblwr.cc:3578
struct result result
Definition: result.h:33