Problem with Spirit Qi and inherited attributes reference

Hello,
This is my first time using boost and spirit. I am trying to find
construct a tree from a string input. While parsing I am trying to assign
each created node a number. For this purpose I am using a inherited
attribute, an integer reference. But when I check on the values assigned. It
is not the value of the integer reference rather some other value (some
consistent value). I am sure this must be something that I am overlooking.
But I am not sure what exactly.
Thanks for your help,
Anand Kumar.
Code:
struct node;
struct term {
bool visited;
int cnt;
int val;
term(bool b = false, int cn = -1, int v = numeric_limits<int>::min())
{
visited = b;
cnt = cn;
val = v;
}
};
BOOST_FUSION_ADAPT_STRUCT(
::term,
(bool, visited)
(int, cnt)
(int, val)
)
typedef boost::variant
participants (1)
-
Anand kumar