merge new MPL version from 'mplbook' branch

[SVN r24874]
This commit is contained in:
Aleksey Gurtovoy
2004-09-02 15:41:37 +00:00
parent e2e70427cc
commit 1689c8ef83
1216 changed files with 89913 additions and 36752 deletions
+38 -42
View File
@@ -1,60 +1,56 @@
//-----------------------------------------------------------------------------
// boost mpl/test/vector_c.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
// Copyright Aleksey Gurtovoy 2000-2004
//
// Copyright (c) 2000-02
// Aleksey Gurtovoy
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/vector_c.hpp"
#include "boost/mpl/front.hpp"
#include "boost/mpl/size.hpp"
#include "boost/static_assert.hpp"
#include "boost/config.hpp"
// $Source$
// $Date$
// $Revision$
namespace mpl = boost::mpl;
#include <boost/mpl/vector_c.hpp>
#include <boost/mpl/front.hpp>
#include <boost/mpl/size.hpp>
#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200)
void test_bool_list()
#include <boost/mpl/aux_/test.hpp>
#if !BOOST_WORKAROUND(BOOST_MSVC, <=1200)
MPL_TEST_CASE()
{
typedef mpl::vector_c<bool,true>::type list1;
typedef mpl::vector_c<bool,false>::type list2;
typedef vector_c<bool,true>::type v1;
typedef vector_c<bool,false>::type v2;
BOOST_STATIC_ASSERT(mpl::front<list1>::type::value == true);
BOOST_STATIC_ASSERT(mpl::front<list2>::type::value == false);
MPL_ASSERT_RELATION( front<v1>::type::value, ==, true );
MPL_ASSERT_RELATION( front<v2>::type::value, ==, false );
}
#endif
void test_int_list()
MPL_TEST_CASE()
{
typedef mpl::vector_c<int,-1>::type list1;
typedef mpl::vector_c<int,0,1>::type list2;
typedef mpl::vector_c<int,1,2,3>::type list3;
typedef vector_c<int,-1> v1;
typedef vector_c<int,0,1> v2;
typedef vector_c<int,1,2,3> v3;
BOOST_STATIC_ASSERT(mpl::size<list1>::type::value == 1);
BOOST_STATIC_ASSERT(mpl::size<list2>::type::value == 2);
BOOST_STATIC_ASSERT(mpl::size<list3>::type::value == 3);
BOOST_STATIC_ASSERT(mpl::front<list1>::type::value == -1);
BOOST_STATIC_ASSERT(mpl::front<list2>::type::value == 0);
BOOST_STATIC_ASSERT(mpl::front<list3>::type::value == 1);
MPL_ASSERT_RELATION( size<v1>::value, ==, 1 );
MPL_ASSERT_RELATION( size<v2>::value, ==, 2 );
MPL_ASSERT_RELATION( size<v3>::value, ==, 3 );
MPL_ASSERT_RELATION( front<v1>::type::value, ==, -1 );
MPL_ASSERT_RELATION( front<v2>::type::value, ==, 0 );
MPL_ASSERT_RELATION( front<v3>::type::value, ==, 1 );
}
void test_unsigned_list()
MPL_TEST_CASE()
{
typedef mpl::vector_c<unsigned,0>::type list1;
typedef mpl::vector_c<unsigned,1,2>::type list2;
typedef vector_c<unsigned,0> v1;
typedef vector_c<unsigned,1,2> v2;
BOOST_STATIC_ASSERT(mpl::size<list1>::type::value == 1);
BOOST_STATIC_ASSERT(mpl::size<list2>::type::value == 2);
BOOST_STATIC_ASSERT(mpl::front<list1>::type::value == 0);
BOOST_STATIC_ASSERT(mpl::front<list2>::type::value == 1);
}
MPL_ASSERT_RELATION( size<v1>::type::value, ==, 1 );
MPL_ASSERT_RELATION( size<v2>::type::value, ==, 2 );
int main()
{
return 0;
MPL_ASSERT_RELATION( front<v1>::type::value, ==, 0 );
MPL_ASSERT_RELATION( front<v2>::type::value, ==, 1 );
}