fix: clang < 16 can't emplace back struct with no constructor

This commit is contained in:
Brenno Lemos 2023-10-12 17:30:32 -03:00
parent ee652677a6
commit c59264d6b4
1 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,12 @@ struct Rule {
std::regex rule;
std::string repr;
int priority;
// Fix for Clang < 16
// See https://en.cppreference.com/w/cpp/compiler_support/20 "Parenthesized initialization of
// aggregates"
Rule(std::regex rule, std::string repr, int priority)
: rule(rule), repr(repr), priority(priority) {}
};
int default_priority_function(std::string& key);