1.1 --- a/epoc32/include/stdapis/stlportv5/stl/_valarray.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/stdapis/stlportv5/stl/_valarray.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,43 +1,48 @@
1.4 /*
1.5 - * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.6 * Copyright (c) 1999
1.7 * Silicon Graphics Computer Systems, Inc.
1.8 *
1.9 - * Copyright (c) 1999
1.10 + * Copyright (c) 1999
1.11 * Boris Fomitchev
1.12 *
1.13 * This material is provided "as is", with absolutely no warranty expressed
1.14 * or implied. Any use is at your own risk.
1.15 *
1.16 - * Permission to use or copy this software for any purpose is hereby granted
1.17 + * Permission to use or copy this software for any purpose is hereby granted
1.18 * without fee, provided the above notices are retained on all copies.
1.19 * Permission to modify the code and to distribute modified code is granted,
1.20 * provided the above notices are retained, and a notice that the code was
1.21 * modified is included with the above copyright notice.
1.22 *
1.23 - */
1.24 + */
1.25
1.26 #ifndef _STLP_VALARRAY_H
1.27 #define _STLP_VALARRAY_H
1.28
1.29 -#ifndef _STLP_CMATH_H_HEADER
1.30 -#include <stl/_cmath.h>
1.31 -#endif
1.32 -#ifndef _STLP_INTERNAL_NEW_HEADER
1.33 -#include <stl/_new.h>
1.34 -#endif
1.35 -#ifndef _STLP_INTERNAL_ALGO_H
1.36 -#include <stl/_algo.h>
1.37 -#endif
1.38 -#ifndef _STLP_INTERNAL_NUMERIC_H
1.39 -#include <stl/_numeric.h>
1.40 -#endif
1.41 -#ifndef _STLP_LIMITS_H
1.42 -#include <limits>
1.43 +#ifndef _STLP_INTERNAL_CMATH
1.44 +# include <stl/_cmath.h>
1.45 #endif
1.46
1.47 -//To resolve the unidentified identifier __THROW_BAD_ALLOC
1.48 -#include <stl/_alloc.h>
1.49 +#ifndef _STLP_INTERNAL_NEW
1.50 +# include <stl/_new.h>
1.51 +#endif
1.52 +
1.53 +#ifndef _STLP_INTERNAL_ALGO_H
1.54 +# include <stl/_algo.h>
1.55 +#endif
1.56 +
1.57 +#ifndef _STLP_INTERNAL_NUMERIC_H
1.58 +# include <stl/_numeric.h>
1.59 +#endif
1.60 +
1.61 +#ifndef _STLP_INTERNAL_LIMITS
1.62 +# include <stl/_limits.h>
1.63 +#endif
1.64 +
1.65 +/* As we only need the _STLP_ASSERT macro from _debug.h we test it to include _debug.h */
1.66 +#ifndef _STLP_ASSERT
1.67 +# include <stl/debug/_debug.h>
1.68 +#endif
1.69
1.70 _STLP_BEGIN_NAMESPACE
1.71
1.72 @@ -57,10 +62,10 @@
1.73 // class valarray
1.74
1.75 // Base class to handle memory allocation and deallocation. We can't just
1.76 -// use vector<>, because vector<bool> would be unsuitable as an internal
1.77 +// use vector<>, because vector<bool> would be unsuitable as an internal
1.78 // representation for valarray<bool>.
1.79
1.80 -template <class _Tp>
1.81 +template <class _Tp>
1.82 struct _Valarray_base
1.83 {
1.84 _Tp* _M_first;
1.85 @@ -72,16 +77,14 @@
1.86
1.87 void _M_allocate(size_t __n) {
1.88 if (__n != 0) {
1.89 -#ifdef __SYMBIAN32__
1.90 - _M_first = ::new _Tp[__n];
1.91 -#else
1.92 _M_first = __STATIC_CAST(_Tp*, (malloc(__n * sizeof(_Tp))));
1.93 -#endif
1.94 _M_size = __n;
1.95 +#if !defined(_STLP_NO_BAD_ALLOC) && defined(_STLP_USE_EXCEPTIONS)
1.96 if (_M_first == 0) {
1.97 _M_size = 0;
1.98 - __THROW_BAD_ALLOC;
1.99 + throw _STLP_STD::bad_alloc();
1.100 }
1.101 +#endif
1.102 }
1.103 else {
1.104 _M_first = 0;
1.105 @@ -90,17 +93,13 @@
1.106 }
1.107
1.108 void _M_deallocate() {
1.109 -#ifdef __SYMBIAN32__
1.110 - delete [] _M_first;
1.111 -#else
1.112 free(_M_first);
1.113 -#endif
1.114 _M_first = 0;
1.115 _M_size = 0;
1.116 }
1.117 };
1.118
1.119 -template <class _Tp>
1.120 +template <class _Tp>
1.121 class valarray : private _Valarray_base<_Tp>
1.122 {
1.123 friend class gslice;
1.124 @@ -110,11 +109,12 @@
1.125
1.126 // Basic constructors
1.127 valarray() : _Valarray_base<_Tp>() {}
1.128 - valarray(size_t __n) : _Valarray_base<_Tp>(__n) {}
1.129 + explicit valarray(size_t __n) : _Valarray_base<_Tp>(__n)
1.130 + { uninitialized_fill_n(this->_M_first, this->_M_size, _STLP_DEFAULT_CONSTRUCTED(value_type)); }
1.131 valarray(const value_type& __x, size_t __n) : _Valarray_base<_Tp>(__n)
1.132 { uninitialized_fill_n(this->_M_first, this->_M_size, __x); }
1.133 valarray(const value_type* __p, size_t __n) : _Valarray_base<_Tp>(__n)
1.134 - { uninitialized_copy(__p, __p + __n, this->_M_first); }
1.135 + { uninitialized_copy(__p, __p + __n, this->_M_first); }
1.136 valarray(const valarray<_Tp>& __x) : _Valarray_base<_Tp>(__x._M_size) {
1.137 uninitialized_copy(__x._M_first, __x._M_first + __x._M_size,
1.138 this->_M_first);
1.139 @@ -127,14 +127,14 @@
1.140 valarray(const indirect_array<_Tp>&);
1.141
1.142 // Destructor
1.143 - ~valarray() { _STLP_STD::_Destroy(this->_M_first, this->_M_first + this->_M_size); }
1.144 + ~valarray() { _STLP_STD::_Destroy_Range(this->_M_first, this->_M_first + this->_M_size); }
1.145
1.146 // Extension: constructor that doesn't initialize valarray elements to a
1.147 // specific value. This is faster for types such as int and double.
1.148 private:
1.149 void _M_initialize(const __true_type&) {}
1.150 void _M_initialize(const __false_type&)
1.151 - { uninitialized_fill_n(this->_M_first, this->_M_size, value_type()); }
1.152 + { uninitialized_fill_n(this->_M_first, this->_M_size, _STLP_DEFAULT_CONSTRUCTED(_Tp)); }
1.153
1.154 public:
1.155 struct _NoInit {};
1.156 @@ -148,12 +148,22 @@
1.157 valarray<_Tp>& operator=(const valarray<_Tp>& __x) {
1.158 _STLP_ASSERT(__x.size() == this->size())
1.159 if (this != &__x)
1.160 - {
1.161 + {
1.162 #ifdef __SYMBIAN32__
1.163 - resize(__x._M_size);
1.164 -#endif
1.165 + /* Eventhough the behavior is undefined when the sizes are different,
1.166 + copying the data correspoding to the minimum of both the lengths
1.167 + will prevent a crash */
1.168 + if( this->size() < __x._M_size )
1.169 + copy(__x._M_first, __x._M_first + this->size(), this->_M_first);
1.170 + else
1.171 + copy(__x._M_first, __x._M_first + __x._M_size, this->_M_first);
1.172 +
1.173 +#else /* __SYMBIAN32__ */
1.174 copy(__x._M_first, __x._M_first + __x._M_size, this->_M_first);
1.175 - }
1.176 +
1.177 +#endif /* __SYMBIAN32__ */
1.178 + }
1.179 +
1.180 return *this;
1.181 }
1.182
1.183 @@ -177,13 +187,13 @@
1.184 public: // Subsetting operations with auxiliary type
1.185 valarray<_Tp> operator[](slice) const;
1.186 slice_array<_Tp> operator[](slice);
1.187 - valarray<_Tp> operator[](gslice) const;
1.188 - gslice_array<_Tp> operator[](const gslice&);
1.189 + valarray<_Tp> operator[](const gslice&) const;
1.190 + gslice_array<_Tp> operator[](const gslice&);
1.191 valarray<_Tp> operator[](const _Valarray_bool&) const;
1.192 mask_array<_Tp> operator[](const _Valarray_bool&);
1.193 valarray<_Tp> operator[](const _Valarray_size_t&) const;
1.194 indirect_array<_Tp> operator[](const _Valarray_size_t&);
1.195 -
1.196 +
1.197 public: // Unary operators.
1.198 valarray<_Tp> operator+() const { return *this; }
1.199
1.200 @@ -193,7 +203,7 @@
1.201 __tmp[__i] = -(*this)[__i];
1.202 return __tmp;
1.203 }
1.204 -
1.205 +
1.206 valarray<_Tp> operator~() const {
1.207 valarray<_Tp> __tmp(this->size(), _NoInit());
1.208 for (size_t __i = 0; __i < this->size(); ++__i)
1.209 @@ -209,7 +219,7 @@
1.210 (*this)[__i] *= __x;
1.211 return *this;
1.212 }
1.213 -
1.214 +
1.215 valarray<_Tp>& operator/= (const value_type& __x) {
1.216 for (size_t __i = 0; __i < this->size(); ++__i)
1.217 (*this)[__i] /= __x;
1.218 @@ -270,7 +280,7 @@
1.219 (*this)[__i] *= __x[__i];
1.220 return *this;
1.221 }
1.222 -
1.223 +
1.224 valarray<_Tp>& operator/= (const valarray<_Tp>& __x) {
1.225 for (size_t __i = 0; __i < this->size(); ++__i)
1.226 (*this)[__i] /= __x[__i];
1.227 @@ -357,11 +367,11 @@
1.228 __f);
1.229 return __tmp;
1.230 }
1.231 -
1.232 +
1.233 void resize(size_t __n, value_type __x = value_type()) {
1.234 - _STLP_STD::_Destroy(this->_M_first, this->_M_first + this->_M_size);
1.235 - this->_Valarray_base<_Tp>::_M_deallocate();
1.236 - this->_Valarray_base<_Tp>::_M_allocate(__n);
1.237 + _STLP_STD::_Destroy_Range(this->_M_first, this->_M_first + this->_M_size);
1.238 + _Valarray_base<_Tp>::_M_deallocate();
1.239 + _Valarray_base<_Tp>::_M_allocate(__n);
1.240 uninitialized_fill_n(this->_M_first, this->_M_size, __x);
1.241 }
1.242 };
1.243 @@ -372,7 +382,7 @@
1.244 // Binary arithmetic operations between two arrays. Behavior is
1.245 // undefined if the two arrays do not have the same length.
1.246
1.247 -template <class _Tp>
1.248 +template <class _Tp>
1.249 inline valarray<_Tp> _STLP_CALL operator*(const valarray<_Tp>& __x,
1.250 const valarray<_Tp>& __y) {
1.251 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.252 @@ -382,7 +392,7 @@
1.253 return __tmp;
1.254 }
1.255
1.256 -template <class _Tp>
1.257 +template <class _Tp>
1.258 inline valarray<_Tp> _STLP_CALL operator/(const valarray<_Tp>& __x,
1.259 const valarray<_Tp>& __y) {
1.260 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.261 @@ -392,7 +402,7 @@
1.262 return __tmp;
1.263 }
1.264
1.265 -template <class _Tp>
1.266 +template <class _Tp>
1.267 inline valarray<_Tp> _STLP_CALL operator%(const valarray<_Tp>& __x,
1.268 const valarray<_Tp>& __y) {
1.269 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.270 @@ -402,7 +412,7 @@
1.271 return __tmp;
1.272 }
1.273
1.274 -template <class _Tp>
1.275 +template <class _Tp>
1.276 inline valarray<_Tp> _STLP_CALL operator+(const valarray<_Tp>& __x,
1.277 const valarray<_Tp>& __y) {
1.278 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.279 @@ -412,7 +422,7 @@
1.280 return __tmp;
1.281 }
1.282
1.283 -template <class _Tp>
1.284 +template <class _Tp>
1.285 inline valarray<_Tp> _STLP_CALL operator-(const valarray<_Tp>& __x,
1.286 const valarray<_Tp>& __y) {
1.287 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.288 @@ -422,7 +432,7 @@
1.289 return __tmp;
1.290 }
1.291
1.292 -template <class _Tp>
1.293 +template <class _Tp>
1.294 inline valarray<_Tp> _STLP_CALL operator^(const valarray<_Tp>& __x,
1.295 const valarray<_Tp>& __y) {
1.296 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.297 @@ -432,7 +442,7 @@
1.298 return __tmp;
1.299 }
1.300
1.301 -template <class _Tp>
1.302 +template <class _Tp>
1.303 inline valarray<_Tp> _STLP_CALL operator&(const valarray<_Tp>& __x,
1.304 const valarray<_Tp>& __y) {
1.305 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.306 @@ -442,7 +452,7 @@
1.307 return __tmp;
1.308 }
1.309
1.310 -template <class _Tp>
1.311 +template <class _Tp>
1.312 inline valarray<_Tp> _STLP_CALL operator|(const valarray<_Tp>& __x,
1.313 const valarray<_Tp>& __y) {
1.314 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.315 @@ -452,7 +462,7 @@
1.316 return __tmp;
1.317 }
1.318
1.319 -template <class _Tp>
1.320 +template <class _Tp>
1.321 inline valarray<_Tp> _STLP_CALL operator<<(const valarray<_Tp>& __x,
1.322 const valarray<_Tp>& __y) {
1.323 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.324 @@ -462,7 +472,7 @@
1.325 return __tmp;
1.326 }
1.327
1.328 -template <class _Tp>
1.329 +template <class _Tp>
1.330 inline valarray<_Tp> _STLP_CALL operator>>(const valarray<_Tp>& __x,
1.331 const valarray<_Tp>& __y) {
1.332 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.333 @@ -474,7 +484,7 @@
1.334
1.335 // Binary arithmetic operations between an array and a scalar.
1.336
1.337 -template <class _Tp>
1.338 +template <class _Tp>
1.339 inline valarray<_Tp> _STLP_CALL operator*(const valarray<_Tp>& __x, const _Tp& __c) {
1.340 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.341 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.342 @@ -483,7 +493,7 @@
1.343 return __tmp;
1.344 }
1.345
1.346 -template <class _Tp>
1.347 +template <class _Tp>
1.348 inline valarray<_Tp> _STLP_CALL operator*(const _Tp& __c, const valarray<_Tp>& __x) {
1.349 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.350 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.351 @@ -492,7 +502,7 @@
1.352 return __tmp;
1.353 }
1.354
1.355 -template <class _Tp>
1.356 +template <class _Tp>
1.357 inline valarray<_Tp> _STLP_CALL operator/(const valarray<_Tp>& __x, const _Tp& __c) {
1.358 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.359 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.360 @@ -501,7 +511,7 @@
1.361 return __tmp;
1.362 }
1.363
1.364 -template <class _Tp>
1.365 +template <class _Tp>
1.366 inline valarray<_Tp> _STLP_CALL operator/(const _Tp& __c, const valarray<_Tp>& __x) {
1.367 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.368 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.369 @@ -510,7 +520,7 @@
1.370 return __tmp;
1.371 }
1.372
1.373 -template <class _Tp>
1.374 +template <class _Tp>
1.375 inline valarray<_Tp> _STLP_CALL operator%(const valarray<_Tp>& __x, const _Tp& __c) {
1.376 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.377 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.378 @@ -519,7 +529,7 @@
1.379 return __tmp;
1.380 }
1.381
1.382 -template <class _Tp>
1.383 +template <class _Tp>
1.384 inline valarray<_Tp> _STLP_CALL operator%(const _Tp& __c, const valarray<_Tp>& __x) {
1.385 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.386 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.387 @@ -528,7 +538,7 @@
1.388 return __tmp;
1.389 }
1.390
1.391 -template <class _Tp>
1.392 +template <class _Tp>
1.393 inline valarray<_Tp> _STLP_CALL operator+(const valarray<_Tp>& __x, const _Tp& __c) {
1.394 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.395 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.396 @@ -537,7 +547,7 @@
1.397 return __tmp;
1.398 }
1.399
1.400 -template <class _Tp>
1.401 +template <class _Tp>
1.402 inline valarray<_Tp> _STLP_CALL operator+(const _Tp& __c, const valarray<_Tp>& __x) {
1.403 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.404 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.405 @@ -546,7 +556,7 @@
1.406 return __tmp;
1.407 }
1.408
1.409 -template <class _Tp>
1.410 +template <class _Tp>
1.411 inline valarray<_Tp> _STLP_CALL operator-(const valarray<_Tp>& __x, const _Tp& __c) {
1.412 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.413 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.414 @@ -555,7 +565,7 @@
1.415 return __tmp;
1.416 }
1.417
1.418 -template <class _Tp>
1.419 +template <class _Tp>
1.420 inline valarray<_Tp> _STLP_CALL operator-(const _Tp& __c, const valarray<_Tp>& __x) {
1.421 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.422 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.423 @@ -564,7 +574,7 @@
1.424 return __tmp;
1.425 }
1.426
1.427 -template <class _Tp>
1.428 +template <class _Tp>
1.429 inline valarray<_Tp> _STLP_CALL operator^(const valarray<_Tp>& __x, const _Tp& __c) {
1.430 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.431 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.432 @@ -573,7 +583,7 @@
1.433 return __tmp;
1.434 }
1.435
1.436 -template <class _Tp>
1.437 +template <class _Tp>
1.438 inline valarray<_Tp> _STLP_CALL operator^(const _Tp& __c, const valarray<_Tp>& __x) {
1.439 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.440 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.441 @@ -582,7 +592,7 @@
1.442 return __tmp;
1.443 }
1.444
1.445 -template <class _Tp>
1.446 +template <class _Tp>
1.447 inline valarray<_Tp> _STLP_CALL operator&(const valarray<_Tp>& __x, const _Tp& __c) {
1.448 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.449 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.450 @@ -591,7 +601,7 @@
1.451 return __tmp;
1.452 }
1.453
1.454 -template <class _Tp>
1.455 +template <class _Tp>
1.456 inline valarray<_Tp> _STLP_CALL operator&(const _Tp& __c, const valarray<_Tp>& __x) {
1.457 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.458 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.459 @@ -600,7 +610,7 @@
1.460 return __tmp;
1.461 }
1.462
1.463 -template <class _Tp>
1.464 +template <class _Tp>
1.465 inline valarray<_Tp> _STLP_CALL operator|(const valarray<_Tp>& __x, const _Tp& __c) {
1.466 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.467 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.468 @@ -609,7 +619,7 @@
1.469 return __tmp;
1.470 }
1.471
1.472 -template <class _Tp>
1.473 +template <class _Tp>
1.474 inline valarray<_Tp> _STLP_CALL operator|(const _Tp& __c, const valarray<_Tp>& __x) {
1.475 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.476 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.477 @@ -618,7 +628,7 @@
1.478 return __tmp;
1.479 }
1.480
1.481 -template <class _Tp>
1.482 +template <class _Tp>
1.483 inline valarray<_Tp> _STLP_CALL operator<<(const valarray<_Tp>& __x, const _Tp& __c) {
1.484 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.485 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.486 @@ -627,7 +637,7 @@
1.487 return __tmp;
1.488 }
1.489
1.490 -template <class _Tp>
1.491 +template <class _Tp>
1.492 inline valarray<_Tp> _STLP_CALL operator<<(const _Tp& __c, const valarray<_Tp>& __x) {
1.493 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.494 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.495 @@ -636,7 +646,7 @@
1.496 return __tmp;
1.497 }
1.498
1.499 -template <class _Tp>
1.500 +template <class _Tp>
1.501 inline valarray<_Tp> _STLP_CALL operator>>(const valarray<_Tp>& __x, const _Tp& __c) {
1.502 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.503 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.504 @@ -645,7 +655,7 @@
1.505 return __tmp;
1.506 }
1.507
1.508 -template <class _Tp>
1.509 +template <class _Tp>
1.510 inline valarray<_Tp> _STLP_CALL operator>>(const _Tp& __c, const valarray<_Tp>& __x) {
1.511 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.512 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.513 @@ -658,89 +668,89 @@
1.514 // if the two arrays have different lengths. Note that operator== does
1.515 // not do what you might at first expect.
1.516
1.517 -template <class _Tp>
1.518 +template <class _Tp>
1.519 inline _Valarray_bool _STLP_CALL operator==(const valarray<_Tp>& __x,
1.520 const valarray<_Tp>& __y)
1.521 {
1.522 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.523 for (size_t __i = 0; __i < __x.size(); ++__i)
1.524 __tmp[__i] = __x[__i] == __y[__i];
1.525 - return __tmp;
1.526 + return __tmp;
1.527 }
1.528
1.529 -template <class _Tp>
1.530 +template <class _Tp>
1.531 inline _Valarray_bool _STLP_CALL operator<(const valarray<_Tp>& __x,
1.532 const valarray<_Tp>& __y)
1.533 {
1.534 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.535 for (size_t __i = 0; __i < __x.size(); ++__i)
1.536 __tmp[__i] = __x[__i] < __y[__i];
1.537 - return __tmp;
1.538 + return __tmp;
1.539 }
1.540
1.541 #ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
1.542
1.543 -template <class _Tp>
1.544 +template <class _Tp>
1.545 inline _Valarray_bool _STLP_CALL operator!=(const valarray<_Tp>& __x,
1.546 const valarray<_Tp>& __y)
1.547 {
1.548 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.549 for (size_t __i = 0; __i < __x.size(); ++__i)
1.550 __tmp[__i] = __x[__i] != __y[__i];
1.551 - return __tmp;
1.552 + return __tmp;
1.553 }
1.554
1.555 -template <class _Tp>
1.556 +template <class _Tp>
1.557 inline _Valarray_bool _STLP_CALL operator>(const valarray<_Tp>& __x,
1.558 const valarray<_Tp>& __y)
1.559 {
1.560 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.561 for (size_t __i = 0; __i < __x.size(); ++__i)
1.562 __tmp[__i] = __x[__i] > __y[__i];
1.563 - return __tmp;
1.564 + return __tmp;
1.565 }
1.566
1.567 -template <class _Tp>
1.568 +template <class _Tp>
1.569 inline _Valarray_bool _STLP_CALL operator<=(const valarray<_Tp>& __x,
1.570 const valarray<_Tp>& __y)
1.571 {
1.572 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.573 for (size_t __i = 0; __i < __x.size(); ++__i)
1.574 __tmp[__i] = __x[__i] <= __y[__i];
1.575 - return __tmp;
1.576 + return __tmp;
1.577 }
1.578
1.579 -template <class _Tp>
1.580 +template <class _Tp>
1.581 inline _Valarray_bool _STLP_CALL operator>=(const valarray<_Tp>& __x,
1.582 const valarray<_Tp>& __y)
1.583 {
1.584 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.585 for (size_t __i = 0; __i < __x.size(); ++__i)
1.586 __tmp[__i] = __x[__i] >= __y[__i];
1.587 - return __tmp;
1.588 + return __tmp;
1.589 }
1.590
1.591 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
1.592 // fbp : swap ?
1.593
1.594 -template <class _Tp>
1.595 +template <class _Tp>
1.596 inline _Valarray_bool _STLP_CALL operator&&(const valarray<_Tp>& __x,
1.597 const valarray<_Tp>& __y)
1.598 {
1.599 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.600 for (size_t __i = 0; __i < __x.size(); ++__i)
1.601 __tmp[__i] = __x[__i] && __y[__i];
1.602 - return __tmp;
1.603 + return __tmp;
1.604 }
1.605
1.606 -template <class _Tp>
1.607 +template <class _Tp>
1.608 inline _Valarray_bool _STLP_CALL operator||(const valarray<_Tp>& __x,
1.609 const valarray<_Tp>& __y)
1.610 {
1.611 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.612 for (size_t __i = 0; __i < __x.size(); ++__i)
1.613 __tmp[__i] = __x[__i] || __y[__i];
1.614 - return __tmp;
1.615 + return __tmp;
1.616 }
1.617
1.618 // Logical operations between an array and a scalar.
1.619 @@ -751,7 +761,7 @@
1.620 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.621 for (size_t __i = 0; __i < __x.size(); ++__i)
1.622 __tmp[__i] = __x[__i] == __c;
1.623 - return __tmp;
1.624 + return __tmp;
1.625 }
1.626
1.627 template <class _Tp>
1.628 @@ -760,7 +770,7 @@
1.629 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.630 for (size_t __i = 0; __i < __x.size(); ++__i)
1.631 __tmp[__i] = __c == __x[__i];
1.632 - return __tmp;
1.633 + return __tmp;
1.634 }
1.635
1.636 template <class _Tp>
1.637 @@ -769,7 +779,7 @@
1.638 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.639 for (size_t __i = 0; __i < __x.size(); ++__i)
1.640 __tmp[__i] = __x[__i] != __c;
1.641 - return __tmp;
1.642 + return __tmp;
1.643 }
1.644
1.645 template <class _Tp>
1.646 @@ -778,7 +788,7 @@
1.647 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.648 for (size_t __i = 0; __i < __x.size(); ++__i)
1.649 __tmp[__i] = __c != __x[__i];
1.650 - return __tmp;
1.651 + return __tmp;
1.652 }
1.653
1.654 template <class _Tp>
1.655 @@ -787,7 +797,7 @@
1.656 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.657 for (size_t __i = 0; __i < __x.size(); ++__i)
1.658 __tmp[__i] = __x[__i] < __c;
1.659 - return __tmp;
1.660 + return __tmp;
1.661 }
1.662
1.663 template <class _Tp>
1.664 @@ -796,7 +806,7 @@
1.665 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.666 for (size_t __i = 0; __i < __x.size(); ++__i)
1.667 __tmp[__i] = __c < __x[__i];
1.668 - return __tmp;
1.669 + return __tmp;
1.670 }
1.671
1.672 template <class _Tp>
1.673 @@ -805,7 +815,7 @@
1.674 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.675 for (size_t __i = 0; __i < __x.size(); ++__i)
1.676 __tmp[__i] = __x[__i] > __c;
1.677 - return __tmp;
1.678 + return __tmp;
1.679 }
1.680
1.681 template <class _Tp>
1.682 @@ -814,7 +824,7 @@
1.683 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.684 for (size_t __i = 0; __i < __x.size(); ++__i)
1.685 __tmp[__i] = __c > __x[__i];
1.686 - return __tmp;
1.687 + return __tmp;
1.688 }
1.689
1.690 template <class _Tp>
1.691 @@ -823,7 +833,7 @@
1.692 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.693 for (size_t __i = 0; __i < __x.size(); ++__i)
1.694 __tmp[__i] = __x[__i] <= __c;
1.695 - return __tmp;
1.696 + return __tmp;
1.697 }
1.698
1.699 template <class _Tp>
1.700 @@ -832,7 +842,7 @@
1.701 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.702 for (size_t __i = 0; __i < __x.size(); ++__i)
1.703 __tmp[__i] = __c <= __x[__i];
1.704 - return __tmp;
1.705 + return __tmp;
1.706 }
1.707
1.708 template <class _Tp>
1.709 @@ -841,7 +851,7 @@
1.710 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.711 for (size_t __i = 0; __i < __x.size(); ++__i)
1.712 __tmp[__i] = __x[__i] >= __c;
1.713 - return __tmp;
1.714 + return __tmp;
1.715 }
1.716
1.717 template <class _Tp>
1.718 @@ -850,7 +860,7 @@
1.719 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.720 for (size_t __i = 0; __i < __x.size(); ++__i)
1.721 __tmp[__i] = __c >= __x[__i];
1.722 - return __tmp;
1.723 + return __tmp;
1.724 }
1.725
1.726 template <class _Tp>
1.727 @@ -859,7 +869,7 @@
1.728 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.729 for (size_t __i = 0; __i < __x.size(); ++__i)
1.730 __tmp[__i] = __x[__i] && __c;
1.731 - return __tmp;
1.732 + return __tmp;
1.733 }
1.734
1.735 template <class _Tp>
1.736 @@ -868,7 +878,7 @@
1.737 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.738 for (size_t __i = 0; __i < __x.size(); ++__i)
1.739 __tmp[__i] = __c && __x[__i];
1.740 - return __tmp;
1.741 + return __tmp;
1.742 }
1.743
1.744 template <class _Tp>
1.745 @@ -877,7 +887,7 @@
1.746 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.747 for (size_t __i = 0; __i < __x.size(); ++__i)
1.748 __tmp[__i] = __x[__i] || __c;
1.749 - return __tmp;
1.750 + return __tmp;
1.751 }
1.752
1.753 template <class _Tp>
1.754 @@ -886,7 +896,7 @@
1.755 _Valarray_bool __tmp(__x.size(), _Valarray_bool::_NoInit());
1.756 for (size_t __i = 0; __i < __x.size(); ++__i)
1.757 __tmp[__i] = __c || __x[__i];
1.758 - return __tmp;
1.759 + return __tmp;
1.760 }
1.761
1.762 // valarray "transcendentals" (the list includes abs and sqrt, which,
1.763 @@ -897,7 +907,7 @@
1.764 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.765 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.766 for (size_t __i = 0; __i < __x.size(); ++__i)
1.767 - __tmp[__i] = _STLP_DO_ABS(_Tp)(__x[__i]);
1.768 + __tmp[__i] = ::abs(__x[__i]);
1.769 return __tmp;
1.770 }
1.771
1.772 @@ -906,7 +916,7 @@
1.773 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.774 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.775 for (size_t __i = 0; __i < __x.size(); ++__i)
1.776 - __tmp[__i] = _STLP_DO_ACOS(_Tp)(__x[__i]);
1.777 + __tmp[__i] = ::acos(__x[__i]);
1.778 return __tmp;
1.779 }
1.780
1.781 @@ -915,7 +925,7 @@
1.782 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.783 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.784 for (size_t __i = 0; __i < __x.size(); ++__i)
1.785 - __tmp[__i] = _STLP_DO_ASIN(_Tp)(__x[__i]);
1.786 + __tmp[__i] = ::asin(__x[__i]);
1.787 return __tmp;
1.788 }
1.789
1.790 @@ -924,7 +934,7 @@
1.791 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.792 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.793 for (size_t __i = 0; __i < __x.size(); ++__i)
1.794 - __tmp[__i] = _STLP_DO_ATAN(_Tp)(__x[__i]);
1.795 + __tmp[__i] = ::atan(__x[__i]);
1.796 return __tmp;
1.797 }
1.798
1.799 @@ -934,7 +944,7 @@
1.800 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.801 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.802 for (size_t __i = 0; __i < __x.size(); ++__i)
1.803 - __tmp[__i] = _STLP_DO_ATAN2(_Tp)(__x[__i], __y[__i]);
1.804 + __tmp[__i] = ::atan2(__x[__i], __y[__i]);
1.805 return __tmp;
1.806 }
1.807
1.808 @@ -943,7 +953,7 @@
1.809 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.810 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.811 for (size_t __i = 0; __i < __x.size(); ++__i)
1.812 - __tmp[__i] = _STLP_DO_ATAN2(_Tp)(__x[__i], __c);
1.813 + __tmp[__i] = ::atan2(__x[__i], __c);
1.814 return __tmp;
1.815 }
1.816
1.817 @@ -952,7 +962,7 @@
1.818 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.819 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.820 for (size_t __i = 0; __i < __x.size(); ++__i)
1.821 - __tmp[__i] = _STLP_DO_ATAN2(_Tp)(__c, __x[__i]);
1.822 + __tmp[__i] = ::atan2(__c, __x[__i]);
1.823 return __tmp;
1.824 }
1.825
1.826 @@ -961,7 +971,7 @@
1.827 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.828 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.829 for (size_t __i = 0; __i < __x.size(); ++__i)
1.830 - __tmp[__i] = _STLP_DO_COS(_Tp)(__x[__i]);
1.831 + __tmp[__i] = ::cos(__x[__i]);
1.832 return __tmp;
1.833 }
1.834
1.835 @@ -970,7 +980,7 @@
1.836 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.837 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.838 for (size_t __i = 0; __i < __x.size(); ++__i)
1.839 - __tmp[__i] = _STLP_DO_COSH(_Tp)(__x[__i]);
1.840 + __tmp[__i] = ::cosh(__x[__i]);
1.841 return __tmp;
1.842 }
1.843
1.844 @@ -979,7 +989,7 @@
1.845 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.846 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.847 for (size_t __i = 0; __i < __x.size(); ++__i)
1.848 - __tmp[__i] = _STLP_DO_EXP(_Tp)(__x[__i]);
1.849 + __tmp[__i] = ::exp(__x[__i]);
1.850 return __tmp;
1.851 }
1.852
1.853 @@ -988,7 +998,7 @@
1.854 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.855 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.856 for (size_t __i = 0; __i < __x.size(); ++__i)
1.857 - __tmp[__i] = _STLP_DO_LOG(_Tp)(__x[__i]);
1.858 + __tmp[__i] = ::log(__x[__i]);
1.859 return __tmp;
1.860 }
1.861
1.862 @@ -997,17 +1007,17 @@
1.863 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.864 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.865 for (size_t __i = 0; __i < __x.size(); ++__i)
1.866 - __tmp[__i] = _STLP_DO_LOG10(_Tp)(__x[__i]);
1.867 + __tmp[__i] = ::log10(__x[__i]);
1.868 return __tmp;
1.869 }
1.870
1.871 template <class _Tp>
1.872 inline valarray<_Tp> pow(const valarray<_Tp>& __x,
1.873 - const valarray<_Tp>& __y) {
1.874 + const valarray<_Tp>& __y) {
1.875 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.876 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.877 for (size_t __i = 0; __i < __x.size(); ++__i)
1.878 - __tmp[__i] = _STLP_DO_POW(_Tp)(__x[__i], __y[__i]);
1.879 + __tmp[__i] = ::pow(__x[__i], __y[__i]);
1.880 return __tmp;
1.881 }
1.882
1.883 @@ -1016,7 +1026,7 @@
1.884 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.885 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.886 for (size_t __i = 0; __i < __x.size(); ++__i)
1.887 - __tmp[__i] = _STLP_DO_POW(_Tp)(__x[__i], __c);
1.888 + __tmp[__i] = ::pow(__x[__i], __c);
1.889 return __tmp;
1.890 }
1.891
1.892 @@ -1025,7 +1035,7 @@
1.893 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.894 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.895 for (size_t __i = 0; __i < __x.size(); ++__i)
1.896 - __tmp[__i] = _STLP_DO_POW(_Tp)(__c, __x[__i]);
1.897 + __tmp[__i] = ::pow(__c, __x[__i]);
1.898 return __tmp;
1.899 }
1.900
1.901 @@ -1034,7 +1044,7 @@
1.902 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.903 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.904 for (size_t __i = 0; __i < __x.size(); ++__i)
1.905 - __tmp[__i] = _STLP_DO_SIN(_Tp)(__x[__i]);
1.906 + __tmp[__i] = ::sin(__x[__i]);
1.907 return __tmp;
1.908 }
1.909
1.910 @@ -1043,7 +1053,7 @@
1.911 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.912 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.913 for (size_t __i = 0; __i < __x.size(); ++__i)
1.914 - __tmp[__i] = _STLP_DO_SINH(_Tp)(__x[__i]);
1.915 + __tmp[__i] = ::sinh(__x[__i]);
1.916 return __tmp;
1.917 }
1.918
1.919 @@ -1052,7 +1062,7 @@
1.920 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.921 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.922 for (size_t __i = 0; __i < __x.size(); ++__i)
1.923 - __tmp[__i] = _STLP_DO_SQRT(_Tp)(__x[__i]);
1.924 + __tmp[__i] = ::sqrt(__x[__i]);
1.925 return __tmp;
1.926 }
1.927
1.928 @@ -1061,7 +1071,7 @@
1.929 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.930 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.931 for (size_t __i = 0; __i < __x.size(); ++__i)
1.932 - __tmp[__i] = _STLP_DO_TAN(_Tp)(__x[__i]);
1.933 + __tmp[__i] = ::tan(__x[__i]);
1.934 return __tmp;
1.935 }
1.936
1.937 @@ -1070,7 +1080,7 @@
1.938 typedef typename valarray<_Tp>::_NoInit _NoInit;
1.939 valarray<_Tp> __tmp(__x.size(), _NoInit());
1.940 for (size_t __i = 0; __i < __x.size(); ++__i)
1.941 - __tmp[__i] = _STLP_DO_TANH(_Tp)(__x[__i]);
1.942 + __tmp[__i] = ::tanh(__x[__i]);
1.943 return __tmp;
1.944 }
1.945
1.946 @@ -1089,7 +1099,6 @@
1.947 size_t size() const { return _M_length; }
1.948 size_t stride() const { return _M_stride; }
1.949
1.950 -
1.951 private:
1.952 size_t _M_start;
1.953 size_t _M_length;
1.954 @@ -1107,11 +1116,7 @@
1.955 for (size_t __i = 0;
1.956 __i < _M_slice.size();
1.957 ++__i, __index += _M_slice.stride())
1.958 -#ifdef __SYMBIAN32__
1.959 - (*_M_array)[__index] = __x[__i];
1.960 -#else
1.961 _M_array[__index] = __x[__i];
1.962 -#endif
1.963 }
1.964
1.965 void operator*=(const valarray<value_type>& __x) const {
1.966 @@ -1119,11 +1124,7 @@
1.967 for (size_t __i = 0;
1.968 __i < _M_slice.size();
1.969 ++__i, __index += _M_slice.stride())
1.970 -#ifdef __SYMBIAN32__
1.971 - (*_M_array)[__index] *= __x[__i];
1.972 -#else
1.973 - _M_array[__index] *= __x[__i];
1.974 -#endif
1.975 + _M_array[__index] *= __x[__i];
1.976 }
1.977
1.978 void operator/=(const valarray<value_type>& __x) const {
1.979 @@ -1131,11 +1132,7 @@
1.980 for (size_t __i = 0;
1.981 __i < _M_slice.size();
1.982 ++__i, __index += _M_slice.stride())
1.983 -#ifdef __SYMBIAN32__
1.984 - (*_M_array)[__index] /= __x[__i];
1.985 -#else
1.986 _M_array[__index] /= __x[__i];
1.987 -#endif
1.988 }
1.989
1.990 void operator%=(const valarray<value_type>& __x) const {
1.991 @@ -1143,11 +1140,7 @@
1.992 for (size_t __i = 0;
1.993 __i < _M_slice.size();
1.994 ++__i, __index += _M_slice.stride())
1.995 -#ifdef __SYMBIAN32__
1.996 - (*_M_array)[__index] %= __x[__i];
1.997 -#else
1.998 _M_array[__index] %= __x[__i];
1.999 -#endif
1.1000 }
1.1001
1.1002 void operator+=(const valarray<value_type>& __x) const {
1.1003 @@ -1155,11 +1148,7 @@
1.1004 for (size_t __i = 0;
1.1005 __i < _M_slice.size();
1.1006 ++__i, __index += _M_slice.stride())
1.1007 -#ifdef __SYMBIAN32__
1.1008 - (*_M_array)[__index] += __x[__i];
1.1009 -#else
1.1010 _M_array[__index] += __x[__i];
1.1011 -#endif
1.1012 }
1.1013
1.1014 void operator-=(const valarray<value_type>& __x) const {
1.1015 @@ -1167,11 +1156,7 @@
1.1016 for (size_t __i = 0;
1.1017 __i < _M_slice.size();
1.1018 ++__i, __index += _M_slice.stride())
1.1019 -#ifdef __SYMBIAN32__
1.1020 - (*_M_array)[__index] -= __x[__i];
1.1021 -#else
1.1022 _M_array[__index] -= __x[__i];
1.1023 -#endif
1.1024 }
1.1025
1.1026 void operator^=(const valarray<value_type>& __x) const {
1.1027 @@ -1179,11 +1164,7 @@
1.1028 for (size_t __i = 0;
1.1029 __i < _M_slice.size();
1.1030 ++__i, __index += _M_slice.stride())
1.1031 -#ifdef __SYMBIAN32__
1.1032 - (*_M_array)[__index] ^= __x[__i];
1.1033 -#else
1.1034 _M_array[__index] ^= __x[__i];
1.1035 -#endif
1.1036 }
1.1037
1.1038 void operator&=(const valarray<value_type>& __x) const {
1.1039 @@ -1191,11 +1172,7 @@
1.1040 for (size_t __i = 0;
1.1041 __i < _M_slice.size();
1.1042 ++__i, __index += _M_slice.stride())
1.1043 -#ifdef __SYMBIAN32__
1.1044 - (*_M_array)[__index] &= __x[__i];
1.1045 -#else
1.1046 _M_array[__index] &= __x[__i];
1.1047 -#endif
1.1048 }
1.1049
1.1050 void operator|=(const valarray<value_type>& __x) const {
1.1051 @@ -1203,11 +1180,7 @@
1.1052 for (size_t __i = 0;
1.1053 __i < _M_slice.size();
1.1054 ++__i, __index += _M_slice.stride())
1.1055 -#ifdef __SYMBIAN32__
1.1056 - (*_M_array)[__index] |= __x[__i];
1.1057 -#else
1.1058 _M_array[__index] |= __x[__i];
1.1059 -#endif
1.1060 }
1.1061
1.1062 void operator<<=(const valarray<value_type>& __x) const {
1.1063 @@ -1215,11 +1188,7 @@
1.1064 for (size_t __i = 0;
1.1065 __i < _M_slice.size();
1.1066 ++__i, __index += _M_slice.stride())
1.1067 -#ifdef __SYMBIAN32__
1.1068 - (*_M_array)[__index] <<= __x[__i];
1.1069 -#else
1.1070 _M_array[__index] <<= __x[__i];
1.1071 -#endif
1.1072 }
1.1073
1.1074 void operator>>=(const valarray<value_type>& __x) const {
1.1075 @@ -1227,69 +1196,48 @@
1.1076 for (size_t __i = 0;
1.1077 __i < _M_slice.size();
1.1078 ++__i, __index += _M_slice.stride())
1.1079 -#ifdef __SYMBIAN32__
1.1080 - (*_M_array)[__index] >>= __x[__i];
1.1081 -#else
1.1082 _M_array[__index] >>= __x[__i];
1.1083 -#endif
1.1084 }
1.1085
1.1086 - void operator=(const value_type& __c) {
1.1087 + void operator=(const value_type& __c) /*const could be const but standard says NO (26.3.5.4-1)*/ {
1.1088 size_t __index = _M_slice.start();
1.1089 for (size_t __i = 0;
1.1090 __i < _M_slice.size();
1.1091 ++__i, __index += _M_slice.stride())
1.1092 -#ifdef __SYMBIAN32__
1.1093 - (*_M_array)[__index] = __c;
1.1094 -#else
1.1095 _M_array[__index] = __c;
1.1096 -#endif
1.1097 }
1.1098 -
1.1099 - slice_array<_Tp>&
1.1100 - operator=(const slice_array<_Tp>& __a)
1.1101 - {
1.1102 - size_t __index = _M_slice.start();
1.1103 - for (size_t __i = __a._M_slice.start();
1.1104 - __i < _M_slice.size();
1.1105 - __i += __a._M_slice.stride(), __index += _M_slice.stride())
1.1106 - _M_array[__index] = __a._M_array[__index][__i];
1.1107 - return *this;
1.1108 - }
1.1109 -
1.1110 - slice_array(const slice_array<_Tp>& a)
1.1111 - : _M_slice(a._M_slice), _M_array(a._M_array){}
1.1112
1.1113 ~slice_array() {}
1.1114
1.1115 private:
1.1116 - slice_array(const slice& __slice, valarray<_Tp>* __array)
1.1117 + slice_array(const slice& __slice, valarray<_Tp>& __array)
1.1118 : _M_slice(__slice), _M_array(__array)
1.1119 {}
1.1120
1.1121 slice _M_slice;
1.1122 - valarray<_Tp>* _M_array;
1.1123 + valarray<_Tp>& _M_array;
1.1124
1.1125 private: // Disable assignment and default constructor
1.1126 slice_array();
1.1127 + slice_array(const slice_array&);
1.1128 + slice_array& operator=(const slice_array&);
1.1129 };
1.1130
1.1131 // valarray member functions dealing with slice and slice_array
1.1132
1.1133 template <class _Tp>
1.1134 inline valarray<_Tp>::valarray(const slice_array<_Tp>& __x)
1.1135 - : _Valarray_base<_Tp>(__x._M_slice.size())
1.1136 -{
1.1137 + : _Valarray_base<_Tp>(__x._M_slice.size()) {
1.1138 typedef typename __type_traits<_Tp>::has_trivial_default_constructor
1.1139 _Is_Trivial;
1.1140 - _M_initialize(_Is_Trivial());
1.1141 + _M_initialize(_Is_Trivial());
1.1142 *this = __x;
1.1143 }
1.1144
1.1145
1.1146 template <class _Tp>
1.1147 inline slice_array<_Tp> valarray<_Tp>::operator[](slice __slice) {
1.1148 - return slice_array<_Tp>(__slice, this);
1.1149 + return slice_array<_Tp>(__slice, *this);
1.1150 }
1.1151
1.1152 //----------------------------------------------------------------------
1.1153 @@ -1348,7 +1296,7 @@
1.1154 _M_indices(size_t(0), __gslice._M_lengths.size()),
1.1155 _M_gslice(__gslice)
1.1156 {}
1.1157 -
1.1158 +
1.1159 bool _M_done() const { return _M_indices[0] == _M_gslice._M_lengths[0]; }
1.1160
1.1161 bool _M_incr();
1.1162 @@ -1445,7 +1393,7 @@
1.1163 }
1.1164 }
1.1165
1.1166 - void operator= (const value_type& __c) {
1.1167 + void operator= (const value_type& __c) /*const could be const but standard says NO (26.3.7.4-1)*/ {
1.1168 if (!_M_gslice._M_empty()) {
1.1169 _Gslice_Iter __i(_M_gslice);
1.1170 do _M_array[__i._M_1d_idx] = __c; while(__i._M_incr());
1.1171 @@ -1454,8 +1402,8 @@
1.1172
1.1173 ~gslice_array() {}
1.1174
1.1175 -private:
1.1176 - gslice_array(gslice __gslice, valarray<_Tp>& __array)
1.1177 +private:
1.1178 + gslice_array(const gslice& __gslice, valarray<_Tp>& __array)
1.1179 : _M_gslice(__gslice), _M_array(__array)
1.1180 {}
1.1181
1.1182 @@ -1472,11 +1420,10 @@
1.1183
1.1184 template <class _Tp>
1.1185 inline valarray<_Tp>::valarray(const gslice_array<_Tp>& __x)
1.1186 - : _Valarray_base<_Tp>(__x._M_gslice._M_size())
1.1187 -{
1.1188 + : _Valarray_base<_Tp>(__x._M_gslice._M_size()) {
1.1189 typedef typename __type_traits<_Tp>::has_trivial_default_constructor
1.1190 _Is_Trivial;
1.1191 - _M_initialize(_Is_Trivial());
1.1192 + _M_initialize(_Is_Trivial());
1.1193 *this = __x;
1.1194 }
1.1195
1.1196 @@ -1497,120 +1444,72 @@
1.1197
1.1198 void operator=(const valarray<value_type>& __x) const {
1.1199 size_t __idx = 0;
1.1200 -#ifdef __SYMBIAN32__
1.1201 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1202 -#else
1.1203 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1204 -#endif // __SYMBIAN32__
1.1205 if (_M_mask[__i]) _M_array[__i] = __x[__idx++];
1.1206 }
1.1207
1.1208 void operator*=(const valarray<value_type>& __x) const {
1.1209 size_t __idx = 0;
1.1210 -#ifdef __SYMBIAN32__
1.1211 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1212 -#else
1.1213 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1214 -#endif // __SYMBIAN32__
1.1215 if (_M_mask[__i]) _M_array[__i] *= __x[__idx++];
1.1216 }
1.1217
1.1218 void operator/=(const valarray<value_type>& __x) const {
1.1219 size_t __idx = 0;
1.1220 -#ifdef __SYMBIAN32__
1.1221 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1222 -#else
1.1223 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1224 -#endif //__SYMBIAN32__
1.1225 if (_M_mask[__i]) _M_array[__i] /= __x[__idx++];
1.1226 }
1.1227
1.1228 void operator%=(const valarray<value_type>& __x) const {
1.1229 size_t __idx = 0;
1.1230 -#ifdef __SYMBIAN32__
1.1231 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1232 -#else
1.1233 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1234 -#endif
1.1235 if (_M_mask[__i]) _M_array[__i] %= __x[__idx++];
1.1236 }
1.1237
1.1238 void operator+=(const valarray<value_type>& __x) const {
1.1239 size_t __idx = 0;
1.1240 -#ifdef __SYMBIAN32__
1.1241 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1242 -#else
1.1243 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1244 -#endif
1.1245 if (_M_mask[__i]) _M_array[__i] += __x[__idx++];
1.1246 }
1.1247
1.1248 void operator-=(const valarray<value_type>& __x) const {
1.1249 size_t __idx = 0;
1.1250 -#ifdef __SYMBIAN32__
1.1251 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1252 -#else
1.1253 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1254 -#endif //__SYMBIAN32__
1.1255 if (_M_mask[__i]) _M_array[__i] -= __x[__idx++];
1.1256 }
1.1257 -
1.1258 +
1.1259 void operator^=(const valarray<value_type>& __x) const {
1.1260 size_t __idx = 0;
1.1261 -#ifdef __SYMBIAN32__
1.1262 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1263 -#else
1.1264 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1265 -#endif // __SYMBIAN32__
1.1266 if (_M_mask[__i]) _M_array[__i] ^= __x[__idx++];
1.1267 }
1.1268
1.1269 void operator&=(const valarray<value_type>& __x) const {
1.1270 size_t __idx = 0;
1.1271 -#ifdef __SYMBIAN32__
1.1272 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1273 -#else
1.1274 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1275 -#endif // __SYMBIAN32__
1.1276 if (_M_mask[__i]) _M_array[__i] &= __x[__idx++];
1.1277 }
1.1278
1.1279 void operator|=(const valarray<value_type>& __x) const {
1.1280 size_t __idx = 0;
1.1281 -#ifdef __SYMBIAN32__
1.1282 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1283 -#else
1.1284 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1285 -#endif // __SYMBIAN32__
1.1286 if (_M_mask[__i]) _M_array[__i] |= __x[__idx++];
1.1287 }
1.1288
1.1289 void operator<<=(const valarray<value_type>& __x) const {
1.1290 size_t __idx = 0;
1.1291 -#ifdef __SYMBIAN32__
1.1292 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1293 -#else
1.1294 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1295 -#endif // __SYMBIAN32__
1.1296 if (_M_mask[__i]) _M_array[__i] <<= __x[__idx++];
1.1297 }
1.1298
1.1299 void operator>>=(const valarray<value_type>& __x) const {
1.1300 size_t __idx = 0;
1.1301 -#ifdef __SYMBIAN32__
1.1302 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1303 -#else
1.1304 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1305 -#endif // __SYMBIAN32__
1.1306 if (_M_mask[__i]) _M_array[__i] >>= __x[__idx++];
1.1307 }
1.1308
1.1309 void operator=(const value_type& __c) const {
1.1310 -#ifdef __SYMBIAN32__
1.1311 - for (size_t __i = 0; __i < _M_array.size() && __i < _M_mask.size(); ++__i)
1.1312 -#else
1.1313 for (size_t __i = 0; __i < _M_array.size(); ++__i)
1.1314 -#endif // __SYMBIAN32__
1.1315 if (_M_mask[__i]) _M_array[__i] = __c;
1.1316 }
1.1317
1.1318 @@ -1644,7 +1543,7 @@
1.1319 {
1.1320 typedef typename __type_traits<_Tp>::has_trivial_default_constructor
1.1321 _Is_Trivial;
1.1322 - _M_initialize(_Is_Trivial());
1.1323 + _M_initialize(_Is_Trivial());
1.1324 *this = __x;
1.1325 }
1.1326
1.1327 @@ -1653,17 +1552,7 @@
1.1328 inline valarray<_Tp>& valarray<_Tp>::operator=(const mask_array<_Tp>& __x) {
1.1329 size_t __idx = 0;
1.1330 for (size_t __i = 0; __i < __x._M_array.size(); ++__i)
1.1331 - if (__x._M_mask[__i])
1.1332 - {
1.1333 -#ifdef __SYMBIAN32__
1.1334 - if(__idx < this->_M_size)
1.1335 - (*this)[__idx++] = __x._M_array[__i];
1.1336 - else
1.1337 - break;
1.1338 -#else
1.1339 - (*this)[__idx++] = __x._M_array[__i];
1.1340 -#endif
1.1341 - }
1.1342 + if (__x._M_mask[__i]) (*this)[__idx++] = __x._M_array[__i];
1.1343 return *this;
1.1344 }
1.1345
1.1346 @@ -1765,7 +1654,7 @@
1.1347 {
1.1348 typedef typename __type_traits<_Tp>::has_trivial_default_constructor
1.1349 _Is_Trivial;
1.1350 - _M_initialize(_Is_Trivial());
1.1351 + _M_initialize(_Is_Trivial());
1.1352 *this = __x;
1.1353 }
1.1354