Commit eb9a4231 by Paolo Carlini Committed by Paolo Carlini

std_complex.h: Fully qualify standard functions with std::, thus avoiding Koenig lookup.

2003-07-05  Paolo Carlini  <pcarlini@unitus.it>

	* include/std/std_complex.h: Fully qualify standard
	functions with std::, thus avoiding Koenig lookup.
	* include/std/std_memory.h: Likewise.
	* include/std/std_valarray.h: Likewise.

From-SVN: r68982
parent 2c4a71b3
2003-07-05 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_complex.h: Fully qualify standard
functions with std::, thus avoiding Koenig lookup.
* include/std/std_memory.h: Likewise.
* include/std/std_valarray.h: Likewise.
2003-07-05 Gawain Bolton <gp.bolton@computer.org> 2003-07-05 Gawain Bolton <gp.bolton@computer.org>
* include/bits/stl_tree.h: _Rb_tree_rebalance(): Add local * include/bits/stl_tree.h: _Rb_tree_rebalance(): Add local
......
...@@ -243,7 +243,7 @@ namespace std ...@@ -243,7 +243,7 @@ namespace std
complex<_Tp>::operator/=(const complex<_Up>& __z) complex<_Tp>::operator/=(const complex<_Up>& __z)
{ {
const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag(); const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag();
const _Tp __n = norm(__z); const _Tp __n = std::norm(__z);
_M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n; _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n;
_M_real = __r / __n; _M_real = __r / __n;
return *this; return *this;
...@@ -411,18 +411,18 @@ namespace std ...@@ -411,18 +411,18 @@ namespace std
{ {
_Tp __x = __z.real(); _Tp __x = __z.real();
_Tp __y = __z.imag(); _Tp __y = __z.imag();
const _Tp __s = std::max(abs(__x), abs(__y)); const _Tp __s = std::max(std::abs(__x), std::abs(__y));
if (__s == _Tp()) // well ... if (__s == _Tp()) // well ...
return __s; return __s;
__x /= __s; __x /= __s;
__y /= __s; __y /= __s;
return __s * sqrt(__x * __x + __y * __y); return __s * std::sqrt(__x * __x + __y * __y);
} }
template<typename _Tp> template<typename _Tp>
inline _Tp inline _Tp
arg(const complex<_Tp>& __z) arg(const complex<_Tp>& __z)
{ return atan2(__z.imag(), __z.real()); } { return std::atan2(__z.imag(), __z.real()); }
// 26.2.7/5: norm(__z) returns the squared magintude of __z. // 26.2.7/5: norm(__z) returns the squared magintude of __z.
// As defined, norm() is -not- a norm is the common mathematical // As defined, norm() is -not- a norm is the common mathematical
...@@ -447,7 +447,7 @@ namespace std ...@@ -447,7 +447,7 @@ namespace std
template<typename _Tp> template<typename _Tp>
static inline _Tp _S_do_it(const complex<_Tp>& __z) static inline _Tp _S_do_it(const complex<_Tp>& __z)
{ {
_Tp __res = abs(__z); _Tp __res = std::abs(__z);
return __res * __res; return __res * __res;
} }
}; };
...@@ -462,7 +462,7 @@ namespace std ...@@ -462,7 +462,7 @@ namespace std
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
polar(const _Tp& __rho, const _Tp& __theta) polar(const _Tp& __rho, const _Tp& __theta)
{ return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } { return complex<_Tp>(__rho * std::cos(__theta), __rho * std::sin(__theta)); }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
...@@ -476,7 +476,7 @@ namespace std ...@@ -476,7 +476,7 @@ namespace std
{ {
const _Tp __x = __z.real(); const _Tp __x = __z.real();
const _Tp __y = __z.imag(); const _Tp __y = __z.imag();
return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y)); return complex<_Tp>(std::cos(__x) * std::cosh(__y), -std::sin(__x) * std::sinh(__y));
} }
template<typename _Tp> template<typename _Tp>
...@@ -485,23 +485,23 @@ namespace std ...@@ -485,23 +485,23 @@ namespace std
{ {
const _Tp __x = __z.real(); const _Tp __x = __z.real();
const _Tp __y = __z.imag(); const _Tp __y = __z.imag();
return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y)); return complex<_Tp>(std::cosh(__x) * std::cos(__y), std::sinh(__x) * std::sin(__y));
} }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
exp(const complex<_Tp>& __z) exp(const complex<_Tp>& __z)
{ return polar(exp(__z.real()), __z.imag()); } { return std::polar(std::exp(__z.real()), __z.imag()); }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
log(const complex<_Tp>& __z) log(const complex<_Tp>& __z)
{ return complex<_Tp>(log(abs(__z)), arg(__z)); } { return complex<_Tp>(std::log(std::abs(__z)), std::arg(__z)); }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
log10(const complex<_Tp>& __z) log10(const complex<_Tp>& __z)
{ return log(__z) / log(_Tp(10.0)); } { return std::log(__z) / std::log(_Tp(10.0)); }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
...@@ -509,7 +509,7 @@ namespace std ...@@ -509,7 +509,7 @@ namespace std
{ {
const _Tp __x = __z.real(); const _Tp __x = __z.real();
const _Tp __y = __z.imag(); const _Tp __y = __z.imag();
return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y)); return complex<_Tp>(std::sin(__x) * std::cosh(__y), std::cos(__x) * std::sinh(__y));
} }
template<typename _Tp> template<typename _Tp>
...@@ -518,7 +518,7 @@ namespace std ...@@ -518,7 +518,7 @@ namespace std
{ {
const _Tp __x = __z.real(); const _Tp __x = __z.real();
const _Tp __y = __z.imag(); const _Tp __y = __z.imag();
return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y)); return complex<_Tp>(std::sinh(__x) * std::cos(__y), std::cosh(__x) * std::sin(__y));
} }
template<typename _Tp> template<typename _Tp>
...@@ -530,16 +530,16 @@ namespace std ...@@ -530,16 +530,16 @@ namespace std
if (__x == _Tp()) if (__x == _Tp())
{ {
_Tp __t = sqrt(abs(__y) / 2); _Tp __t = std::sqrt(std::abs(__y) / 2);
return complex<_Tp>(__t, __y < _Tp() ? -__t : __t); return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
} }
else else
{ {
_Tp __t = sqrt(2 * (abs(__z) + abs(__x))); _Tp __t = std::sqrt(2 * (std::abs(__z) + std::abs(__x)));
_Tp __u = __t / 2; _Tp __u = __t / 2;
return __x > _Tp() return __x > _Tp()
? complex<_Tp>(__u, __y / __t) ? complex<_Tp>(__u, __y / __t)
: complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u); : complex<_Tp>(std::abs(__y) / __t, __y < _Tp() ? -__u : __u);
} }
} }
...@@ -547,21 +547,21 @@ namespace std ...@@ -547,21 +547,21 @@ namespace std
inline complex<_Tp> inline complex<_Tp>
tan(const complex<_Tp>& __z) tan(const complex<_Tp>& __z)
{ {
return sin(__z) / cos(__z); return std::sin(__z) / std::cos(__z);
} }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
tanh(const complex<_Tp>& __z) tanh(const complex<_Tp>& __z)
{ {
return sinh(__z) / cosh(__z); return std::sinh(__z) / std::cosh(__z);
} }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
pow(const complex<_Tp>& __z, int __n) pow(const complex<_Tp>& __z, int __n)
{ {
return __pow_helper(__z, __n); return std::__pow_helper(__z, __n);
} }
template<typename _Tp> template<typename _Tp>
...@@ -569,17 +569,17 @@ namespace std ...@@ -569,17 +569,17 @@ namespace std
pow(const complex<_Tp>& __x, const _Tp& __y) pow(const complex<_Tp>& __x, const _Tp& __y)
{ {
if (__x.imag() == _Tp()) if (__x.imag() == _Tp())
return pow(__x.real(), __y); return std::pow(__x.real(), __y);
complex<_Tp> __t = log(__x); complex<_Tp> __t = std::log(__x);
return polar(exp(__y * __t.real()), __y * __t.imag()); return std::polar(std::exp(__y * __t.real()), __y * __t.imag());
} }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
pow(const complex<_Tp>& __x, const complex<_Tp>& __y) pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ {
return __x == _Tp() ? _Tp() : exp(__y * log(__x)); return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x));
} }
template<typename _Tp> template<typename _Tp>
...@@ -588,7 +588,7 @@ namespace std ...@@ -588,7 +588,7 @@ namespace std
{ {
return __x == _Tp() return __x == _Tp()
? _Tp() ? _Tp()
: polar(pow(__x, __y.real()), __y.imag() * log(__x)); : std::polar(std::pow(__x, __y.real()), __y.imag() * std::log(__x));
} }
// 26.2.3 complex specializations // 26.2.3 complex specializations
......
...@@ -103,7 +103,7 @@ namespace std ...@@ -103,7 +103,7 @@ namespace std
template<typename _Tp> template<typename _Tp>
inline pair<_Tp*,ptrdiff_t> inline pair<_Tp*,ptrdiff_t>
get_temporary_buffer(ptrdiff_t __len) get_temporary_buffer(ptrdiff_t __len)
{ return __get_temporary_buffer(__len, (_Tp*) 0); } { return std::__get_temporary_buffer(__len, (_Tp*) 0); }
/** /**
* @brief The companion to get_temporary_buffer(). * @brief The companion to get_temporary_buffer().
......
...@@ -248,32 +248,32 @@ namespace std ...@@ -248,32 +248,32 @@ namespace std
inline inline
valarray<_Tp>::valarray(size_t __n) valarray<_Tp>::valarray(size_t __n)
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
{ __valarray_default_construct(_M_data, _M_data + __n); } { std::__valarray_default_construct(_M_data, _M_data + __n); }
template<typename _Tp> template<typename _Tp>
inline inline
valarray<_Tp>::valarray(const _Tp& __t, size_t __n) valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
{ __valarray_fill_construct(_M_data, _M_data + __n, __t); } { std::__valarray_fill_construct(_M_data, _M_data + __n, __t); }
template<typename _Tp> template<typename _Tp>
inline inline
valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n) valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n)) : _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
{ __valarray_copy_construct(__p, __p + __n, _M_data); } { std::__valarray_copy_construct(__p, __p + __n, _M_data); }
template<typename _Tp> template<typename _Tp>
inline inline
valarray<_Tp>::valarray(const valarray<_Tp>& __v) valarray<_Tp>::valarray(const valarray<_Tp>& __v)
: _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size)) : _M_size(__v._M_size), _M_data(__valarray_get_storage<_Tp>(__v._M_size))
{ __valarray_copy_construct(__v._M_data, __v._M_data + _M_size, _M_data); } { std::__valarray_copy_construct(__v._M_data, __v._M_data + _M_size, _M_data); }
template<typename _Tp> template<typename _Tp>
inline inline
valarray<_Tp>::valarray(const slice_array<_Tp>& __sa) valarray<_Tp>::valarray(const slice_array<_Tp>& __sa)
: _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz)) : _M_size(__sa._M_sz), _M_data(__valarray_get_storage<_Tp>(__sa._M_sz))
{ {
__valarray_copy std::__valarray_copy
(__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data)); (__sa._M_array, __sa._M_sz, __sa._M_stride, _Array<_Tp>(_M_data));
} }
...@@ -283,7 +283,7 @@ namespace std ...@@ -283,7 +283,7 @@ namespace std
: _M_size(__ga._M_index.size()), : _M_size(__ga._M_index.size()),
_M_data(__valarray_get_storage<_Tp>(_M_size)) _M_data(__valarray_get_storage<_Tp>(_M_size))
{ {
__valarray_copy std::__valarray_copy
(__ga._M_array, _Array<size_t>(__ga._M_index), (__ga._M_array, _Array<size_t>(__ga._M_index),
_Array<_Tp>(_M_data), _M_size); _Array<_Tp>(_M_data), _M_size);
} }
...@@ -293,7 +293,7 @@ namespace std ...@@ -293,7 +293,7 @@ namespace std
valarray<_Tp>::valarray(const mask_array<_Tp>& __ma) valarray<_Tp>::valarray(const mask_array<_Tp>& __ma)
: _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz)) : _M_size(__ma._M_sz), _M_data(__valarray_get_storage<_Tp>(__ma._M_sz))
{ {
__valarray_copy std::__valarray_copy
(__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size); (__ma._M_array, __ma._M_mask, _Array<_Tp>(_M_data), _M_size);
} }
...@@ -302,7 +302,7 @@ namespace std ...@@ -302,7 +302,7 @@ namespace std
valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia) valarray<_Tp>::valarray(const indirect_array<_Tp>& __ia)
: _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz)) : _M_size(__ia._M_sz), _M_data(__valarray_get_storage<_Tp>(__ia._M_sz))
{ {
__valarray_copy std::__valarray_copy
(__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size); (__ia._M_array, __ia._M_index, _Array<_Tp>(_M_data), _M_size);
} }
...@@ -310,21 +310,21 @@ namespace std ...@@ -310,21 +310,21 @@ namespace std
inline inline
valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e) valarray<_Tp>::valarray(const _Expr<_Dom, _Tp>& __e)
: _M_size(__e.size()), _M_data(__valarray_get_storage<_Tp>(_M_size)) : _M_size(__e.size()), _M_data(__valarray_get_storage<_Tp>(_M_size))
{ __valarray_copy(__e, _M_size, _Array<_Tp>(_M_data)); } { std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data)); }
template<typename _Tp> template<typename _Tp>
inline inline
valarray<_Tp>::~valarray() valarray<_Tp>::~valarray()
{ {
__valarray_destroy_elements(_M_data, _M_data + _M_size); std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
__valarray_release_memory(_M_data); std::__valarray_release_memory(_M_data);
} }
template<typename _Tp> template<typename _Tp>
inline valarray<_Tp>& inline valarray<_Tp>&
valarray<_Tp>::operator=(const valarray<_Tp>& __v) valarray<_Tp>::operator=(const valarray<_Tp>& __v)
{ {
__valarray_copy(__v._M_data, _M_size, _M_data); std::__valarray_copy(__v._M_data, _M_size, _M_data);
return *this; return *this;
} }
...@@ -332,7 +332,7 @@ namespace std ...@@ -332,7 +332,7 @@ namespace std
inline valarray<_Tp>& inline valarray<_Tp>&
valarray<_Tp>::operator=(const _Tp& __t) valarray<_Tp>::operator=(const _Tp& __t)
{ {
__valarray_fill(_M_data, _M_size, __t); std::__valarray_fill(_M_data, _M_size, __t);
return *this; return *this;
} }
...@@ -340,8 +340,8 @@ namespace std ...@@ -340,8 +340,8 @@ namespace std
inline valarray<_Tp>& inline valarray<_Tp>&
valarray<_Tp>::operator=(const slice_array<_Tp>& __sa) valarray<_Tp>::operator=(const slice_array<_Tp>& __sa)
{ {
__valarray_copy(__sa._M_array, __sa._M_sz, std::__valarray_copy(__sa._M_array, __sa._M_sz,
__sa._M_stride, _Array<_Tp>(_M_data)); __sa._M_stride, _Array<_Tp>(_M_data));
return *this; return *this;
} }
...@@ -349,8 +349,8 @@ namespace std ...@@ -349,8 +349,8 @@ namespace std
inline valarray<_Tp>& inline valarray<_Tp>&
valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga) valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga)
{ {
__valarray_copy(__ga._M_array, _Array<size_t>(__ga._M_index), std::__valarray_copy(__ga._M_array, _Array<size_t>(__ga._M_index),
_Array<_Tp>(_M_data), _M_size); _Array<_Tp>(_M_data), _M_size);
return *this; return *this;
} }
...@@ -358,8 +358,8 @@ namespace std ...@@ -358,8 +358,8 @@ namespace std
inline valarray<_Tp>& inline valarray<_Tp>&
valarray<_Tp>::operator=(const mask_array<_Tp>& __ma) valarray<_Tp>::operator=(const mask_array<_Tp>& __ma)
{ {
__valarray_copy(__ma._M_array, __ma._M_mask, std::__valarray_copy(__ma._M_array, __ma._M_mask,
_Array<_Tp>(_M_data), _M_size); _Array<_Tp>(_M_data), _M_size);
return *this; return *this;
} }
...@@ -367,8 +367,8 @@ namespace std ...@@ -367,8 +367,8 @@ namespace std
inline valarray<_Tp>& inline valarray<_Tp>&
valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia) valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia)
{ {
__valarray_copy(__ia._M_array, __ia._M_index, std::__valarray_copy(__ia._M_array, __ia._M_index,
_Array<_Tp>(_M_data), _M_size); _Array<_Tp>(_M_data), _M_size);
return *this; return *this;
} }
...@@ -376,8 +376,8 @@ namespace std ...@@ -376,8 +376,8 @@ namespace std
inline valarray<_Tp>& inline valarray<_Tp>&
valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e) valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
{ {
__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data)); std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data));
return *this; return *this;
} }
template<typename _Tp> template<typename _Tp>
...@@ -460,7 +460,7 @@ namespace std ...@@ -460,7 +460,7 @@ namespace std
inline _Tp inline _Tp
valarray<_Tp>::sum() const valarray<_Tp>::sum() const
{ {
return __valarray_sum(_M_data, _M_data + _M_size); return std::__valarray_sum(_M_data, _M_data + _M_size);
} }
// template<typename _Tp> // template<typename _Tp>
...@@ -477,21 +477,21 @@ namespace std ...@@ -477,21 +477,21 @@ namespace std
_Tp* const __a = static_cast<_Tp*> _Tp* const __a = static_cast<_Tp*>
(__builtin_alloca(sizeof(_Tp) * _M_size)); (__builtin_alloca(sizeof(_Tp) * _M_size));
if (__n == 0) // no shift if (__n == 0) // no shift
__valarray_copy_construct(_M_data, _M_data + _M_size, __a); std::__valarray_copy_construct(_M_data, _M_data + _M_size, __a);
else if (__n > 0) // __n > 0: shift left else if (__n > 0) // __n > 0: shift left
{ {
if (size_t(__n) > _M_size) if (size_t(__n) > _M_size)
__valarray_default_construct(__a, __a + __n); std::__valarray_default_construct(__a, __a + __n);
else else
{ {
__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); std::__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a);
__valarray_default_construct(__a+_M_size-__n, __a + _M_size); std::__valarray_default_construct(__a+_M_size-__n, __a + _M_size);
} }
} }
else // __n < 0: shift right else // __n < 0: shift right
{ {
__valarray_copy_construct (_M_data, _M_data+_M_size+__n, __a-__n); std::__valarray_copy_construct (_M_data, _M_data+_M_size+__n, __a-__n);
__valarray_default_construct(__a, __a - __n); std::__valarray_default_construct(__a, __a - __n);
} }
return valarray<_Tp> (__a, _M_size); return valarray<_Tp> (__a, _M_size);
} }
...@@ -503,17 +503,17 @@ namespace std ...@@ -503,17 +503,17 @@ namespace std
_Tp* const __a = static_cast<_Tp*> _Tp* const __a = static_cast<_Tp*>
(__builtin_alloca (sizeof(_Tp) * _M_size)); (__builtin_alloca (sizeof(_Tp) * _M_size));
if (__n == 0) // no cshift if (__n == 0) // no cshift
__valarray_copy_construct(_M_data, _M_data + _M_size, __a); std::__valarray_copy_construct(_M_data, _M_data + _M_size, __a);
else if (__n > 0) // cshift left else if (__n > 0) // cshift left
{ {
__valarray_copy_construct(_M_data, _M_data+__n, __a+_M_size-__n); std::__valarray_copy_construct(_M_data, _M_data+__n, __a+_M_size-__n);
__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a); std::__valarray_copy_construct(_M_data+__n, _M_data + _M_size, __a);
} }
else // cshift right else // cshift right
{ {
__valarray_copy_construct std::__valarray_copy_construct
(_M_data + _M_size+__n, _M_data + _M_size, __a); (_M_data + _M_size+__n, _M_data + _M_size, __a);
__valarray_copy_construct std::__valarray_copy_construct
(_M_data, _M_data + _M_size+__n, __a - __n); (_M_data, _M_data + _M_size+__n, __a - __n);
} }
return valarray<_Tp>(__a, _M_size); return valarray<_Tp>(__a, _M_size);
...@@ -526,28 +526,28 @@ namespace std ...@@ -526,28 +526,28 @@ namespace std
// This complication is so to make valarray<valarray<T> > work // This complication is so to make valarray<valarray<T> > work
// even though it is not required by the standard. Nobody should // even though it is not required by the standard. Nobody should
// be saying valarray<valarray<T> > anyway. See the specs. // be saying valarray<valarray<T> > anyway. See the specs.
__valarray_destroy_elements(_M_data, _M_data + _M_size); std::__valarray_destroy_elements(_M_data, _M_data + _M_size);
if (_M_size != __n) if (_M_size != __n)
{ {
__valarray_release_memory(_M_data); std::__valarray_release_memory(_M_data);
_M_size = __n; _M_size = __n;
_M_data = __valarray_get_storage<_Tp>(__n); _M_data = __valarray_get_storage<_Tp>(__n);
} }
__valarray_fill_construct(_M_data, _M_data + __n, __c); std::__valarray_fill_construct(_M_data, _M_data + __n, __c);
} }
template<typename _Tp> template<typename _Tp>
inline _Tp inline _Tp
valarray<_Tp>::min() const valarray<_Tp>::min() const
{ {
return *min_element (_M_data, _M_data+_M_size); return *std::min_element (_M_data, _M_data+_M_size);
} }
template<typename _Tp> template<typename _Tp>
inline _Tp inline _Tp
valarray<_Tp>::max() const valarray<_Tp>::max() const
{ {
return *max_element (_M_data, _M_data+_M_size); return *std::max_element (_M_data, _M_data+_M_size);
} }
template<class _Tp> template<class _Tp>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment