From ae4caa5180b70bb896503a1ab9ec2af7a7f7b70d Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 12 Mar 2003 01:39:29 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'RC_1_30_0'. [SVN r17826] --- include/boost/mpl/bitwise.hpp | 27 ++++++++++++ include/boost/mpl/bool_fwd.hpp | 31 +++++++++++++ include/boost/mpl/int_fwd.hpp | 25 +++++++++++ include/boost/mpl/integral_c_fwd.hpp | 32 ++++++++++++++ include/boost/mpl/long_fwd.hpp | 25 +++++++++++ include/boost/mpl/size_t.hpp | 29 ++++++++++++ include/boost/mpl/size_t_fwd.hpp | 28 ++++++++++++ test/bitwise.cpp | 66 ++++++++++++++++++++++++++++ 8 files changed, 263 insertions(+) create mode 100644 include/boost/mpl/bitwise.hpp create mode 100644 include/boost/mpl/bool_fwd.hpp create mode 100644 include/boost/mpl/int_fwd.hpp create mode 100644 include/boost/mpl/integral_c_fwd.hpp create mode 100644 include/boost/mpl/long_fwd.hpp create mode 100644 include/boost/mpl/size_t.hpp create mode 100644 include/boost/mpl/size_t_fwd.hpp create mode 100644 test/bitwise.cpp diff --git a/include/boost/mpl/bitwise.hpp b/include/boost/mpl/bitwise.hpp new file mode 100644 index 0000000..d225847 --- /dev/null +++ b/include/boost/mpl/bitwise.hpp @@ -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 diff --git a/include/boost/mpl/bool_fwd.hpp b/include/boost/mpl/bool_fwd.hpp new file mode 100644 index 0000000..8512937 --- /dev/null +++ b/include/boost/mpl/bool_fwd.hpp @@ -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_; +typedef bool_ false_; + +}} + +#endif // BOOST_MPL_BOOL_FWD_HPP_INCLUDED diff --git a/include/boost/mpl/int_fwd.hpp b/include/boost/mpl/int_fwd.hpp new file mode 100644 index 0000000..7165c24 --- /dev/null +++ b/include/boost/mpl/int_fwd.hpp @@ -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 diff --git a/include/boost/mpl/integral_c_fwd.hpp b/include/boost/mpl/integral_c_fwd.hpp new file mode 100644 index 0000000..866a6e3 --- /dev/null +++ b/include/boost/mpl/integral_c_fwd.hpp @@ -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 diff --git a/include/boost/mpl/long_fwd.hpp b/include/boost/mpl/long_fwd.hpp new file mode 100644 index 0000000..ecbcacb --- /dev/null +++ b/include/boost/mpl/long_fwd.hpp @@ -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 diff --git a/include/boost/mpl/size_t.hpp b/include/boost/mpl/size_t.hpp new file mode 100644 index 0000000..086d1dc --- /dev/null +++ b/include/boost/mpl/size_t.hpp @@ -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 diff --git a/include/boost/mpl/size_t_fwd.hpp b/include/boost/mpl/size_t_fwd.hpp new file mode 100644 index 0000000..3cd63c4 --- /dev/null +++ b/include/boost/mpl/size_t_fwd.hpp @@ -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 + +namespace boost { namespace mpl { +template< std::size_t N > struct size_t; +}} + +#endif // BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED diff --git a/test/bitwise.cpp b/test/bitwise.cpp new file mode 100644 index 0000000..9a1940c --- /dev/null +++ b/test/bitwise.cpp @@ -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 _0; + typedef mpl::integral_c _1; + typedef mpl::integral_c _2; + typedef mpl::integral_c _8; + typedef mpl::integral_c _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; +}