2004-09-02 15:41:37 +00:00
|
|
|
|
|
|
|
|
// Copyright Aleksey Gurtovoy 2000-2004
|
2002-09-16 19:25:33 +00:00
|
|
|
//
|
2004-09-02 15:41:37 +00:00
|
|
|
// Distributed under the Boost Software License, Version 1.0.
|
|
|
|
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
2004-07-26 00:32:12 +00:00
|
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
2004-09-02 15:41:37 +00:00
|
|
|
//
|
|
|
|
|
// See http://www.boost.org/libs/mpl for documentation.
|
2002-09-16 19:25:33 +00:00
|
|
|
|
2008-10-10 09:21:07 +00:00
|
|
|
// $Id$
|
2004-09-02 15:41:37 +00:00
|
|
|
// $Date$
|
|
|
|
|
// $Revision$
|
2002-09-16 19:25:33 +00:00
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
#include <boost/mpl/quote.hpp>
|
|
|
|
|
#include <boost/type_traits/is_same.hpp>
|
2014-09-19 18:55:00 -06:00
|
|
|
#include <boost/mpl/aux_/test.hpp>
|
2002-09-16 19:25:33 +00:00
|
|
|
|
2002-12-17 10:42:05 +00:00
|
|
|
template< typename T > struct f1
|
|
|
|
|
{
|
|
|
|
|
typedef T type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<
|
|
|
|
|
typename T1, typename T2, typename T3, typename T4, typename T5
|
|
|
|
|
>
|
|
|
|
|
struct f5
|
|
|
|
|
{
|
2004-09-02 15:41:37 +00:00
|
|
|
#if !defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS)
|
2002-12-17 10:42:05 +00:00
|
|
|
// no 'type' member!
|
2004-09-02 15:41:37 +00:00
|
|
|
#else
|
|
|
|
|
typedef f5 type;
|
|
|
|
|
#endif
|
2002-12-17 10:42:05 +00:00
|
|
|
};
|
2002-09-16 19:25:33 +00:00
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
MPL_TEST_CASE()
|
2002-09-16 19:25:33 +00:00
|
|
|
{
|
2004-09-02 15:41:37 +00:00
|
|
|
typedef quote1<f1>::apply<int>::type t1;
|
|
|
|
|
typedef quote5<f5>::apply<char,short,int,long,float>::type t5;
|
2014-09-19 18:55:00 -06:00
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
MPL_ASSERT(( boost::is_same< t1, int > ));
|
|
|
|
|
MPL_ASSERT(( boost::is_same< t5, f5<char,short,int,long,float> > ));
|
2002-09-16 19:25:33 +00:00
|
|
|
}
|