sl@0: sl@0: #ifndef BOOST_MPL_NEGATE_HPP_INCLUDED sl@0: #define BOOST_MPL_NEGATE_HPP_INCLUDED sl@0: sl@0: // Copyright Aleksey Gurtovoy 2000-2004 sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. sl@0: // (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: // sl@0: // See http://www.boost.org/libs/mpl for documentation. sl@0: sl@0: // $Source: /cvsroot/boost/boost/boost/mpl/negate.hpp,v $ sl@0: // $Date: 2004/09/07 09:06:08 $ sl@0: // $Revision: 1.4 $ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: namespace boost { namespace mpl { sl@0: sl@0: template< typename Tag > struct negate_impl; sl@0: sl@0: template< typename T > struct negate_tag sl@0: { sl@0: typedef typename T::tag type; sl@0: }; sl@0: sl@0: template< sl@0: typename BOOST_MPL_AUX_NA_PARAM(N) sl@0: > sl@0: struct negate sl@0: #if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) sl@0: : negate_impl< sl@0: typename negate_tag::type sl@0: >::template apply::type sl@0: #else sl@0: : aux::msvc_eti_base< typename apply_wrap1< sl@0: negate_impl< typename negate_tag::type > sl@0: , N sl@0: >::type >::type sl@0: #endif sl@0: { sl@0: BOOST_MPL_AUX_LAMBDA_SUPPORT(1, negate, (N)) sl@0: }; sl@0: sl@0: BOOST_MPL_AUX_NA_SPEC(1, negate) sl@0: sl@0: sl@0: #if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC) sl@0: namespace aux { sl@0: template< typename T, T n > struct negate_wknd sl@0: { sl@0: BOOST_STATIC_CONSTANT(T, value = -n); sl@0: typedef integral_c type; sl@0: }; sl@0: } sl@0: #endif sl@0: sl@0: template<> sl@0: struct negate_impl sl@0: { sl@0: #if defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC) sl@0: template< typename N > struct apply sl@0: : aux::negate_wknd< typename N::value_type, N::value > sl@0: #else sl@0: template< typename N > struct apply sl@0: : integral_c< typename N::value_type, (-N::value) > sl@0: #endif sl@0: { sl@0: }; sl@0: }; sl@0: sl@0: }} sl@0: sl@0: #endif // BOOST_MPL_NEGATE_HPP_INCLUDED