26#ifndef MYSQLROUTER_MATCHER_INCLUDED
27#define MYSQLROUTER_MATCHER_INCLUDED
40template <
char S,
char E>
43 static constexpr bool match(
char c) {
44 static_assert(S <= E,
"S <= E");
45 return (S <= c) && (c <= E);
54bool contains(
char c,
const std::initializer_list<char> &l) {
55 return std::find(l.begin(), l.end(), c) != l.end();
67 static bool match(
char c) {
return Arg == c; }
79template <
class... Rules>
86 static bool match(
char ) {
return false; }
90template <
class... Rules>
103 using swallow =
bool[
sizeof...(Rules)];
static bool match(char c)
Definition: matcher.h:67
matches one character in a list of possible candidates.
Definition: matcher.h:71
static bool match(char c)
Definition: matcher.h:73
matches a Range of characters.
Definition: matcher.h:41
static constexpr bool match(char c)
Definition: matcher.h:43
static bool match(char)
Definition: matcher.h:86
matches Rules left-to-right with OR.
Definition: matcher.h:91
static bool match(char c)
Definition: matcher.h:93
bool contains(char c, const std::initializer_list< char > &l)
check if a initizalizer list contains a character.
Definition: matcher.h:54
Container::const_iterator find(const Container &c, Value &&value)
Definition: generic.h:39
struct result result
Definition: result.h:34