Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / mpl / test / aux_ / template_arity.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/aux_/template_arity.hpp>
15 #include <boost/mpl/aux_/test.hpp>
16
17 #if defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
18
19 struct my {};
20 template< typename T1 > struct my1 {};
21 template< typename T1, typename T2 = void > struct my2 {};
22
23 MPL_TEST_CASE()
24 {
25     MPL_ASSERT_RELATION( (aux::template_arity<my>::value), ==, -1 );
26     MPL_ASSERT_RELATION( (aux::template_arity< my1<int> >::value), ==, 1 );
27     MPL_ASSERT_RELATION( (aux::template_arity< my2<int,long> >::value), ==, 2 );
28     MPL_ASSERT_RELATION( (aux::template_arity< my2<int> >::value), ==, 2 );
29 }
30
31 #endif