forked from boostorg/mpl
merge new MPL version from 'mplbook' branch
[SVN r24874]
This commit is contained in:
+16
-18
@@ -1,30 +1,28 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// boost mpl/test/sizeof.cpp source file
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2001-2004
|
||||
//
|
||||
// Copyright (c) 2001-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/sizeof.hpp"
|
||||
#include "boost/static_assert.hpp"
|
||||
// $Source$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
namespace mpl = boost::mpl;
|
||||
#include <boost/mpl/sizeof.hpp>
|
||||
#include <boost/mpl/aux_/test.hpp>
|
||||
|
||||
struct my
|
||||
{
|
||||
char a[100];
|
||||
};
|
||||
|
||||
int main()
|
||||
MPL_TEST_CASE()
|
||||
{
|
||||
BOOST_STATIC_ASSERT(mpl::sizeof_<char>::type::value == sizeof(char));
|
||||
BOOST_STATIC_ASSERT(mpl::sizeof_<int>::type::value == sizeof(int));
|
||||
BOOST_STATIC_ASSERT(mpl::sizeof_<double>::type::value == sizeof(double));
|
||||
BOOST_STATIC_ASSERT(mpl::sizeof_<my>::type::value == sizeof(my));
|
||||
return 0;
|
||||
MPL_ASSERT_RELATION( sizeof_<char>::value, ==, sizeof(char) );
|
||||
MPL_ASSERT_RELATION( sizeof_<int>::value, ==, sizeof(int) );
|
||||
MPL_ASSERT_RELATION( sizeof_<double>::value, ==, sizeof(double) );
|
||||
MPL_ASSERT_RELATION( sizeof_<my>::value, ==, sizeof(my) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user