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
1
vote
2 answers

Why is struct array member type within a boost::fusion sequence not correctly deduced?

I have the following sample code: #include #include #include #include namespace MySpace { struct TwoMembers { int intMember; char charMember[3]; …
Felix Petriconi
  • 675
  • 5
  • 11
1
vote
1 answer

Can spirit use a Factory instead of ADAPT_STRUCT to process rule?

I'd like to use a factory function in a semantic action, but I haven't been able to find the right recipe using phoenix or fusion. My spirit-qi rule that would look something like: object = type_identifier >> arg_list; and I'd like to have Fusion…
KentH
  • 1,204
  • 1
  • 14
  • 23
1
vote
0 answers

Problems with optional expression and parsing error position

I'm trying to write my first boost spirit parser for a specific messaging format and I encountered some problems. The boost library version used is 1.49.0! #include #include #include #include…
janr
  • 3,664
  • 3
  • 24
  • 36
1
vote
1 answer

Is it a boost spirit regression?

I have a boost spirit parser which works very well with boost 1.46.1, and which doesn't work with boost 1.54. This parser extract informations from the following sentence, which is a variable initialization in a DSEL : "Position…
Adrien BARRAL
  • 3,474
  • 1
  • 25
  • 37
1
vote
1 answer

Boost Fusion adapt declaration for a templated self referential structure

I am trying to declare a self referential tree like structure that is templated on the type of data that the struct can hold. I am running into compilation errors, when trying to declare the boost fusion template adapt definition for this structure.…
balas bellobas
  • 237
  • 3
  • 12
1
vote
1 answer

How to return boost::fusion::vector elements to add to a std::array>?

I have a std::array and a boost::fusion::vector which I want to pass in to func1(). This function will add a boost::fusion::vector instance to each std::array element. I have to use fusion::fold() so that I can add the correct number of…
1
vote
0 answers

boost fusion- what exactly is the emphasis of the compile-time abilities?

I have a few questions regarding boost::fusion 1) What exactly is the emphasis on the compile-time capabilities of fusion? Is it just to "glue" template metaprogramming with "normal" run-time programming (hence they say fusion is the mixing of…
user997112
  • 29,025
  • 43
  • 182
  • 361
1
vote
1 answer

Checking last element in a boost::fusion::for_each loop

I want to know if there is a way to check for the last element in a fusion for_each loop (in order to apply special code for this case) Edit : Maybe a better question should be : I have played with fusion::for_each, now I want to apply code on each…
Laurent
  • 812
  • 5
  • 15
1
vote
1 answer

Fusion vector projection

I have a fusion vector with elements which have several member data of different types and I would like to create a new fusion vector(s) that will project just specific data member(s). I've been looking into this for some time already but no…
G. Civardi
  • 667
  • 5
  • 12
1
vote
1 answer

Why fusion::map<> types not the same

Why type is not same as expected in the example below? using origin = boost::fusion::map< boost::fusion::pair >; using expected = boost::fusion::map< boost::fusion::pair ,boost::fusion::pair >; using…
niXman
  • 1,698
  • 3
  • 16
  • 40
1
vote
1 answer

Accessing the tail of a fusion::cons

How do I officially access the tail of a boost::fusion::cons object? I know I can do it easily by accessing the cdr data member of the cons structure, but the documentation of Boost 1.54.0 doesn't specify that there is such a member, so I guess I'm…
zrnzvxxy
  • 325
  • 1
  • 9
1
vote
2 answers

Accessing 0th element from boost::fusion::tuple

Normally I would access a regular tuple element (say 0) in the following way mytuple->get<0>(); However if the tuple is of the type boost::fusion::tuple how do I access the 0th element More Detail I have something like this typedef…
MistyD
  • 16,373
  • 40
  • 138
  • 240
1
vote
0 answers

Streaming strings into a boost::fusion::vector doesn't work?

I'd like to initialize a fusion::vector by streaming from std::cin. It seems this isn't possible as the documentation says: ...extracting Sequence(s) with std::string or C-style string elements does not generally work, since the streamed Sequence…
hhbilly
  • 1,265
  • 10
  • 18
1
vote
1 answer

Boost fusion/mpl issues after upgrade to a newer version

This is a simplified version of some code I wrote: #include #include #include #include #include #include…
sinad
  • 137
  • 10
1
vote
1 answer

Displaying a Flattened Phoenix Expression using Boost Fusion

Following the Expressions as Fusion Sequences section of the Proto User Guide, I get to the point where I iterate over a flattened proto expression: _1 + 2 + 3 + 4: #include #include namespace proto =…
user2023370
  • 10,488
  • 6
  • 50
  • 83