2004-09-02 15:41:37 +00:00
|
|
|
|
|
|
|
|
// Copyright Eric Friedman 2003
|
2003-11-04 01:38:26 +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.
|
2003-11-04 01:38:26 +00:00
|
|
|
|
2008-10-10 09:21:07 +00:00
|
|
|
// $Id$
|
2004-09-02 15:41:37 +00:00
|
|
|
// $Date$
|
|
|
|
|
// $Revision$
|
2003-11-04 01:38:26 +00:00
|
|
|
|
|
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
#include <boost/mpl/index_of.hpp>
|
|
|
|
|
#include <boost/mpl/list.hpp>
|
|
|
|
|
#include <boost/mpl/void.hpp>
|
2014-09-19 18:55:00 -06:00
|
|
|
#include <boost/mpl/aux_/test.hpp>
|
2003-11-04 01:38:26 +00:00
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
MPL_TEST_CASE()
|
2003-11-04 01:38:26 +00:00
|
|
|
{
|
2004-09-02 15:41:37 +00:00
|
|
|
typedef list< int, double, float >::type types;
|
2003-11-04 01:38:26 +00:00
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
typedef index_of< types, int >::type index_of_int;
|
|
|
|
|
typedef index_of< types, double >::type index_of_double;
|
|
|
|
|
typedef index_of< types, float >::type index_of_float;
|
|
|
|
|
typedef index_of< types, char >::type index_of_char;
|
2003-11-07 03:49:58 +00:00
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
MPL_ASSERT_RELATION( index_of_int::value, ==, 0 );
|
|
|
|
|
MPL_ASSERT_RELATION( index_of_double::value, ==, 1 );
|
|
|
|
|
MPL_ASSERT_RELATION( index_of_float::value, ==, 2 );
|
2003-11-04 01:38:26 +00:00
|
|
|
|
2004-09-02 15:41:37 +00:00
|
|
|
MPL_ASSERT(( is_void_< index_of_char > ));
|
2003-11-04 01:38:26 +00:00
|
|
|
}
|