]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/mpl/aux_/preprocessed/no_ctps/divides.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
249713409aecb3fd5ce59a3da60a38d9b0f3466b
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / aux_ / preprocessed / no_ctps / divides.hpp
1 \r
2 // Copyright Aleksey Gurtovoy 2000-2004\r
3 //\r
4 // Distributed under the Boost Software License, Version 1.0. \r
5 // (See accompanying file LICENSE_1_0.txt or copy at \r
6 // http://www.boost.org/LICENSE_1_0.txt)\r
7 //\r
8 \r
9 // Preprocessed version of "boost/mpl/divides.hpp" header\r
10 // -- DO NOT modify by hand!\r
11 \r
12 namespace boost { namespace mpl {\r
13 \r
14 template<\r
15       typename Tag1\r
16     , typename Tag2\r
17     >\r
18 struct divides_impl\r
19     : if_c<\r
20           ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)\r
21               > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)\r
22             )\r
23 \r
24         , aux::cast2nd_impl< divides_impl< Tag1,Tag1 >,Tag1, Tag2 >\r
25         , aux::cast1st_impl< divides_impl< Tag2,Tag2 >,Tag1, Tag2 >\r
26         >::type\r
27 {\r
28 };\r
29 \r
30 /// for Digital Mars C++/compilers with no CTPS/TTP support\r
31 template<> struct divides_impl< na,na >\r
32 {\r
33     template< typename U1, typename U2 > struct apply\r
34     {\r
35         typedef apply type;\r
36         BOOST_STATIC_CONSTANT(int, value  = 0);\r
37     };\r
38 };\r
39 \r
40 template<> struct divides_impl< na,integral_c_tag >\r
41 {\r
42     template< typename U1, typename U2 > struct apply\r
43     {\r
44         typedef apply type;\r
45         BOOST_STATIC_CONSTANT(int, value  = 0);\r
46     };\r
47 };\r
48 \r
49 template<> struct divides_impl< integral_c_tag,na >\r
50 {\r
51     template< typename U1, typename U2 > struct apply\r
52     {\r
53         typedef apply type;\r
54         BOOST_STATIC_CONSTANT(int, value  = 0);\r
55     };\r
56 };\r
57 \r
58 template< typename T > struct divides_tag\r
59 {\r
60     typedef typename T::tag type;\r
61 };\r
62 \r
63 /// forward declaration\r
64 \r
65 template<\r
66       typename BOOST_MPL_AUX_NA_PARAM(N1)\r
67     , typename BOOST_MPL_AUX_NA_PARAM(N2)\r
68     >\r
69 struct divides2;\r
70 \r
71 template<\r
72       typename BOOST_MPL_AUX_NA_PARAM(N1)\r
73     , typename BOOST_MPL_AUX_NA_PARAM(N2)\r
74     , typename N3 = na, typename N4 = na, typename N5 = na\r
75     >\r
76 struct divides\r
77 \r
78     : if_<\r
79 \r
80           is_na<N3>\r
81         , divides2< N1,N2 >\r
82         , divides<\r
83               divides2< N1,N2 >\r
84             , N3, N4, N5\r
85             >\r
86         >::type\r
87 \r
88 {\r
89     BOOST_MPL_AUX_LAMBDA_SUPPORT(\r
90           5\r
91         , divides\r
92         , ( N1, N2, N3, N4, N5 )\r
93         )\r
94 };\r
95 \r
96 template<\r
97       typename N1\r
98     , typename N2\r
99     >\r
100 struct divides2\r
101     : divides_impl<\r
102           typename divides_tag<N1>::type\r
103         , typename divides_tag<N2>::type\r
104         >::template apply< N1,N2 >::type\r
105 {\r
106     BOOST_MPL_AUX_LAMBDA_SUPPORT(2, divides2, (N1, N2))\r
107 \r
108 };\r
109 \r
110 BOOST_MPL_AUX_NA_SPEC2(2, 5, divides)\r
111 \r
112 }}\r
113 \r
114 namespace boost { namespace mpl {\r
115 template<>\r
116 struct divides_impl< integral_c_tag,integral_c_tag >\r
117 {\r
118     template< typename N1, typename N2 > struct apply\r
119 \r
120         : integral_c<\r
121               typename aux::largest_int<\r
122                   typename N1::value_type\r
123                 , typename N2::value_type\r
124                 >::type\r
125             , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value\r
126                   / BOOST_MPL_AUX_VALUE_WKND(N2)::value\r
127                 )\r
128             >\r
129     {\r
130     };\r
131 };\r
132 \r
133 }}\r