From baa75b9984d33ea49ffb76a73507b64d879166cc Mon Sep 17 00:00:00 2001 From: theraven Date: Tue, 13 Mar 2012 14:09:15 +0000 Subject: Import new version of libc++ into vendor branch. Approved by: dim (mentor) --- include/valarray | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'include/valarray') diff --git a/include/valarray b/include/valarray index 5d3154c..3c0422a 100644 --- a/include/valarray +++ b/include/valarray @@ -346,6 +346,8 @@ template unspecified2 end(const valarray& v); #include #include +#include <__undef_min_max> + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -493,14 +495,14 @@ struct __bit_shift_right : binary_function<_Tp, _Tp, _Tp> {return __x >> __y;} }; -template +template struct __apply_expr : unary_function<_Tp, _Tp> { private: - _F __f_; + _Fp __f_; public: _LIBCPP_INLINE_VISIBILITY - explicit __apply_expr(_F __f) : __f_(__f) {} + explicit __apply_expr(_Fp __f) : __f_(__f) {} _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const @@ -688,7 +690,7 @@ private: ptrdiff_t __ul_; ptrdiff_t __sn_; ptrdiff_t __n_; - static const ptrdiff_t _N = static_cast( + static const ptrdiff_t _Np = static_cast( sizeof(ptrdiff_t) * __CHAR_BIT__ - 1); _LIBCPP_INLINE_VISIBILITY @@ -697,8 +699,8 @@ private: __size_(__e.size()), __n_(__n) { - ptrdiff_t __neg_n = static_cast(__n_ >> _N); - __sn_ = __neg_n | static_cast(static_cast(-__n_) >> _N); + ptrdiff_t __neg_n = static_cast(__n_ >> _Np); + __sn_ = __neg_n | static_cast(static_cast(-__n_) >> _Np); __ul_ = ((__size_ - __n_) & ~__neg_n) | ((__n_ + 1) & __neg_n); } public: @@ -706,8 +708,8 @@ public: _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __j) const { - ptrdiff_t __i = static_cast(__j); - ptrdiff_t __m = (__sn_ * __i - __ul_) >> _N; + ptrdiff_t __i = static_cast(__j); + ptrdiff_t __m = (__sn_ * __i - __ul_) >> _Np; return (__expr_[(__i + __n_) & __m] & __m) | (value_type() & ~__m); } @@ -957,7 +959,7 @@ public: void swap(valarray& __v); _LIBCPP_INLINE_VISIBILITY - size_t size() const {return __end_ - __begin_;} + size_t size() const {return static_cast(__end_ - __begin_);} value_type sum() const; value_type min() const; @@ -1895,7 +1897,7 @@ private: _LIBCPP_INLINE_VISIBILITY mask_array(const valarray& __vb, const valarray& __v) : __vp_(const_cast(__v.__begin_)), - __1d_(count(__vb.__begin_, __vb.__end_, true)) + __1d_(static_cast(count(__vb.__begin_, __vb.__end_, true))) { size_t __j = 0; for (size_t __i = 0; __i < __vb.size(); ++__i) @@ -2106,7 +2108,7 @@ private: _LIBCPP_INLINE_VISIBILITY __mask_expr(const valarray& __vb, const _RmExpr& __e) : __expr_(__e), - __1d_(count(__vb.__begin_, __vb.__end_, true)) + __1d_(static_cast(count(__vb.__begin_, __vb.__end_, true))) { size_t __j = 0; for (size_t __i = 0; __i < __vb.size(); ++__i) -- cgit v1.1