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

boost spirit semantic actions and fusion data types

I have a rule which is supposed to return a Boost.Fusion ASSOC_STRUCT. I am trying to assign to _val the results parsed by the rule's parsers, but I cannot make it work. I will skip the talking and present you directly with the relevant…
engineerX
  • 2,914
  • 2
  • 18
  • 18
1
vote
2 answers

with tuples and boost.fusion, is there any reason to use struct?

tuples are similar to structs (discussed here: Boost::Tuples vs Structs for return values). it seems that the only advantage is it's more convenient to write struct because it's shorter and by key rather than a number. one can also use fusion map…
kirill_igum
  • 3,953
  • 5
  • 47
  • 73
1
vote
2 answers

How to convert a std::vector to be a member of a struct in boost::spirit?

I have a chunk of Spirit code which correctly parses std::string input = "RED.MAGIC( 1, 2, 3 )[9].GREEN" into a simple std::vector, by using std::vector as the primary attribute. I would like to replace the…
kfmfe04
  • 14,936
  • 14
  • 74
  • 140
1
vote
2 answers

boost fusion and const correctness

I am learning boost fusion and am trying to take a view of a std::vector >. The code appears simple but I appear to be running into some problems with const. I clearly misunderstand something about const and…
rymurr
  • 444
  • 4
  • 11
1
vote
4 answers

Iterating over Boost fusion::vector

I'm trying to iterate over a boost::fusion vector using: typedef typename fusion::result_of::begin::type t_iter; std::cout << distance(begin(t), end(t)) << std::endl; for(t_iter it = begin(t); it != end(t); next(it)){ …
arlogb
  • 681
  • 1
  • 9
  • 19
1
vote
1 answer

C++: BOOST_FUSION_ADAPT_STRUCT Error When Using fusion::at

In the Boost.Fusion documentation it says that BOOST_FUSION_ADAPT_STRUCT makes a struct a fully compatible Boost.Fusion random access sequence. I tried the following: #include #include #include…
Tal Zion
  • 1,331
  • 2
  • 14
  • 23
1
vote
1 answer

How to instantiate a boost::fusion::vector member variable of a type which has no default constructor?

I am learning boost::mpl and I have the following class - #include #include #include #include #include #include…
vsky
  • 389
  • 1
  • 5
  • 14
1
vote
1 answer

How to iterate over a boost::fusion sequence?

I'm trying to initialise a list of args to use with fusion::invoke. The args are all of the form: template struct ArgWrapper { inline ArgWrapper(){} inline void Setup(lua_State*L,int idx) { //setup this value from…
DaedalusFall
  • 8,335
  • 6
  • 30
  • 43
1
vote
1 answer

Getting rid of references in an boost::fusion sequence

I'm trying to use Boost::Fusion to transform a list of function's parameter types into a fusion::list. Ultimately, I am trying to turn a list of variables into parameters that I can call a function with…
Abe Schneider
  • 977
  • 1
  • 11
  • 23
1
vote
0 answers

How to generate wrappings for C++ functions?

I'm trying to create a generic way to wrap C++ functions (from a different language). I have a list of parameters (and and an iterator) and a specific C++ function to be called on the list of parameters. I'm trying to find someway to unpack the list…
Abe Schneider
  • 977
  • 1
  • 11
  • 23
0
votes
1 answer

returning column from a std vector of fusion vectors, without copying

I have a "table" represented by a std::vector where every element is a boost::fusion::vector. I need to return a representation of a "column" of this table as a std::vector, without copying any values over. What is the best way of doing this? I am…
0
votes
1 answer

Boost phoenix actor as a fusion callable object

I was wondering if it was possible to create callable phoenix actors and use them in fusion sequences. Given the following source: struct FusionStruct { void Doit() const{std::cout << "Doit" << std::endl;} }; struct FusionCaller { template…
mkaes
  • 13,781
  • 10
  • 52
  • 72
0
votes
1 answer

Collect all boost fusion map keys into a std::tuple

Consider this snippet: #include #include #include #include struct MyEvents { struct EventA; struct…
Juergen
  • 3,489
  • 6
  • 35
  • 59
0
votes
1 answer

c++ Variadic boost fusion map alias template

Consider this snippet: #include #include struct MsgA {}; struct MsgB {}; using MsgList = std::tuple; template class MsgSignal {}; template
Juergen
  • 3,489
  • 6
  • 35
  • 59
0
votes
1 answer

reference to element in boost.fusion vector

EDIT - please ignore - the question resolved around a simple typo. I need a break. How do I access a reference to an element of a boost fusion vector? Unlike boost.tuples's tuples::get(variable) (returns a reference), the…
Tom
  • 5,219
  • 2
  • 29
  • 45