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
0
votes
2 answers

How to create an element for each type in a typelist and add it to a vector in C++?

In C++, I 'd like to create a new element (shared_ptr) for each type specified in a typelist (and add the resulting pointers to a vector). In pseudo code, this should look similar to this: vector< shared_ptr< baseT > > v; foreach(type T:
0
votes
1 answer

How to check result from boost::fusion:at_key?

Example from boost tutorial: using namespace fields; std::string person_name = at_key(a_person); int person_age = at_key(a_person); How to check wheather there is no such key in this map?
vitperov
  • 1,347
  • 17
  • 20
0
votes
1 answer

a dictionary with compile time keys, or types as keys

Take the following "type" dictionary -- its keys are supposed to be types, and values an instance of that type: class TypeDictionary { public: template void insert(T t); template T& get(); // implementation be here --…
Nick
  • 931
  • 6
  • 17
0
votes
1 answer

C++:Implementing "ash" Entity framework

I'm absolutely lost at trying to port the Richard Lord's Ash Framework to "pure" C++ (MSVC Express 2008) or at least i hasnt been able to find any implementation alike, I'm messing with the boost:fusion libs to implement the minimun reflection…
0
votes
0 answers

Semantics for wrapped objects: reference/value by default via std::move/std::ref

In recent times I am using often a natural idiom I "discovered" in C++11 that is that wrapped object can automatically hold reference when this is possible. The main question here will be about the comparison with the behavior of this "idiom" to…
alfC
  • 14,261
  • 4
  • 67
  • 118
0
votes
0 answers

Parsing a Boost:Tuple into a char* (with endianess)

I have many classes with varying implementations of their private member boost::tuple<> structures ie. or . I now need to parse that tuple into a private const char* message (since I want to send it via tcp),…
dos
  • 135
  • 1
  • 6
0
votes
1 answer

How to push back value to fusion vector during runtime?

How to push back value to fusion vector during runtime? typedef boost::fusion::vector vec_t; vec_t vec_; vec_.push_back(new A());
Bryan Fok
  • 3,277
  • 2
  • 31
  • 59
0
votes
1 answer

Returning arbitrary types from a function

I'd like to return an arbitrary type from a function. The return type depends dynamically on a polymorphic function call. Foe example, the following reads values from CSV files with different number of columns, struct File { virtual SOMETHING…
hhbilly
  • 1,265
  • 10
  • 18
0
votes
1 answer

enable_if boost::fusion callable

Is there a way to use enable_if specifically for boost::fusion callable objects? template void do_something(F f, enable_if< is_fusion_callable_object >::type * = 0) { // how to define the "is_fusion_callable_object<> ? } Here F…
David H
  • 1,461
  • 2
  • 17
  • 37
0
votes
0 answers

Is it possible to use boost to serialize and pretty-print polymorphic classes?

Is there a minimal way to use boost for marshalling/unmarshalling as well as pretty-printing structs with their field-names (RTTI?) ? It seems like you could use boost::fusion and then somehow automatically implement the boost::serialization…
Ross Rogers
  • 23,523
  • 27
  • 108
  • 164
0
votes
1 answer

Need example of using boost::fusion::filter_if metafunction

Given a boost::fusion::vector type, I want to filter out all the non-ref members to get a new type. For example this would transform boost::fusion::vector into boost::fusion::vector. I'm guessing the boost::fusion::filter_if meta function might be…
user60069
  • 111
  • 1
0
votes
1 answer

fusion::nview and const headaches

I have been stuck in the code for a while. I can work around the issue but feel very bad if I cannot even get the code to compile. The problems were described in the code. namespace fusion = boost::fusion; template struct…
Wood
  • 1
1 2 3
14
15