boost-mpl Questions

5

I have an object interface and a open ended collection of interfaces that a derived object might want to support. // An object class IObject { getAttribute() = 0 } // A mutable object class IMut...

4

Solved

Sorry for asking so simple question, but I cannot find the answer easily. Google says nothing interesting about "C++ negation integral_constant" and similar queries. Is there in C++11 any trait th...
Complainant asked 6/2, 2013 at 20:3

1

Solved

Say I have these types: template < class T, template <class> class Storage > struct AbstractFactoryUnit { virtual ~AbstractFactoryUnit() {} virtual typename Storage< T >::Sto...
Trotman asked 17/1, 2013 at 20:13

2

Solved

Since you can take integral values as template parameters and perform arithmetic on them, what's the motivation behind boost::mpl::int_<> and other integral constants? Does this motivation st...
Psycho asked 17/1, 2013 at 22:37

1

Solved

I'm still evaluating if i should start using D for prototyping numerical code in physics. One thing that stops me is I like boost, specifically fusion and mpl. D is amazing for template meta-pro...
Bipropellant asked 11/1, 2013 at 22:12

1

Solved

I wonder if it is possible using boost::mpl/preprocessor or some noce C++11 features to create function proxy from class type and function name. Say we had: inline void set_email(const ::std::st...
Intermarriage asked 10/12, 2012 at 11:53

1

Solved

I am writing some message handling code, whereby each message is a POD structure. On way of writing this would be to define an abstract base class, with virtual functiosn for each message type e.g:...
Potboy asked 13/11, 2012 at 9:54

1

Solved

Context I have a custom comparator that takes another comparator and applies an additional check: template <template <typename> class Comparator, typename T> struct SoftOrder : public...
Camshaft asked 7/7, 2012 at 17:44

2

Solved

As C++ metaprogramming is functional: is there any way of doing something comparable to any functional programming language's (e.g. Haskell's) let or where construct? I'm using Boost::MPL but woul...
Aromatize asked 27/6, 2012 at 8:39

1

Solved

With C++11 i have the something like #include <boost/mpl/vector_c.hpp> #include <boost/mpl/size.hpp> #include <boost/array.hpp> #include <iostream> namespace mpl = boost...
Pinole asked 31/5, 2012 at 9:0

1

Solved

So I have a template class that I would like to accept an std::map where the data type is either a raw pointer or an std::unique_ptr. Then in this class I would like to get the type of the underlyi...
Lyrebird asked 24/5, 2012 at 23:29

1

I am currently doing some proof on concept samples with boost::mpl and am having some difficulties in understanding how the lambda function enables the use of placeholders. I realize that I can wr...
Earthenware asked 23/4, 2012 at 3:16

1

Solved

I believe my understanding of boost::mpl::set must be fundamentally flawed. I thought it only allowed unique types. But the following code compiles: #include <boost/mpl/set.hpp> #include &l...
Gadwall asked 22/3, 2012 at 10:23

3

Solved

I have a function that I want to perform on all the types in a typelist (currently represented by an mpl list --- is this even a reasonable way to approach it?) The key here is that the function o...
Thirzia asked 29/12, 2011 at 17:44

1

So imagine we had a mpl::vector we want to print (cout for example) it as such string: int, string, char. How to do such thing with boost::mpl?
Charinile asked 5/12, 2011 at 14:5

1

Solved

I have a class A that has a template parameter T. There are use cases where the class T offers a function func1() and there are use cases where T doesn't offer it. A function f() in A should call f...
Orest asked 7/10, 2011 at 11:43

4

Solved

I have a set of classes that have the following structure: class U { public: explicit U(int) { ... } U() {...} Init(int) {...} }; I need to be able to compose 1 or more of these classes into ...
Ablate asked 8/9, 2011 at 17:56

3

Solved

I use a class A from a library and want to add some functionality to it via an own class B. The user of class B should derive from it as if he would derive from class A. class A { public: virtua...
Spain asked 24/8, 2011 at 14:42

2

Solved

I'm new to boost::fusion and boost::mpl libraries. Could anyone please tell me the main difference between these two libraries? Until now I used only fusion::vector and few other simple things. N...
Divulgence asked 25/6, 2011 at 20:36

3

Solved

I'm trying to concatenate strings at compile-time using boost-mpl but am getting errors from gcc. Here's the sample - using namespace boost; using namespace std; template<class A> struct t...
Eastern asked 17/5, 2011 at 20:59

2

Solved

I want to take a list of class templates, T1, T2, ... TN and have a list an MPL list of classes, where each template is instantiated with the same parameter. boost::mpl::list cannot be used with a...
Molding asked 5/5, 2011 at 6:34

2

Solved

I have created a physics system that handles any collision object to any collision object like so: namespace Collision { template <typename T, typename U> inline void Check(T& t, U&amp...
Something asked 26/4, 2011 at 7:16

1

Solved

Hi in boost mpl documentation I have discovered mpl::string and the following example: typedef mpl::string<'hell','o wo','rld'> hello; I'm a little bit surprised because I thought that in ...
Integrator asked 25/4, 2011 at 10:48

2

Solved

I wrote some code to generate a boost::mpl::vector to use as a lookup table for a factorial function, as a test for a more general library function with which a developer may be able to generate a ...
Churchill asked 25/2, 2011 at 1:25

3

Solved

I am trying to create a list containing the permutations of a given type list. The below code seems to function, though without the intended result, when I use a specified list instead of generat...
Konya asked 22/12, 2010 at 19:13

© 2022 - 2024 — McMap. All rights reserved.