The task of this recipe is 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 may have the following type:
// Make unsigned. struct unsigne; // Not a typo: `unsigned` is a keyword, we can not use it. // Make constant. struct constant; // Otherwise we do not change type. struct no_change;
So, where shall we start from?
The basic knowledge of Boost.MPL
is required. Reading the Using type vector of types recipe and Chapter 4, Compile-time Tricks, may help.
This recipe is similar to the previous one, but it also uses conditional compile-time statements. Get ready, it won't be easy!
- We shall start with headers:
// We'll need this at step 3. #include <boost/mpl/size.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/static_assert.hpp> // We'll need this...