summaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-15 20:07:45 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2000-07-15 20:07:45 +0000
commit2405c4feaca18a17c8b70375d9f0afb4b3237516 (patch)
tree50d946cf2a9e88d91de787ae9377e70ba3da8a8e /libstdc++-v3/src
parentdfa5c7fae0b8e0e64ac2282ad193c105c4350e22 (diff)
downloadgcc-2405c4feaca18a17c8b70375d9f0afb4b3237516.tar.gz
2000-07-15 Gabriel Dos Reis <gdr@codesourcery.com>
* bits/valarray_array.h (__valarray_get_storage): New function. (_Array<>::Array): Use it. * bits/std_valarray.h (valarray<>::valarray): Likewise. (valarray<>::resize): Likewise. Tweak. * src/valarray-inst.cc (__valarray_product): Tweak. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35053 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/valarray-inst.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/libstdc++-v3/src/valarray-inst.cc b/libstdc++-v3/src/valarray-inst.cc
index ce0f86feeec..94d1188e523 100644
--- a/libstdc++-v3/src/valarray-inst.cc
+++ b/libstdc++-v3/src/valarray-inst.cc
@@ -22,14 +22,13 @@ namespace std
inline size_t
__valarray_product(const valarray<size_t>& __a)
{
+ typedef const size_t* __restrict__ _Tp;
+ const size_t __n = __a.size();
// XXX: This ugly cast is necessary because
// valarray::operator[]() const return a VALUE!
// Try to get the committee to correct that gross error.
- typedef const size_t* __restrict__ _Tp;
- size_t __n = __a.size() - 1;
valarray<size_t>& __t = const_cast<valarray<size_t>&>(__a);
- return __valarray_product(static_cast<_Tp>(&__t[0]),
- static_cast<_Tp>(&__t[__n]));
+ return __valarray_product(&__t[0], &__t[0] + __n);
}
void __gslice_to_index(size_t __o, const valarray<size_t>& __l,