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

Parsing Selector struct with alternating tokens using Boost Spirit X3

I am trying to parse the following struct: struct Selector { std::string element; std::string id; std::vector classes; }; This struct is used to parse selectors in the form element#id.class1.class2.classn. These selectors…
Jaime Ivan Cervantes
  • 3,579
  • 1
  • 40
  • 38
1
vote
1 answer

Function overloading error

I can't understand why the code behaves this way? #include #include #include #include #include…
niXman
  • 1,698
  • 3
  • 16
  • 40
1
vote
1 answer

Does Fusion have a tail function?

I need a tail-like funciton that can be used like this: boost::fusion::vector a('a', 12, 5.5f); boost::fusion::vector b(12, 5.5f); boost::fusion::copy( Tail(a), b );
alfC
  • 14,261
  • 4
  • 67
  • 118
1
vote
1 answer

Boost fusion and runtime collection growing

I have boost::fusion::vector<> args; args = boost::fusion::push_back(args, 100); std::cout << boost::fusion::size(args) << std::endl; The cout shows me size equals to 0. View code here: cpp.sh/3xcwsi Can I have any non associative boost fusion…
Vladimir Tsyshnatiy
  • 989
  • 1
  • 10
  • 20
1
vote
2 answers

using Boost.Fusion list of function

I am trying to apply list of function object to some value in the following code. But this code cause err boost_1_44\boost\fusion\algorithm\iteration\detail\for_each.hpp(82): error C2064: How to apply list of function object to some…
1
vote
2 answers

convert `boost::tuple` to `boost::fusion::tuple`

I need to convert a boost::tuple to the corresponding boost::fusion::tuple. I have figured out the corresponding type. But I expect there is an inbuilt function to do this. I really don't want to reinvent such things. I have searched in the boost…
Neel Basu
  • 12,638
  • 12
  • 82
  • 146
1
vote
1 answer

BOOST_FUSION_ADAPT_ADT explodes when using with boost::karma

I'm not sure if this is related to Error when adapting a class with BOOST_FUSION_ADAPT_ADT ,but even if it is, the question behind it is still not answered/still fails see the comment of the author Error when adapting a class with…
1
vote
0 answers

Will translation units built with different FUSION_MAX_VECTOR_SIZE (and similar) be linkable with each other?

I work on a large computational project that heavily use boost::mpl and boost:fusion on C++11. Sometimes, in order to get some translation units to compile, I have to define the following BOOST…
Adam Ryczkowski
  • 7,592
  • 13
  • 42
  • 68
1
vote
1 answer

Issue trying to compile Spirit.Qi parser

Below is a fully self-contained example. The problem appears to be lines 84-89 - if those lines are commented out, the example compiles. What I'm trying to parse is each line of a file, with five colon-delimited items, with the last three items…
Brett Gmoser
  • 1,702
  • 1
  • 12
  • 19
1
vote
1 answer

How to get member type of boost::mpl placeholders during fold

Say there are two classes: struct A { using Key = int; using Value = char; }; struct B { using Key = char; using Value = float; }; I want to use their member types to define the Fusion map: typedef boost::fusion::map < …
Tarc
  • 3,214
  • 3
  • 29
  • 41
1
vote
1 answer

spirit x3 how to add a vector to an AST

I'm trying to parse a file and have the data copied into a vector within a class object. I've taken the employee example and modified it to what I'm trying to do. The file being parsed looks like this (but more lines) ... 1 0.2 0.3 0.4 I've added a…
Ender
  • 1,652
  • 2
  • 25
  • 50
1
vote
1 answer

Creating a new boost fusion sequence using another one

Given a fusion sequence X, I would like to create a new fusion sequence Y whose implementation will be based on X. In particular, I would like to create a class template make_fusion_conforming so that template struct…
linuxfever
  • 3,763
  • 2
  • 19
  • 43
1
vote
1 answer

Generate boilerplate code by transforming arguments to string literals

In one of my projects I'm trying to achieve a more generic approach for writing our in-house simplified XML files. For this I successfully used boost-fusion. For every new XML file format the client has to write the following. Just assume, that the…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
1
vote
1 answer

error: boost.fusion::for_each() and struct derived from boost.tuple

on compilation this code: struct any_type: boost::tuple { ... }; struct functor { void operator()(const std::string& v) { std::cout << v << std::endl; } }; int main() { any_type type; …
niXman
  • 1,698
  • 3
  • 16
  • 40
1
vote
1 answer

How can I parse different structures with Boost.Spirit.Qi?

In this example, employee structs are parsed in the form "employee{int, string, string, double}". I would like to know whether it is possible to modify this example to also parse different types of structs, like "intern{int, string,…
xDD
  • 3,443
  • 1
  • 15
  • 12