This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/type_traits/add_pointer.hpp> | |
#include <boost/type_traits/is_same.hpp> | |
#include <boost/static_assert.hpp> | |
template <class UnaryMetaFunctionClass, class Arg> | |
struct apply1 | |
: UnaryMetaFunctionClass::template apply<Arg> | |
{}; | |
template <class F, class X> | |
struct twice | |
: apply1<F, typename apply1<F,X>::type> | |
{}; | |
struct add_pointer_f | |
{ | |
template <class T> | |
struct apply : boost::add_pointer<T> {}; | |
}; | |
BOOST_STATIC_ASSERT(( | |
boost::is_same< | |
twice<add_pointer_f, | |
twice<add_pointer_f, int>::type>::type | |
, int**** | |
>::value | |
)); | |
int main() | |
{ | |
return 0; | |
} |