O'Reilly logo

Boost C++ Application Development Cookbook by Antony Polukhin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Manipulating a vector of types

The task of this recipe will be to modify the content of one boost::mpl::vector function depending on the content of a second boost::mpl::vector function. We'll be calling the second vector as the vector of modifiers and each of those modifiers can have the following type:

// Make unsigned 
struct unsigne; // No typo: 'unsigned' is a keyword, we cannot use it.

// Make constant
struct constant;

// Otherwise we do not change type
struct no_change;

So where shall we start?

Getting ready

A basic knowledge of Boost.MPL is required. Reading the Using type "vector of types" recipe and Chapter 4, Compile-time Tricks, may help.

How to do it...

This recipe is similar to the previous one, but it also uses conditional compile-time ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required