C++ Template Metaprogramming
Solutions to the exercises throughout the book
Loading...
Searching...
No Matches
exercise-3-6.hpp
Go to the documentation of this file.
1// ===-- chapter-3/exercise-3-6.hpp ----------------------- -*- C++ -*- --=== //
9#ifndef EXERCISE_3_6
10#define EXERCISE_3_6
11
12#include <boost/mpl/apply.hpp>
13
14
28namespace exercise_3_6 {
29
32{
39 template <typename F, typename X>
40 struct apply
41 : boost::mpl::apply<F, typename boost::mpl::apply<F, X>::type> { };
42};
43
44} // namespace exercise_3_6
45
46#endif // EXERCISE_3_6
Encapsulate solution for Exercise 3-6.
When applied, performs the given function twice.
A lambda to perform a metafunction twice.