1 /////////////////////////////////////////////////////////////////////////////// 2 // deduce_domain_n.hpp 3 // Definitions of common_domain[n] and deduce_domain[n] class templates. 4 // 5 // Copyright 2008 Eric Niebler. Distributed under the Boost 6 // Software License, Version 1.0. (See accompanying file 7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 template<typename A0 , typename A1 , typename A2> 9 struct common_domain3 10 { 11 typedef A0 common1; 12 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; 13 typedef common3 type; 14 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 15 }; 16 template<typename E0 , typename E1 , typename E2> 17 struct deduce_domain3 18 : common_domain3< 19 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type 20 > 21 {}; 22 template<typename A0 , typename A1 , typename A2 , typename A3> 23 struct common_domain4 24 { 25 typedef A0 common1; 26 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; 27 typedef common4 type; 28 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 29 }; 30 template<typename E0 , typename E1 , typename E2 , typename E3> 31 struct deduce_domain4 32 : common_domain4< 33 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type 34 > 35 {}; 36 template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4> 37 struct common_domain5 38 { 39 typedef A0 common1; 40 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; 41 typedef common5 type; 42 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 43 }; 44 template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4> 45 struct deduce_domain5 46 : common_domain5< 47 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type 48 > 49 {}; 50 template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5> 51 struct common_domain6 52 { 53 typedef A0 common1; 54 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; 55 typedef common6 type; 56 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 57 }; 58 template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5> 59 struct deduce_domain6 60 : common_domain6< 61 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type 62 > 63 {}; 64 template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6> 65 struct common_domain7 66 { 67 typedef A0 common1; 68 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; 69 typedef common7 type; 70 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 71 }; 72 template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6> 73 struct deduce_domain7 74 : common_domain7< 75 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type 76 > 77 {}; 78 template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7> 79 struct common_domain8 80 { 81 typedef A0 common1; 82 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8; 83 typedef common8 type; 84 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 85 }; 86 template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7> 87 struct deduce_domain8 88 : common_domain8< 89 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type 90 > 91 {}; 92 template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8> 93 struct common_domain9 94 { 95 typedef A0 common1; 96 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8; typedef typename common_domain2<common8, A8>::type common9; 97 typedef common9 type; 98 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 99 }; 100 template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7 , typename E8> 101 struct deduce_domain9 102 : common_domain9< 103 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type , typename domain_of<E8 >::type 104 > 105 {}; 106 template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9> 107 struct common_domain10 108 { 109 typedef A0 common1; 110 typedef typename common_domain2<common1, A1>::type common2; typedef typename common_domain2<common2, A2>::type common3; typedef typename common_domain2<common3, A3>::type common4; typedef typename common_domain2<common4, A4>::type common5; typedef typename common_domain2<common5, A5>::type common6; typedef typename common_domain2<common6, A6>::type common7; typedef typename common_domain2<common7, A7>::type common8; typedef typename common_domain2<common8, A8>::type common9; typedef typename common_domain2<common9, A9>::type common10; 111 typedef common10 type; 112 BOOST_PROTO_ASSERT_VALID_DOMAIN(type); 113 }; 114 template<typename E0 , typename E1 , typename E2 , typename E3 , typename E4 , typename E5 , typename E6 , typename E7 , typename E8 , typename E9> 115 struct deduce_domain10 116 : common_domain10< 117 typename domain_of<E0 >::type , typename domain_of<E1 >::type , typename domain_of<E2 >::type , typename domain_of<E3 >::type , typename domain_of<E4 >::type , typename domain_of<E5 >::type , typename domain_of<E6 >::type , typename domain_of<E7 >::type , typename domain_of<E8 >::type , typename domain_of<E9 >::type 118 > 119 {}; 120