Skip to content

Check parsed values before they are assigned to the variable #743

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

You must be logged in to vote

Hello everyone,
I am sorry for the question. I think , i found the solution in the documentation "Store a Parsed Attribute Value into a Container (Qi)". The solution may be (See below). If you have other suggestion to do it more generic. Please lead me know

#include <boost/spirit/include/qi.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/lexical_cast.hpp>
#include <string>
#include <vector>
#include <iostream>

using namespace boost::spirit;

struct vMinMaxValue
{
    int valuMin;
    int valuMax;
};

BOOST_FUSION_ADAPT_STRUCT(
    vMinMaxValue,
  (int, valuMin)
  (int, valuMax)
)

namespace boost { namespace spirit { 

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Omar-Medina
Comment options

You must be logged in to vote
1 reply
@Omar-Medina
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants