]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/bits/valarray_array.h
Add __attribute__((malloc) to allocator and remove unused code
[thirdparty/gcc.git] / libstdc++-v3 / include / bits / valarray_array.h
1 // The template and inlines for the -*- C++ -*- internal _Array helper class.
2
3 // Copyright (C) 1997-2018 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24
25 /** @file bits/valarray_array.h
26 * This is an internal header file, included by other library headers.
27 * Do not attempt to use it directly. @headername{valarray}
28 */
29
30 // Written by Gabriel Dos Reis <Gabriel.Dos-Reis@DPTMaths.ENS-Cachan.Fr>
31
32 #ifndef _VALARRAY_ARRAY_H
33 #define _VALARRAY_ARRAY_H 1
34
35 #pragma GCC system_header
36
37 #include <bits/c++config.h>
38 #include <bits/cpp_type_traits.h>
39 #include <cstdlib>
40 #include <new>
41
42 namespace std _GLIBCXX_VISIBILITY(default)
43 {
44 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45
46 //
47 // Helper functions on raw pointers
48 //
49
50 // We get memory the old fashioned way
51 template<typename _Tp>
52 _Tp*
53 __valarray_get_storage(size_t) __attribute__((__malloc__));
54
55 template<typename _Tp>
56 inline _Tp*
57 __valarray_get_storage(size_t __n)
58 { return static_cast<_Tp*>(operator new(__n * sizeof(_Tp))); }
59
60 // Return memory to the system
61 inline void
62 __valarray_release_memory(void* __p)
63 { operator delete(__p); }
64
65 // Turn a raw-memory into an array of _Tp filled with _Tp()
66 // This is required in 'valarray<T> v(n);'
67 template<typename _Tp, bool>
68 struct _Array_default_ctor
69 {
70 // Please note that this isn't exception safe. But
71 // valarrays aren't required to be exception safe.
72 inline static void
73 _S_do_it(_Tp* __b, _Tp* __e)
74 {
75 while (__b != __e)
76 new(__b++) _Tp();
77 }
78 };
79
80 template<typename _Tp>
81 struct _Array_default_ctor<_Tp, true>
82 {
83 // For fundamental types, it suffices to say 'memset()'
84 inline static void
85 _S_do_it(_Tp* __b, _Tp* __e)
86 { __builtin_memset(__b, 0, (__e - __b) * sizeof(_Tp)); }
87 };
88
89 template<typename _Tp>
90 inline void
91 __valarray_default_construct(_Tp* __b, _Tp* __e)
92 {
93 _Array_default_ctor<_Tp, __is_scalar<_Tp>::__value>::_S_do_it(__b, __e);
94 }
95
96 // Turn a raw-memory into an array of _Tp filled with __t
97 // This is the required in valarray<T> v(n, t). Also
98 // used in valarray<>::resize().
99 template<typename _Tp, bool>
100 struct _Array_init_ctor
101 {
102 // Please note that this isn't exception safe. But
103 // valarrays aren't required to be exception safe.
104 inline static void
105 _S_do_it(_Tp* __b, _Tp* __e, const _Tp __t)
106 {
107 while (__b != __e)
108 new(__b++) _Tp(__t);
109 }
110 };
111
112 template<typename _Tp>
113 struct _Array_init_ctor<_Tp, true>
114 {
115 inline static void
116 _S_do_it(_Tp* __b, _Tp* __e, const _Tp __t)
117 {
118 while (__b != __e)
119 *__b++ = __t;
120 }
121 };
122
123 template<typename _Tp>
124 inline void
125 __valarray_fill_construct(_Tp* __b, _Tp* __e, const _Tp __t)
126 {
127 _Array_init_ctor<_Tp, __is_trivial(_Tp)>::_S_do_it(__b, __e, __t);
128 }
129
130 //
131 // copy-construct raw array [__o, *) from plain array [__b, __e)
132 // We can't just say 'memcpy()'
133 //
134 template<typename _Tp, bool>
135 struct _Array_copy_ctor
136 {
137 // Please note that this isn't exception safe. But
138 // valarrays aren't required to be exception safe.
139 inline static void
140 _S_do_it(const _Tp* __b, const _Tp* __e, _Tp* __restrict__ __o)
141 {
142 while (__b != __e)
143 new(__o++) _Tp(*__b++);
144 }
145 };
146
147 template<typename _Tp>
148 struct _Array_copy_ctor<_Tp, true>
149 {
150 inline static void
151 _S_do_it(const _Tp* __b, const _Tp* __e, _Tp* __restrict__ __o)
152 {
153 if (__b)
154 __builtin_memcpy(__o, __b, (__e - __b) * sizeof(_Tp));
155 }
156 };
157
158 template<typename _Tp>
159 inline void
160 __valarray_copy_construct(const _Tp* __b, const _Tp* __e,
161 _Tp* __restrict__ __o)
162 {
163 _Array_copy_ctor<_Tp, __is_trivial(_Tp)>::_S_do_it(__b, __e, __o);
164 }
165
166 // copy-construct raw array [__o, *) from strided array __a[<__n : __s>]
167 template<typename _Tp>
168 inline void
169 __valarray_copy_construct (const _Tp* __restrict__ __a, size_t __n,
170 size_t __s, _Tp* __restrict__ __o)
171 {
172 if (__is_trivial(_Tp))
173 while (__n--)
174 {
175 *__o++ = *__a;
176 __a += __s;
177 }
178 else
179 while (__n--)
180 {
181 new(__o++) _Tp(*__a);
182 __a += __s;
183 }
184 }
185
186 // copy-construct raw array [__o, *) from indexed array __a[__i[<__n>]]
187 template<typename _Tp>
188 inline void
189 __valarray_copy_construct (const _Tp* __restrict__ __a,
190 const size_t* __restrict__ __i,
191 _Tp* __restrict__ __o, size_t __n)
192 {
193 if (__is_trivial(_Tp))
194 while (__n--)
195 *__o++ = __a[*__i++];
196 else
197 while (__n--)
198 new (__o++) _Tp(__a[*__i++]);
199 }
200
201 // Do the necessary cleanup when we're done with arrays.
202 template<typename _Tp>
203 inline void
204 __valarray_destroy_elements(_Tp* __b, _Tp* __e)
205 {
206 if (!__is_trivial(_Tp))
207 while (__b != __e)
208 {
209 __b->~_Tp();
210 ++__b;
211 }
212 }
213
214 // Fill a plain array __a[<__n>] with __t
215 template<typename _Tp>
216 inline void
217 __valarray_fill(_Tp* __restrict__ __a, size_t __n, const _Tp& __t)
218 {
219 while (__n--)
220 *__a++ = __t;
221 }
222
223 // fill strided array __a[<__n-1 : __s>] with __t
224 template<typename _Tp>
225 inline void
226 __valarray_fill(_Tp* __restrict__ __a, size_t __n,
227 size_t __s, const _Tp& __t)
228 {
229 for (size_t __i = 0; __i < __n; ++__i, __a += __s)
230 *__a = __t;
231 }
232
233 // fill indirect array __a[__i[<__n>]] with __i
234 template<typename _Tp>
235 inline void
236 __valarray_fill(_Tp* __restrict__ __a, const size_t* __restrict__ __i,
237 size_t __n, const _Tp& __t)
238 {
239 for (size_t __j = 0; __j < __n; ++__j, ++__i)
240 __a[*__i] = __t;
241 }
242
243 // copy plain array __a[<__n>] in __b[<__n>]
244 // For non-fundamental types, it is wrong to say 'memcpy()'
245 template<typename _Tp, bool>
246 struct _Array_copier
247 {
248 inline static void
249 _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
250 {
251 while(__n--)
252 *__b++ = *__a++;
253 }
254 };
255
256 template<typename _Tp>
257 struct _Array_copier<_Tp, true>
258 {
259 inline static void
260 _S_do_it(const _Tp* __restrict__ __a, size_t __n, _Tp* __restrict__ __b)
261 {
262 if (__n != 0)
263 __builtin_memcpy(__b, __a, __n * sizeof (_Tp));
264 }
265 };
266
267 // Copy a plain array __a[<__n>] into a play array __b[<>]
268 template<typename _Tp>
269 inline void
270 __valarray_copy(const _Tp* __restrict__ __a, size_t __n,
271 _Tp* __restrict__ __b)
272 {
273 _Array_copier<_Tp, __is_trivial(_Tp)>::_S_do_it(__a, __n, __b);
274 }
275
276 // Copy strided array __a[<__n : __s>] in plain __b[<__n>]
277 template<typename _Tp>
278 inline void
279 __valarray_copy(const _Tp* __restrict__ __a, size_t __n, size_t __s,
280 _Tp* __restrict__ __b)
281 {
282 for (size_t __i = 0; __i < __n; ++__i, ++__b, __a += __s)
283 *__b = *__a;
284 }
285
286 // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>]
287 template<typename _Tp>
288 inline void
289 __valarray_copy(const _Tp* __restrict__ __a, _Tp* __restrict__ __b,
290 size_t __n, size_t __s)
291 {
292 for (size_t __i = 0; __i < __n; ++__i, ++__a, __b += __s)
293 *__b = *__a;
294 }
295
296 // Copy strided array __src[<__n : __s1>] into another
297 // strided array __dst[< : __s2>]. Their sizes must match.
298 template<typename _Tp>
299 inline void
300 __valarray_copy(const _Tp* __restrict__ __src, size_t __n, size_t __s1,
301 _Tp* __restrict__ __dst, size_t __s2)
302 {
303 for (size_t __i = 0; __i < __n; ++__i)
304 __dst[__i * __s2] = __src[__i * __s1];
305 }
306
307 // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
308 template<typename _Tp>
309 inline void
310 __valarray_copy(const _Tp* __restrict__ __a,
311 const size_t* __restrict__ __i,
312 _Tp* __restrict__ __b, size_t __n)
313 {
314 for (size_t __j = 0; __j < __n; ++__j, ++__b, ++__i)
315 *__b = __a[*__i];
316 }
317
318 // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]]
319 template<typename _Tp>
320 inline void
321 __valarray_copy(const _Tp* __restrict__ __a, size_t __n,
322 _Tp* __restrict__ __b, const size_t* __restrict__ __i)
323 {
324 for (size_t __j = 0; __j < __n; ++__j, ++__a, ++__i)
325 __b[*__i] = *__a;
326 }
327
328 // Copy the __n first elements of an indexed array __src[<__i>] into
329 // another indexed array __dst[<__j>].
330 template<typename _Tp>
331 inline void
332 __valarray_copy(const _Tp* __restrict__ __src, size_t __n,
333 const size_t* __restrict__ __i,
334 _Tp* __restrict__ __dst, const size_t* __restrict__ __j)
335 {
336 for (size_t __k = 0; __k < __n; ++__k)
337 __dst[*__j++] = __src[*__i++];
338 }
339
340 //
341 // Compute the sum of elements in range [__f, __l)
342 // This is a naive algorithm. It suffers from cancelling.
343 // In the future try to specialize
344 // for _Tp = float, double, long double using a more accurate
345 // algorithm.
346 //
347 template<typename _Tp>
348 inline _Tp
349 __valarray_sum(const _Tp* __f, const _Tp* __l)
350 {
351 _Tp __r = _Tp();
352 while (__f != __l)
353 __r += *__f++;
354 return __r;
355 }
356
357 // Compute the product of all elements in range [__f, __l)
358 template<typename _Tp>
359 inline _Tp
360 __valarray_product(const _Tp* __f, const _Tp* __l)
361 {
362 _Tp __r = _Tp(1);
363 while (__f != __l)
364 __r = __r * *__f++;
365 return __r;
366 }
367
368 // Compute the min/max of an array-expression
369 template<typename _Ta>
370 inline typename _Ta::value_type
371 __valarray_min(const _Ta& __a)
372 {
373 size_t __s = __a.size();
374 typedef typename _Ta::value_type _Value_type;
375 _Value_type __r = __s == 0 ? _Value_type() : __a[0];
376 for (size_t __i = 1; __i < __s; ++__i)
377 {
378 _Value_type __t = __a[__i];
379 if (__t < __r)
380 __r = __t;
381 }
382 return __r;
383 }
384
385 template<typename _Ta>
386 inline typename _Ta::value_type
387 __valarray_max(const _Ta& __a)
388 {
389 size_t __s = __a.size();
390 typedef typename _Ta::value_type _Value_type;
391 _Value_type __r = __s == 0 ? _Value_type() : __a[0];
392 for (size_t __i = 1; __i < __s; ++__i)
393 {
394 _Value_type __t = __a[__i];
395 if (__t > __r)
396 __r = __t;
397 }
398 return __r;
399 }
400
401 //
402 // Helper class _Array, first layer of valarray abstraction.
403 // All operations on valarray should be forwarded to this class
404 // whenever possible. -- gdr
405 //
406
407 template<typename _Tp>
408 struct _Array
409 {
410 explicit _Array(_Tp* const __restrict__);
411 explicit _Array(const valarray<_Tp>&);
412 _Array(const _Tp* __restrict__, size_t);
413
414 _Tp* begin() const;
415
416 _Tp* const __restrict__ _M_data;
417 };
418
419
420 // Copy-construct plain array __b[<__n>] from indexed array __a[__i[<__n>]]
421 template<typename _Tp>
422 inline void
423 __valarray_copy_construct(_Array<_Tp> __a, _Array<size_t> __i,
424 _Array<_Tp> __b, size_t __n)
425 { std::__valarray_copy_construct(__a._M_data, __i._M_data,
426 __b._M_data, __n); }
427
428 // Copy-construct plain array __b[<__n>] from strided array __a[<__n : __s>]
429 template<typename _Tp>
430 inline void
431 __valarray_copy_construct(_Array<_Tp> __a, size_t __n, size_t __s,
432 _Array<_Tp> __b)
433 { std::__valarray_copy_construct(__a._M_data, __n, __s, __b._M_data); }
434
435 template<typename _Tp>
436 inline void
437 __valarray_fill (_Array<_Tp> __a, size_t __n, const _Tp& __t)
438 { std::__valarray_fill(__a._M_data, __n, __t); }
439
440 template<typename _Tp>
441 inline void
442 __valarray_fill(_Array<_Tp> __a, size_t __n, size_t __s, const _Tp& __t)
443 { std::__valarray_fill(__a._M_data, __n, __s, __t); }
444
445 template<typename _Tp>
446 inline void
447 __valarray_fill(_Array<_Tp> __a, _Array<size_t> __i,
448 size_t __n, const _Tp& __t)
449 { std::__valarray_fill(__a._M_data, __i._M_data, __n, __t); }
450
451 // Copy a plain array __a[<__n>] into a play array __b[<>]
452 template<typename _Tp>
453 inline void
454 __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b)
455 { std::__valarray_copy(__a._M_data, __n, __b._M_data); }
456
457 // Copy strided array __a[<__n : __s>] in plain __b[<__n>]
458 template<typename _Tp>
459 inline void
460 __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s, _Array<_Tp> __b)
461 { std::__valarray_copy(__a._M_data, __n, __s, __b._M_data); }
462
463 // Copy a plain array __a[<__n>] into a strided array __b[<__n : __s>]
464 template<typename _Tp>
465 inline void
466 __valarray_copy(_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s)
467 { __valarray_copy(__a._M_data, __b._M_data, __n, __s); }
468
469 // Copy strided array __src[<__n : __s1>] into another
470 // strided array __dst[< : __s2>]. Their sizes must match.
471 template<typename _Tp>
472 inline void
473 __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s1,
474 _Array<_Tp> __b, size_t __s2)
475 { std::__valarray_copy(__a._M_data, __n, __s1, __b._M_data, __s2); }
476
477 // Copy an indexed array __a[__i[<__n>]] in plain array __b[<__n>]
478 template<typename _Tp>
479 inline void
480 __valarray_copy(_Array<_Tp> __a, _Array<size_t> __i,
481 _Array<_Tp> __b, size_t __n)
482 { std::__valarray_copy(__a._M_data, __i._M_data, __b._M_data, __n); }
483
484 // Copy a plain array __a[<__n>] in an indexed array __b[__i[<__n>]]
485 template<typename _Tp>
486 inline void
487 __valarray_copy(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b,
488 _Array<size_t> __i)
489 { std::__valarray_copy(__a._M_data, __n, __b._M_data, __i._M_data); }
490
491 // Copy the __n first elements of an indexed array __src[<__i>] into
492 // another indexed array __dst[<__j>].
493 template<typename _Tp>
494 inline void
495 __valarray_copy(_Array<_Tp> __src, size_t __n, _Array<size_t> __i,
496 _Array<_Tp> __dst, _Array<size_t> __j)
497 {
498 std::__valarray_copy(__src._M_data, __n, __i._M_data,
499 __dst._M_data, __j._M_data);
500 }
501
502 template<typename _Tp>
503 inline
504 _Array<_Tp>::_Array(_Tp* const __restrict__ __p)
505 : _M_data (__p) {}
506
507 template<typename _Tp>
508 inline
509 _Array<_Tp>::_Array(const valarray<_Tp>& __v)
510 : _M_data (__v._M_data) {}
511
512 template<typename _Tp>
513 inline
514 _Array<_Tp>::_Array(const _Tp* __restrict__ __b, size_t __s)
515 : _M_data(__valarray_get_storage<_Tp>(__s))
516 { std::__valarray_copy_construct(__b, __s, _M_data); }
517
518 template<typename _Tp>
519 inline _Tp*
520 _Array<_Tp>::begin () const
521 { return _M_data; }
522
523 #define _DEFINE_ARRAY_FUNCTION(_Op, _Name) \
524 template<typename _Tp> \
525 inline void \
526 _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, const _Tp& __t) \
527 { \
528 for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; ++__p) \
529 *__p _Op##= __t; \
530 } \
531 \
532 template<typename _Tp> \
533 inline void \
534 _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, _Array<_Tp> __b) \
535 { \
536 _Tp* __p = __a._M_data; \
537 for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; ++__p, ++__q) \
538 *__p _Op##= *__q; \
539 } \
540 \
541 template<typename _Tp, class _Dom> \
542 void \
543 _Array_augmented_##_Name(_Array<_Tp> __a, \
544 const _Expr<_Dom, _Tp>& __e, size_t __n) \
545 { \
546 _Tp* __p(__a._M_data); \
547 for (size_t __i = 0; __i < __n; ++__i, ++__p) \
548 *__p _Op##= __e[__i]; \
549 } \
550 \
551 template<typename _Tp> \
552 inline void \
553 _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, size_t __s, \
554 _Array<_Tp> __b) \
555 { \
556 _Tp* __q(__b._M_data); \
557 for (_Tp* __p = __a._M_data; __p < __a._M_data + __s * __n; \
558 __p += __s, ++__q) \
559 *__p _Op##= *__q; \
560 } \
561 \
562 template<typename _Tp> \
563 inline void \
564 _Array_augmented_##_Name(_Array<_Tp> __a, _Array<_Tp> __b, \
565 size_t __n, size_t __s) \
566 { \
567 _Tp* __q(__b._M_data); \
568 for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; \
569 ++__p, __q += __s) \
570 *__p _Op##= *__q; \
571 } \
572 \
573 template<typename _Tp, class _Dom> \
574 void \
575 _Array_augmented_##_Name(_Array<_Tp> __a, size_t __s, \
576 const _Expr<_Dom, _Tp>& __e, size_t __n) \
577 { \
578 _Tp* __p(__a._M_data); \
579 for (size_t __i = 0; __i < __n; ++__i, __p += __s) \
580 *__p _Op##= __e[__i]; \
581 } \
582 \
583 template<typename _Tp> \
584 inline void \
585 _Array_augmented_##_Name(_Array<_Tp> __a, _Array<size_t> __i, \
586 _Array<_Tp> __b, size_t __n) \
587 { \
588 _Tp* __q(__b._M_data); \
589 for (size_t* __j = __i._M_data; __j < __i._M_data + __n; \
590 ++__j, ++__q) \
591 __a._M_data[*__j] _Op##= *__q; \
592 } \
593 \
594 template<typename _Tp> \
595 inline void \
596 _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, \
597 _Array<_Tp> __b, _Array<size_t> __i) \
598 { \
599 _Tp* __p(__a._M_data); \
600 for (size_t* __j = __i._M_data; __j<__i._M_data + __n; \
601 ++__j, ++__p) \
602 *__p _Op##= __b._M_data[*__j]; \
603 } \
604 \
605 template<typename _Tp, class _Dom> \
606 void \
607 _Array_augmented_##_Name(_Array<_Tp> __a, _Array<size_t> __i, \
608 const _Expr<_Dom, _Tp>& __e, size_t __n) \
609 { \
610 size_t* __j(__i._M_data); \
611 for (size_t __k = 0; __k<__n; ++__k, ++__j) \
612 __a._M_data[*__j] _Op##= __e[__k]; \
613 } \
614 \
615 template<typename _Tp> \
616 void \
617 _Array_augmented_##_Name(_Array<_Tp> __a, _Array<bool> __m, \
618 _Array<_Tp> __b, size_t __n) \
619 { \
620 bool* __ok(__m._M_data); \
621 _Tp* __p(__a._M_data); \
622 for (_Tp* __q = __b._M_data; __q < __b._M_data + __n; \
623 ++__q, ++__ok, ++__p) \
624 { \
625 while (! *__ok) \
626 { \
627 ++__ok; \
628 ++__p; \
629 } \
630 *__p _Op##= *__q; \
631 } \
632 } \
633 \
634 template<typename _Tp> \
635 void \
636 _Array_augmented_##_Name(_Array<_Tp> __a, size_t __n, \
637 _Array<_Tp> __b, _Array<bool> __m) \
638 { \
639 bool* __ok(__m._M_data); \
640 _Tp* __q(__b._M_data); \
641 for (_Tp* __p = __a._M_data; __p < __a._M_data + __n; \
642 ++__p, ++__ok, ++__q) \
643 { \
644 while (! *__ok) \
645 { \
646 ++__ok; \
647 ++__q; \
648 } \
649 *__p _Op##= *__q; \
650 } \
651 } \
652 \
653 template<typename _Tp, class _Dom> \
654 void \
655 _Array_augmented_##_Name(_Array<_Tp> __a, _Array<bool> __m, \
656 const _Expr<_Dom, _Tp>& __e, size_t __n) \
657 { \
658 bool* __ok(__m._M_data); \
659 _Tp* __p(__a._M_data); \
660 for (size_t __i = 0; __i < __n; ++__i, ++__ok, ++__p) \
661 { \
662 while (! *__ok) \
663 { \
664 ++__ok; \
665 ++__p; \
666 } \
667 *__p _Op##= __e[__i]; \
668 } \
669 }
670
671 _DEFINE_ARRAY_FUNCTION(+, __plus)
672 _DEFINE_ARRAY_FUNCTION(-, __minus)
673 _DEFINE_ARRAY_FUNCTION(*, __multiplies)
674 _DEFINE_ARRAY_FUNCTION(/, __divides)
675 _DEFINE_ARRAY_FUNCTION(%, __modulus)
676 _DEFINE_ARRAY_FUNCTION(^, __bitwise_xor)
677 _DEFINE_ARRAY_FUNCTION(|, __bitwise_or)
678 _DEFINE_ARRAY_FUNCTION(&, __bitwise_and)
679 _DEFINE_ARRAY_FUNCTION(<<, __shift_left)
680 _DEFINE_ARRAY_FUNCTION(>>, __shift_right)
681
682 #undef _DEFINE_ARRAY_FUNCTION
683
684 _GLIBCXX_END_NAMESPACE_VERSION
685 } // namespace
686
687 # include <bits/valarray_array.tcc>
688
689 #endif /* _ARRAY_H */