1 // (C) Copyright Vesa Karvonen 2004.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE.)
7 # include "static_assert.h"
8 # include "is_same.hpp"
9 # include "typelist.hpp"
13 // To test our `TYPELIST'-macro, we'll first exercise the base
16 using namespace typelist
;
18 STATIC_ASSERT(is_same
<TYPELIST(), nil
>::value
);
20 // Then we'll try a list of 3-types:
22 STATIC_ASSERT(is_same
<TYPELIST((float)
27 cons
<long double, nil
> > > >::value
);
29 // Finally we'll try a list containing commas:
32 (is_same
<TYPELIST((std::pair
<signed char, unsigned char>)
33 (std::pair
<signed short, unsigned short>)
34 (std::pair
<signed int, unsigned int>)
35 (std::pair
<signed long, unsigned long>)),
36 cons
<std::pair
<signed char, unsigned char>,
37 cons
<std::pair
<signed short, unsigned short>,
38 cons
<std::pair
<signed int, unsigned int>,
39 cons
<std::pair
<signed long, unsigned long> > > > > >::value
);
43 // How can one define a ``variadic'' template metafunction? (Hint:
44 // Consider default template arguments.)