Rev | Line | |
---|
[12] | 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 | // $Source: /cvsroot/boost/boost/libs/mpl/test/quote.cpp,v $ |
---|
| 11 | // $Date: 2004/09/02 15:41:35 $ |
---|
| 12 | // $Revision: 1.3 $ |
---|
| 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 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.