@@ -60,42 +60,105 @@ template< typename T, typename U >
60
60
auto operator +( const mi<T>& t, const mi<U>& u ) -> mi<decltype (*t + *u)>
61
61
{
62
62
if ( !t || !u ) { return missing; }
63
- return mi<decltype (*t+ *u)>( *t + *u );
63
+ return mi<decltype (*t + *u)>( *t + *u );
64
64
}
65
65
66
66
template < typename T, typename U >
67
67
auto operator +( const mi<T>& t, const U& u ) -> mi<decltype (*t + u)>
68
68
{
69
69
if ( !t ) { return missing; }
70
- return mi<decltype (*t+ u)>{ *t + u };
70
+ return mi<decltype (*t + u)>{ *t + u };
71
71
}
72
72
73
73
template < typename T, typename U >
74
74
auto operator +( const T& t, const mi<U>& u ) -> mi<decltype (t + *u)>
75
75
{
76
76
if ( !u ) { return missing; }
77
- return mi<decltype (t+ *u)>{ t + *u };
77
+ return mi<decltype (t + *u)>{ t + *u };
78
78
}
79
79
80
80
template < typename T, typename U >
81
81
auto operator -( const mi<T>& t, const mi<U>& u ) -> mi<decltype (*t - *u)>
82
82
{
83
83
if ( !t || !u ) { return missing; }
84
- return mi<decltype (*t- *u)>( *t - *u );
84
+ return mi<decltype (*t - *u)>( *t - *u );
85
85
}
86
86
87
87
template < typename T, typename U >
88
88
auto operator -( const mi<T>& t, const U& u ) -> mi<decltype (*t - u)>
89
89
{
90
90
if ( !t ) { return missing; }
91
- return mi<decltype (*t- u)>{ *t - u };
91
+ return mi<decltype (*t - u)>{ *t - u };
92
92
}
93
93
94
94
template < typename T, typename U >
95
95
auto operator -( const T& t, const mi<U>& u ) -> mi<decltype (t - *u)>
96
96
{
97
97
if ( !u ) { return missing; }
98
- return mi<decltype (t-*u)>{ t - *u };
98
+ return mi<decltype (t - *u)>{ t - *u };
99
+ }
100
+
101
+ template < typename T, typename U >
102
+ auto operator *( const mi<T>& t, const mi<U>& u ) -> mi<decltype (*t * *u)>
103
+ {
104
+ if ( !t || !u ) { return missing; }
105
+ return mi<decltype (*t * *u)>( *t * *u );
106
+ }
107
+
108
+ template < typename T, typename U >
109
+ auto operator *( const mi<T>& t, const U& u ) -> mi<decltype (*t * u)>
110
+ {
111
+ if ( !t ) { return missing; }
112
+ return mi<decltype (*t * u)>{ *t * u };
113
+ }
114
+
115
+ template < typename T, typename U >
116
+ auto operator *( const T& t, const mi<U>& u ) -> mi<decltype (t * *u)>
117
+ {
118
+ if ( !u ) { return missing; }
119
+ return mi<decltype (t * *u)>{ t * *u };
120
+ }
121
+
122
+ template < typename T, typename U >
123
+ auto operator /( const mi<T>& t, const mi<U>& u ) -> mi<decltype (*t / *u)>
124
+ {
125
+ if ( !t || !u ) { return missing; }
126
+ return mi<decltype (*t / *u)>( *t / *u );
127
+ }
128
+
129
+ template < typename T, typename U >
130
+ auto operator /( const mi<T>& t, const U& u ) -> mi<decltype (*t / u)>
131
+ {
132
+ if ( !t ) { return missing; }
133
+ return mi<decltype (*t / u)>{ *t / u };
134
+ }
135
+
136
+ template < typename T, typename U >
137
+ auto operator /( const T& t, const mi<U>& u ) -> mi<decltype (t / *u)>
138
+ {
139
+ if ( !u ) { return missing; }
140
+ return mi<decltype (t / *u)>{ t / *u };
141
+ }
142
+
143
+ template < typename T, typename U >
144
+ auto operator %( const mi<T>& t, const mi<U>& u ) -> mi<decltype (*t % *u)>
145
+ {
146
+ if ( !t || !u ) { return missing; }
147
+ return mi<decltype (*t % *u)>( *t % *u );
148
+ }
149
+
150
+ template < typename T, typename U >
151
+ auto operator %( const mi<T>& t, const U& u ) -> mi<decltype (*t % u)>
152
+ {
153
+ if ( !t ) { return missing; }
154
+ return mi<decltype (*t % u)>{ *t % u };
155
+ }
156
+
157
+ template < typename T, typename U >
158
+ auto operator %( const T& t, const mi<U>& u ) -> mi<decltype (t % *u)>
159
+ {
160
+ if ( !u ) { return missing; }
161
+ return mi<decltype (t % *u)>{ t % *u };
99
162
}
100
163
101
164
template <typename _Tp> mi (_Tp) -> mi<_Tp>;
0 commit comments