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
3
votes
1 answer

Parsing a structure in an associative manner with Boost Spirit and Fusion

I'm trying to parse a key-value string into a structure. Some key-values may be absent or may be in different order, so I wanted to use boost::fusion to adapt the structure and then parse into it with at_key<> directive. #include #include…
Lyth
  • 2,171
  • 2
  • 29
  • 37
3
votes
2 answers

generate fusion::vector from mpl::vector

How to generate fusion::vector from mpl::vector? How to generate mpl::vector from fusion::vector? BOOST_MPL_ASSERT((is_same< fusion::vector, generate_fusion_vector >::type…
Andreo
  • 597
  • 5
  • 19
2
votes
0 answers

c++ boost mpl/fusion vectors dynamic push_back

I am new to TMP world and I need some help regarding the use of vectors in boost mpl or fusion. So here is the situation: I have an API for asynchronous function calls in a multithreaded environment which is implemented as a runtime library…
2
votes
0 answers

how to apply fusion::at_c or fusion::at_key to the result of fusion::filter_if?

I'm using boost::fusion in a project. It is my first time using it and things are getting complicated. Playing around I wrote the following program: #include #include #include #include…
sinad
  • 137
  • 10
2
votes
1 answer

Interaction between runtime and fusion sequences

Further to my question C++ Tuple of Boost.Range - get Tuple of element types? I have the following: TupleOfRanges ranges; TupleOfElements elements; std::vector offsets; All containers (both meta and runtime) are of size N. I would like to…
paperjam
  • 8,321
  • 12
  • 53
  • 79
2
votes
1 answer

convert boost::fusion::set to boost::fusion::map by using boost::fusion::fold

I have a fusion set and would like to convert it into a fusion map. #include #include #include #include #include #include…
DF24
  • 53
  • 4
2
votes
1 answer

Parsing variant of struct with a single member using Boost Spirit X3 and Fusion

I am trying to parse a std::Variant with a fusion-adapted Struct type that contains a single member. After several hours of trying to figure out the problem, I was able to reproduce the issue with this code: struct TestStruct { float…
Jaime Ivan Cervantes
  • 3,579
  • 1
  • 40
  • 38
2
votes
1 answer

Boost.Spirit.Qi grammar for default values in Boost.Fusion adapt struct

struct coordinate { int x; int y; int z; }; BOOST_FUSION_ADAPT_STRUCT( coordinate, (int, x) (int, y) (int, z) ) template struct coordinate_grammar : qi::grammar { …
Zak
  • 12,213
  • 21
  • 59
  • 105
2
votes
1 answer

How to transform types of boost::fusion::vector?

I need to define two types for specified typelist: first is boost::fusion::vector of these types and second is boost::fusion::vector where references and const are removed for each type in type list. For example, I have int, unsigned & and long…
Raider
  • 197
  • 2
  • 10
2
votes
1 answer

What is the equivalent of BOOST_FUSION_ADAPT_ASSOC in Boost.Hana?

In the good old days we used to adapt a struct into a Boost.Fusion container or an associative container with #include #include struct Person{ …
alfC
  • 14,261
  • 4
  • 67
  • 118
2
votes
1 answer

How to serialize fusion::vector?

Tell me, how can I serialize/deserialize the fusion::vector object type? Thanks.
niXman
  • 1,698
  • 3
  • 16
  • 40
2
votes
1 answer

Using spirit to parse into classes?

Below is the employee.cpp source file from the boost spirit documentation. It's 'struct employee' followed by a macro that tells fusion about 'struct employee', followed by the employee parser. I am trying to adapt this for my purposes, but rather…
Ender
  • 1,652
  • 2
  • 25
  • 50
2
votes
1 answer

boost::spirit::karma grammar: Comma delimited output from struct with optionals attributes

I need a comma delimited output from a struct with optionals. For example, if I have this struct: MyStruct { boost::optional one; boost::optional two; boost::optional three; }; An output like: { "string", 1,…
Emi
  • 23
  • 4
2
votes
1 answer

fold with a fusion::vector initialized state

Applying boost::fusion::fold with a std::vector initial state works fine. #include #include #include #include struct A; struct B; struct…
hhbilly
  • 1,265
  • 10
  • 18
2
votes
3 answers

Compile-Time container of functors for controlling an algorithm?

Suppose i want something simple like the following: I have an core-algorithm, which randomly selects one of the specialized algorithms (specialized at compile-time) and process this algorithm. These specialized algorithms are implemented trough…
sascha
  • 32,238
  • 6
  • 68
  • 110