forked from boostorg/mpl
merge new MPL version from 'mplbook' branch
[SVN r24874]
This commit is contained in:
+21
-23
@@ -1,31 +1,29 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost mpl/test/back.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/back.hpp"
|
||||
#include "boost/mpl/range_c.hpp"
|
||||
#include "boost/mpl/assert_is_same.hpp"
|
||||
#include "boost/static_assert.hpp"
|
||||
// $Source$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
namespace mpl = boost::mpl;
|
||||
#include <boost/mpl/back.hpp>
|
||||
#include <boost/mpl/range_c.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
int main()
|
||||
template< typename Seq, int value > struct back_test
|
||||
{
|
||||
typedef mpl::range_c<int,0,1> range1;
|
||||
typedef mpl::range_c<int,0,10> range2;
|
||||
typedef mpl::range_c<int,-10,0> range3;
|
||||
|
||||
BOOST_STATIC_ASSERT(mpl::back<range1>::type::value == 0);
|
||||
BOOST_STATIC_ASSERT(mpl::back<range2>::type::value == 9);
|
||||
BOOST_STATIC_ASSERT(mpl::back<range3>::type::value == -1);
|
||||
typedef typename back<Seq>::type t;
|
||||
MPL_ASSERT_RELATION( t::value, ==, value );
|
||||
};
|
||||
|
||||
return 0;
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
back_test< range_c<int,0,1>, 0 >();
|
||||
back_test< range_c<int,0,10>, 9 >();
|
||||
back_test< range_c<int,-10,0>, -1 >();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user