| 48 | template<typename R, typename I> |
| 49 | typename boost::enable_if< |
| 50 | mpl::and_< |
| 51 | boost::is_float<R>, |
| 52 | boost::is_integral<I> |
| 53 | >, |
| 54 | std::complex<R> >::type inline operator+ (I in1, std::complex<R> const& in2 ) { |
| 55 | return R (in1) + in2; |
| 56 | } |
| 57 | |
| 58 | template<typename R, typename I> |
| 59 | typename boost::enable_if< |
| 60 | mpl::and_< |
| 61 | boost::is_float<R>, |
| 62 | boost::is_integral<I> |
| 63 | >, |
| 64 | std::complex<R> >::type inline operator+ (std::complex<R> const& in1, I in2) { |
| 65 | return in1 + R (in2); |
| 66 | } |
| 67 | |
| 68 | template<typename R, typename I> |
| 69 | typename boost::enable_if< |
| 70 | mpl::and_< |
| 71 | boost::is_float<R>, |
| 72 | boost::is_integral<I> |
| 73 | >, |
| 74 | std::complex<R> >::type inline operator- (I in1, std::complex<R> const& in2) { |
| 75 | return R (in1) - in2; |
| 76 | } |
| 77 | |
| 78 | template<typename R, typename I> |
| 79 | typename boost::enable_if< |
| 80 | mpl::and_< |
| 81 | boost::is_float<R>, |
| 82 | boost::is_integral<I> |
| 83 | >, |
| 84 | std::complex<R> >::type inline operator- (std::complex<R> const& in1, I in2) { |
| 85 | return in1 - R (in2); |
| 86 | } |
| 87 | |
| 88 | template<typename R, typename I> |
| 89 | typename boost::enable_if< |
| 90 | mpl::and_< |
| 91 | boost::is_float<R>, |
| 92 | boost::is_integral<I> |
| 93 | >, |
| 94 | std::complex<R> >::type inline operator* (I in1, std::complex<R> const& in2) { |
| 95 | return R (in1) * in2; |
| 96 | } |
| 97 | |
| 98 | template<typename R, typename I> |
| 99 | typename boost::enable_if< |
| 100 | mpl::and_< |
| 101 | boost::is_float<R>, |
| 102 | boost::is_integral<I> |
| 103 | >, |
| 104 | std::complex<R> >::type inline operator* (std::complex<R> const& in1, I in2) { |
| 105 | return in1 * R(in2); |
| 106 | } |
| 107 | |
| 108 | template<typename R, typename I> |
| 109 | typename boost::enable_if< |
| 110 | mpl::and_< |
| 111 | boost::is_float<R>, |
| 112 | boost::is_integral<I> |
| 113 | >, |
| 114 | std::complex<R> >::type inline operator/ (I in1, std::complex<R> const& in2) { |
| 115 | return R(in1) / in2; |
| 116 | } |
| 117 | |
| 118 | template<typename R, typename I> |
| 119 | typename boost::enable_if< |
| 120 | mpl::and_< |
| 121 | boost::is_float<R>, |
| 122 | boost::is_integral<I> |
| 123 | >, |
| 124 | std::complex<R> >::type inline operator/ (std::complex<R> const& in1, I in2) { |
| 125 | return in1 / R (in2); |
| 126 | } |
| 127 | |
| 128 | |