Open Bockeman opened 2 years ago
That's about variant
support for containers parsing:
#include <boost/spirit/home/x3.hpp>
#include <boost/spirit/home/x3/support/ast/variant.hpp>
int main() {
namespace x3 = boost::spirit::x3;
char const* iter = "/*c*/", * const end = iter + std::strlen(iter);
x3::variant<std::string, bool> x;
x3::parse(iter, end, +x3::char_, x);
}
This code fails to compile:
But if the text between the delimiters is wrapped as a separate rule, then it does compile.
_This is a simplified version, where in reality
tagged_string
is not just a std::string but contains addition tagging information._