2
0
mirror of https://github.com/boostorg/parser.git synced 2026-01-19 04:22:13 +00:00

add "constexpr" to switch_parser constructor

so switch(predicate)(valA, parserA)(valB, parserB)
can result in a constexpr object.
This commit is contained in:
Andreas Buhr
2025-11-24 14:28:58 +01:00
committed by Zach Laine
parent bb183cf5ee
commit 00fe33d2f3

View File

@@ -8525,9 +8525,9 @@ namespace boost { namespace parser {
template<typename SwitchValue, typename OrParser>
struct switch_parser
{
switch_parser() {}
switch_parser(SwitchValue switch_value) : switch_value_(switch_value) {}
switch_parser(SwitchValue switch_value, OrParser or_parser) :
constexpr switch_parser() {}
constexpr switch_parser(SwitchValue switch_value) : switch_value_(switch_value) {}
constexpr switch_parser(SwitchValue switch_value, OrParser or_parser) :
switch_value_(switch_value), or_parser_(or_parser)
{}