Questions tagged [boost-fusion]

Boost.Fusion is a library for working with heterogenous collections of data, commonly referred to as tuples.

Boost.Fusion is a library for working with heterogenous collections of data, commonly referred to as tuples. A set of containers (vector, list, set and map) is provided, along with views that provide a transformed presentation of their underlying data. Collectively the containers and views are referred to as sequences, and Fusion has a suite of algorithms that operate upon the various sequence types, using an iterator concept that binds everything together.

222 questions
0
votes
1 answer

boost fusion question

I'm having trouble compiling the following (I'm new at fusion). In particular, I'm not sure where "_" (in is_same) comes from? From boost::lambda? Boost::mpl? What include do I need for this to compile? template struct check { const…
Frank
  • 4,341
  • 8
  • 41
  • 57
0
votes
1 answer

Is it possible to use Boost.Spirit V2.x without Boost.Fusion?

Is it really necessary to wrap structs/classes with Boost.Fusion in order to use them with Boost.Spirit V2.x (especially Boost.Spirit.Qi)? I would much rather use semantic actions to assign to members. If my memory serves me well, this is the way it…
kloffy
  • 2,928
  • 2
  • 25
  • 34
0
votes
1 answer

How to check if a boost fusion sequence is an adapted struct?

Is there a trait or meta function or anything to check at compile time if a sequence is actually an adapted struct, so that I could e.g. get its member names? I saw people doing that by exclusion, something along the lines of “if it’s not a vector…
Vlad.Z
  • 160
  • 10
0
votes
1 answer

Getting a list of member types from a boost fusion adapted struct

I have boost fusion adapted structs like this one: struct A { int x; double y; std::string z; }; BOOST_FUSION_ADAPT_STRUCT( A, x, y, z ) I'd like to iterate over the types of the adaptation at compile time. E.g. if I…
Vladimir
  • 117
  • 2
  • 8
0
votes
2 answers

Parsing struct with enum fields and STL containers easily using Boost Spirit/Fusion

new to boost, I actually need boost spirit to write a simple parser to fill some data structure. Here are roughly what they look like: struct Task { const string dataname; const Level level; const string aggregator; const set
Nick Skywalker
  • 1,027
  • 2
  • 10
  • 26
0
votes
1 answer

Boost fusion oddity

I am trying out Fusion and found something very odd... Here is the code... I have highlighted the problematic code with // ############ TROUBLE HERE ###### #include #include #include #include // …
zrb
  • 721
  • 1
  • 6
  • 15
0
votes
0 answers

Include counter in boost::fusion::for_each

For my current project it is necessary to iterate over a boost::fusion container. For this I found boost::fusion::for_each quite useful. Now it is necessary for me to increase a counter for each time the operator() of Functor got called. Firstly, I…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
0
votes
1 answer

Getting the index of boost::fusion::vector from a boost::mpl::vector

I started to play around with the boost fusion and mpl library and got stuck with a quite simple problem. I declared the following types: typedef boost::mpl::vector TypeVector; typedef boost::fusion::vector
mkaes
  • 13,781
  • 10
  • 52
  • 72
0
votes
0 answers

boost phoenix eval failures

While trying to make a smaller reproducible case from my code base, I reach the code below. For me, it fails to compile with g++6.1 and boost 1.60 and boost develop. The grammars and rules use default types for the skipper and the other bit and only…
MMM
  • 910
  • 1
  • 9
  • 25
0
votes
1 answer

Boost fusion using transform in for_each

I'm trying to build a small C++ example using boost fusion. However, Visual Studio 2013 gives me build errors for the following piece of code. It should simply go over a associative struct and print all member names to the console: #include…
bender
  • 613
  • 1
  • 8
  • 23
0
votes
1 answer

Using range for on a boost FUSION sequence

I am trying to print struct members as follows: #include #include #include struct Node { int a = 4; double b =…
AlwaysLearning
  • 7,257
  • 4
  • 33
  • 68
0
votes
2 answers

Compile time switch generation based on number of fields in structure

How in C++03 get in compile time number of members of chosen struct? I was experimenting with BOOST_FUSION_ADAPT_STRUCT but I did't get any working example. I want to generate switch statement in compile time, where there will be one case per each…
Adrian
  • 71
  • 1
  • 12
0
votes
2 answers

BOOST_PP_REPEAT with boost::fusion::size

I want to iterate in compile time over struct and write to output number of iteration. Just to mention - in real case I will pass some more parameters in data. #include #include #include #include…
Adrian
  • 71
  • 1
  • 12
0
votes
1 answer

Merge two Boost Fusion maps based on keys

I have two boost::fusion::maps that I want to merge in a certain way. For the two maps I want to generate a third that has all the keys present in both maps and the values are added if both a present. For example: #include…
alfC
  • 14,261
  • 4
  • 67
  • 118
0
votes
2 answers

Which container types are supported by a boost::spirit parser and boost::fusion?

I'd like to ask this question on a very generic level: How far does the support of container types by boost::spirit / boost::fusion reach? Can anybody give me some generic guidance on what is possible and what is not possible? With "support" I mean…
user23573
  • 2,479
  • 1
  • 17
  • 36
1 2 3
14
15