Skip to content

Overwriting and Avoiding multiple assignation to string-Variable in struct #747

Answered by Omar-Medina
Omar-Medina asked this question in Q&A

You must be logged in to vote

hello everyone,
probably useful for other person.
Add include #include <boost/phoenix/operator.hpp>
and
modify the line from:
txt = +(~boost::spirit::qi::char_(';')) ;
to:
txt = boost::spirit::qi::eps [boost::spirit::qi::val=""] >> +(~boost::spirit::qi::char(';')) [boost::spirit::qi::_val += boost::spirit::qi::_1];

#include <boost/spirit/include/qi.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/phoenix/operator.hpp>

#include <compare>
#include <string>
#include <set>
#include <iostream>

using namespace boost::spirit;

struct vMinMaxValue
{
  std::string name;
  int valuMin;
  int valuMax;

  vMinMaxValue() :
    name{"Undef"},
    valuMin{-5000},
    valuMax{5000}…

Replies: 1 comment

You must be logged in to vote
0 replies
Answer selected by Omar-Medina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant