mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-03 06:44:37 +02:00
This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'.
[SVN r17826]
This commit is contained in:
27
include/boost/mpl/bitwise.hpp
Normal file
27
include/boost/mpl/bitwise.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
#ifndef BOOST_MPL_BITWISE_HPP_INCLUDED
|
||||
#define BOOST_MPL_BITWISE_HPP_INCLUDED
|
||||
|
||||
// + file: boost/mpl/bitwise.hpp
|
||||
// + last modified: 09/mar/03
|
||||
|
||||
// Copyright (c) 2003
|
||||
// Aleksey Gurtovoy, Jaap Suter
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
#include "boost/mpl/bitand.hpp"
|
||||
#include "boost/mpl/bitor.hpp"
|
||||
#include "boost/mpl/bitxor.hpp"
|
||||
#include "boost/mpl/shift_left.hpp"
|
||||
#include "boost/mpl/shift_right.hpp"
|
||||
|
||||
#endif // BOOST_MPL_BITWISE_HPP_INCLUDED
|
31
include/boost/mpl/bool_fwd.hpp
Normal file
31
include/boost/mpl/bool_fwd.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
#ifndef BOOST_MPL_BOOL_FWD_HPP_INCLUDED
|
||||
#define BOOST_MPL_BOOL_FWD_HPP_INCLUDED
|
||||
|
||||
// + file: boost/mpl/bool_fwd.hpp
|
||||
// + last modified: 08/mar/03
|
||||
|
||||
// Copyright (c) 2000-03
|
||||
// Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template< bool C_ > struct bool_;
|
||||
|
||||
// shorcuts
|
||||
typedef bool_<true> true_;
|
||||
typedef bool_<false> false_;
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_BOOL_FWD_HPP_INCLUDED
|
25
include/boost/mpl/int_fwd.hpp
Normal file
25
include/boost/mpl/int_fwd.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
#ifndef BOOST_MPL_INT_FWD_HPP_INCLUDED
|
||||
#define BOOST_MPL_INT_FWD_HPP_INCLUDED
|
||||
|
||||
// + file: boost/mpl/int_fwd.hpp
|
||||
// + last modified: 08/mar/03
|
||||
|
||||
// Copyright (c) 2000-03
|
||||
// Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
template< int N > struct int_;
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_INT_FWD_HPP_INCLUDED
|
32
include/boost/mpl/integral_c_fwd.hpp
Normal file
32
include/boost/mpl/integral_c_fwd.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
#ifndef BOOST_MPL_INTEGRAL_C_FWD_HPP_INCLUDED
|
||||
#define BOOST_MPL_INTEGRAL_C_FWD_HPP_INCLUDED
|
||||
|
||||
// + file: boost/mpl/integral_c_fwd.hpp
|
||||
// + last modified: 08/mar/03
|
||||
|
||||
// Copyright (c) 2000-03
|
||||
// Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
#include "boost/mpl/aux_/config/workaround.hpp"
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
#if BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800))
|
||||
// the type of non-type template arguments may not depend on template arguments
|
||||
template< typename T, long N > struct integral_c;
|
||||
#else
|
||||
template< typename T, T N > struct integral_c;
|
||||
#endif
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_INTEGRAL_C_FWD_HPP_INCLUDED
|
25
include/boost/mpl/long_fwd.hpp
Normal file
25
include/boost/mpl/long_fwd.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
#ifndef BOOST_MPL_LONG_FWD_HPP_INCLUDED
|
||||
#define BOOST_MPL_LONG_FWD_HPP_INCLUDED
|
||||
|
||||
// + file: boost/mpl/long_fwd.hpp
|
||||
// + last modified: 08/mar/03
|
||||
|
||||
// Copyright (c) 2000-03
|
||||
// Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
template< long N > struct long_;
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_LONG_FWD_HPP_INCLUDED
|
29
include/boost/mpl/size_t.hpp
Normal file
29
include/boost/mpl/size_t.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
#ifndef BOOST_MPL_SIZE_T_HPP_INCLUDED
|
||||
#define BOOST_MPL_SIZE_T_HPP_INCLUDED
|
||||
|
||||
// + file: boost/mpl/size_t.hpp
|
||||
// + last modified: 08/mar/03
|
||||
|
||||
// Copyright (c) 2000-03
|
||||
// Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
#include "boost/mpl/size_t_fwd.hpp"
|
||||
|
||||
#define AUX_WRAPPER_VALUE_TYPE std::size_t
|
||||
#define AUX_WRAPPER_NAME size_t
|
||||
#define AUX_WRAPPER_PARAMS(N) std::size_t N
|
||||
|
||||
#include "boost/mpl/aux_/integral_wrapper.hpp"
|
||||
|
||||
#endif // BOOST_MPL_SIZE_T_HPP_INCLUDED
|
28
include/boost/mpl/size_t_fwd.hpp
Normal file
28
include/boost/mpl/size_t_fwd.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
#ifndef BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
|
||||
#define BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
|
||||
|
||||
// + file: boost/mpl/size_t_fwd.hpp
|
||||
// + last modified: 08/mar/03
|
||||
|
||||
// Copyright (c) 2000-03
|
||||
// Aleksey Gurtovoy
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
#include "boost/config.hpp" // make sure 'size_t' is placed into 'std'
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
template< std::size_t N > struct size_t;
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
|
66
test/bitwise.cpp
Normal file
66
test/bitwise.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
// + file: libs/mpl/test/bitwise.cpp
|
||||
// + last modified: 09/mar/03
|
||||
|
||||
// Copyright (c) 2001-03
|
||||
// Aleksey Gurtovoy, Jaap Suter
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appears in all copies and
|
||||
// that both the copyright notice and this permission notice appear in
|
||||
// supporting documentation. No representations are made about the
|
||||
// suitability of this software for any purpose. It is provided "as is"
|
||||
// without express or implied warranty.
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
#include "boost/mpl/bitwise.hpp"
|
||||
#include "boost/mpl/integral_c.hpp"
|
||||
#include "boost/static_assert.hpp"
|
||||
|
||||
namespace mpl = boost::mpl;
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef mpl::integral_c<unsigned int, 0> _0;
|
||||
typedef mpl::integral_c<unsigned int, 1> _1;
|
||||
typedef mpl::integral_c<unsigned int, 2> _2;
|
||||
typedef mpl::integral_c<unsigned int, 8> _8;
|
||||
typedef mpl::integral_c<unsigned int, 0xFFFFFFFF> _FFFFFFFF;
|
||||
|
||||
BOOST_STATIC_ASSERT((mpl::bitand_<_0,_0>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::bitand_<_1,_0>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::bitand_<_0,_1>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::bitand_<_0,_FFFFFFFF>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::bitand_<_1,_FFFFFFFF>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::bitand_<_8,_FFFFFFFF>::value == 8));
|
||||
|
||||
BOOST_STATIC_ASSERT((mpl::bitor_<_0,_0>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::bitor_<_1,_0>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::bitor_<_0,_1>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::bitor_<_0,_FFFFFFFF>::value == 0xFFFFFFFF));
|
||||
BOOST_STATIC_ASSERT((mpl::bitor_<_1,_FFFFFFFF>::value == 0xFFFFFFFF));
|
||||
BOOST_STATIC_ASSERT((mpl::bitor_<_8,_FFFFFFFF>::value == 0xFFFFFFFF));
|
||||
|
||||
BOOST_STATIC_ASSERT((mpl::bitxor_<_0,_0>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::bitxor_<_1,_0>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::bitxor_<_0,_1>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::bitxor_<_0,_FFFFFFFF>::value == (0xFFFFFFFF ^ 0)));
|
||||
BOOST_STATIC_ASSERT((mpl::bitxor_<_1,_FFFFFFFF>::value == (0xFFFFFFFF ^ 1)));
|
||||
BOOST_STATIC_ASSERT((mpl::bitxor_<_8,_FFFFFFFF>::value == (0xFFFFFFFF ^ 8)));
|
||||
|
||||
BOOST_STATIC_ASSERT((mpl::shift_right<_0,_0>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_right<_1,_0>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_right<_1,_1>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_right<_2,_1>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_right<_8,_1>::value == 4));
|
||||
|
||||
BOOST_STATIC_ASSERT((mpl::shift_left<_0,_0>::value == 0));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_left<_1,_0>::value == 1));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_left<_1,_1>::value == 2));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_left<_2,_1>::value == 4));
|
||||
BOOST_STATIC_ASSERT((mpl::shift_left<_8,_1>::value == 16));
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user