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

What is the correct way to use boost::qi::rule with BOOST_FUSION_ADAPT_STRUCT?

I am attempting to get a qi::rule<> to emit a struct with BOOST_FUSION_ADAPT_STRUCT based on the boost employee example. I have the following struct and its associated fusion macro: struct LineOnCommand { int lineNum; std::vector
stix
  • 1,140
  • 13
  • 36
2
votes
2 answers

Compiler error when adapting struct with BOOST_FUSION_ADAPT_STRUCT

#include #include #include #include #include #include namespace qi = boost::spirit::qi; struct VectorWrapper { …
Ashot
  • 10,807
  • 14
  • 66
  • 117
2
votes
1 answer

Iterate elements in BOOST_FUSION_ADAPT_ADT struct?

Is there anyways to fusion::for_each() to iterate through a1 and a2 in a BOOST_FUSION_ADAPT_ADT or BOOST_FUSION_ADAPT_ASSOC_ADT, just like if adapted using BOOST_FUSION_ADAPT_STRUCT? class A { private: int a1_; double a2_; public: void…
surfcode
  • 445
  • 1
  • 5
  • 20
2
votes
2 answers

Filling a std::tuple

I have a overloaded function which looks like: template T getColumn(size_t i); template<> std::string getColumn(size_t i) { if(i == 0) return "first"; else return "other"; } template<> int…
zigarrre
  • 70
  • 6
2
votes
1 answer

compile time vs run time with boost::fusion

I'm pretty new to Boost fusion and maybe my question does not make any sense. Fusion is presented as : "the fusion between runtime and compile time algorithms". I think i'm getting lost between what is done at compile time and what is done at run…
Laurent
  • 812
  • 5
  • 15
2
votes
1 answer

boost::fusion accessing key type of joint view as map

I'm trying to convert the ash framework to c++ to incorporate to my project, my development environment is Vista 32, and Visual C++ 2008 Express, and I'm using boost_1_37_0 libs, im not planning on upgrade the environemt until i reach some…
2
votes
1 answer

Assigning to a map of references from a map of values/references

I want to be able to assign to a boost::fusion::map of references values from both: a boost::fusion::map of values, and a boost::fusion::map of references. What is the right (generic and idiomatic) way to do this? // Let: using bf =…
gnzlbg
  • 7,135
  • 5
  • 53
  • 106
2
votes
1 answer

Boost Fusion compile error in VS 2013 RC

Hello I got the latest Boost from trunk which builds with VS 2013 RC. Built boost, it worked. But when compiling my project against Boost, where I make use of Boost Fusion. I'm getting 100's of these error messages-- Error 1086 error C3520:…
Froglegs
  • 1,095
  • 1
  • 11
  • 21
2
votes
1 answer

Template recursion differentiating between datatypes in a boot::tuple

Problem: I need a functional object of A to recurse for data types of boost::tuple but do something else for all other data types of the incoming member t. class A{ public: template void operator()(T& t) const{ // if (t ==…
dos
  • 135
  • 1
  • 6
2
votes
1 answer

parse string into struct with boost spirit

I have the following code I need to parse a string and move it to a struct defined as follows: #include "boost\spirit\include\classic.hpp" #include "boost\spirit\include\qi.hpp" #include #include…
2
votes
3 answers

apply boost::fusion::for_each to boost::fusion::vector with mutable function object

I am trying to use boost::fusion::vector. However, I am in trouble with the very simple problem. #include #include #include #include using namespace std; struct…
Sungmin
  • 2,499
  • 3
  • 26
  • 32
2
votes
2 answers

Tag dispatching on mixed runtime/compile time condition

I have the following tag dispatching code (see LiveWorkSpace) #include // traits types struct A {}; struct B {}; struct C {}; // helpers void fun_impl(bool, A) { std::cout << "A\n"; } void fun_impl(bool, B) { std::cout << "B\n"; } //…
TemplateRex
  • 69,038
  • 19
  • 164
  • 304
2
votes
1 answer

Add references to a boost::fusion::vector

I want to create a boost fusion vector with references to variables. The goal is to pass to a function a various number of parameters and add them to the fusion vector. Because of the reference types, I add every element one at a time with TMP. But…
Jodebo
  • 125
  • 6
2
votes
1 answer

Unable to convert boost::fusion struct in boost::variant while using boost::spirit

Good time of day! I wrote this piece of code and expect it being able to be compiled. #include #include #include #include #include…
svv
  • 436
  • 2
  • 12
2
votes
1 answer

Is it possible to nest a fusion map inside a fusion map?

I am new to fusion. Is it possible to nest a fusion map inside a fusion map? How do i write code to resolve to B at the below example? #include #include #include struct A…
Bryan Fok
  • 3,277
  • 2
  • 31
  • 59