Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / mpl / test / quote.cpp
1
2 // Copyright Aleksey Gurtovoy 2000-2004
3 //
4 // Distributed under the Boost Software License, Version 1.0. 
5 // (See accompanying file LICENSE_1_0.txt or copy at 
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //
8 // See http://www.boost.org/libs/mpl for documentation.
9
10 // $Id$
11 // $Date$
12 // $Revision$
13
14 #include <boost/mpl/quote.hpp>
15 #include <boost/type_traits/is_same.hpp>
16 #include <boost/mpl/aux_/test.hpp>
17
18 template< typename T > struct f1
19 {
20     typedef T type;
21 };
22
23 template<
24       typename T1, typename T2, typename T3, typename T4, typename T5
25     >
26 struct f5
27 {
28 #if !defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS)
29     // no 'type' member!
30 #else
31     typedef f5 type;
32 #endif
33 };
34
35 MPL_TEST_CASE()
36 {
37     typedef quote1<f1>::apply<int>::type t1;
38     typedef quote5<f5>::apply<char,short,int,long,float>::type t5;
39     
40     MPL_ASSERT(( boost::is_same< t1, int > ));
41     MPL_ASSERT(( boost::is_same< t5, f5<char,short,int,long,float> > ));
42 }