Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2000-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: // Preprocessed version of "boost/mpl/modulus.hpp" header Chris@16: // -- DO NOT modify by hand! Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: template< Chris@16: typename Tag1 Chris@16: , typename Tag2 Chris@16: > Chris@16: struct modulus_impl Chris@16: : if_c< Chris@16: ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1) Chris@16: > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2) Chris@16: ) Chris@16: Chris@16: , aux::cast2nd_impl< modulus_impl< Tag1,Tag1 >,Tag1, Tag2 > Chris@16: , aux::cast1st_impl< modulus_impl< Tag2,Tag2 >,Tag1, Tag2 > Chris@16: >::type Chris@16: { Chris@16: }; Chris@16: Chris@16: /// for Digital Mars C++/compilers with no CTPS/TTP support Chris@16: template<> struct modulus_impl< na,na > Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename Tag > struct modulus_impl< na,Tag > Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename Tag > struct modulus_impl< Tag,na > Chris@16: { Chris@16: template< typename U1, typename U2 > struct apply Chris@16: { Chris@16: typedef apply type; Chris@16: BOOST_STATIC_CONSTANT(int, value = 0); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename T > struct modulus_tag Chris@16: { Chris@16: typedef typename T::tag type; Chris@16: }; Chris@16: Chris@16: template< Chris@16: typename BOOST_MPL_AUX_NA_PARAM(N1) Chris@16: , typename BOOST_MPL_AUX_NA_PARAM(N2) Chris@16: > Chris@16: struct modulus Chris@16: Chris@16: : modulus_impl< Chris@16: typename modulus_tag::type Chris@16: , typename modulus_tag::type Chris@16: >::template apply< N1,N2 >::type Chris@16: { Chris@16: }; Chris@16: Chris@16: BOOST_MPL_AUX_NA_SPEC2(2, 2, modulus) Chris@16: Chris@16: }} Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: template<> Chris@16: struct modulus_impl< integral_c_tag,integral_c_tag > Chris@16: { Chris@16: template< typename N1, typename N2 > struct apply Chris@16: Chris@16: : integral_c< Chris@16: typename aux::largest_int< Chris@16: typename N1::value_type Chris@16: , typename N2::value_type Chris@16: >::type Chris@16: , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value Chris@16: % BOOST_MPL_AUX_VALUE_WKND(N2)::value Chris@16: ) Chris@16: > Chris@16: { Chris@16: }; Chris@16: }; Chris@16: Chris@16: }}