Greetings.
I am kind of newbie to Boost.Fusion.
I have a sequence of "Field"s:
typedef fusion::vector<
Field,
Field,
Field,
...
MySequence;
Each "Field" knows how to (de)serialize, has some checking policy and a few
more little stuff.
"Field" also has a "int" property "TypeSize":
static const int TypeSize = somevalue_known_at_compile_time;
I'd like to traverse the type "MySequence" and get the sum of all the sizes
at compile time.
Like:
Field::TypeSize + Field::TypeSize +
Field::TypeSize + ... ;
I tried playing with fusion::accumulate and mpl but couldn't do it.
There's no much documentation/examples about fusion (correct me if I am
wrong please).
How can I get the accumulated sum of Field<...>::TypeSize of all the members
in "MySequence"?
Thanks in advance,
Benedetto
PS: It's not really a priority (the cost of doing that at runtime once for
object is minimal), but I'd really like to fully understand Fusion, which I
have found very useful so far.