1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/mpl/negate.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,81 @@
1.4 +
1.5 +#ifndef BOOST_MPL_NEGATE_HPP_INCLUDED
1.6 +#define BOOST_MPL_NEGATE_HPP_INCLUDED
1.7 +
1.8 +// Copyright Aleksey Gurtovoy 2000-2004
1.9 +//
1.10 +// Distributed under the Boost Software License, Version 1.0.
1.11 +// (See accompanying file LICENSE_1_0.txt or copy at
1.12 +// http://www.boost.org/LICENSE_1_0.txt)
1.13 +//
1.14 +// See http://www.boost.org/libs/mpl for documentation.
1.15 +
1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/negate.hpp,v $
1.17 +// $Date: 2004/09/07 09:06:08 $
1.18 +// $Revision: 1.4 $
1.19 +
1.20 +#include <boost/mpl/integral_c.hpp>
1.21 +#include <boost/mpl/aux_/msvc_eti_base.hpp>
1.22 +#include <boost/mpl/aux_/na_spec.hpp>
1.23 +#include <boost/mpl/aux_/lambda_support.hpp>
1.24 +#include <boost/mpl/aux_/config/eti.hpp>
1.25 +#include <boost/mpl/aux_/config/integral.hpp>
1.26 +#include <boost/mpl/aux_/config/static_constant.hpp>
1.27 +
1.28 +namespace boost { namespace mpl {
1.29 +
1.30 +template< typename Tag > struct negate_impl;
1.31 +
1.32 +template< typename T > struct negate_tag
1.33 +{
1.34 + typedef typename T::tag type;
1.35 +};
1.36 +
1.37 +template<
1.38 + typename BOOST_MPL_AUX_NA_PARAM(N)
1.39 + >
1.40 +struct negate
1.41 +#if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
1.42 + : negate_impl<
1.43 + typename negate_tag<N>::type
1.44 + >::template apply<N>::type
1.45 +#else
1.46 + : aux::msvc_eti_base< typename apply_wrap1<
1.47 + negate_impl< typename negate_tag<N>::type >
1.48 + , N
1.49 + >::type >::type
1.50 +#endif
1.51 +{
1.52 + BOOST_MPL_AUX_LAMBDA_SUPPORT(1, negate, (N))
1.53 +};
1.54 +
1.55 +BOOST_MPL_AUX_NA_SPEC(1, negate)
1.56 +
1.57 +
1.58 +#if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
1.59 +namespace aux {
1.60 +template< typename T, T n > struct negate_wknd
1.61 +{
1.62 + BOOST_STATIC_CONSTANT(T, value = -n);
1.63 + typedef integral_c<T,value> type;
1.64 +};
1.65 +}
1.66 +#endif
1.67 +
1.68 +template<>
1.69 +struct negate_impl<integral_c_tag>
1.70 +{
1.71 +#if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC)
1.72 + template< typename N > struct apply
1.73 + : aux::negate_wknd< typename N::value_type, N::value >
1.74 +#else
1.75 + template< typename N > struct apply
1.76 + : integral_c< typename N::value_type, (-N::value) >
1.77 +#endif
1.78 + {
1.79 + };
1.80 +};
1.81 +
1.82 +}}
1.83 +
1.84 +#endif // BOOST_MPL_NEGATE_HPP_INCLUDED