libstdc++/6090: Problem with copy of std_valarray

Gabriel Dos Reis gdr@codesourcery.com
Mon Apr 8 04:48:00 GMT 2002


bkoz@gcc.gnu.org writes:

| Synopsis: Problem with copy of std_valarray
| 
| State-Changed-From-To: feedback->analyzed
| State-Changed-By: bkoz
| State-Changed-When: Wed Apr  3 12:45:33 2002
| State-Changed-Why:
|     This looks like it is still an issue in gcc-3.1. 
|     
|     include/std/std_valarray.h: 342
|     
|      template<typename _Tp>
|       inline valarray<_Tp>&
|       valarray<_Tp>::operator= (const valarray<_Tp>& __v)
|       {
|           __valarray_copy(__v._M_data, _M_size, _M_data);
|           return *this;
|       }
|     
|     include/std/std_valarray.h: 284
|       template<typename _Tp>
|       inline valarray<_Tp>::valarray (const valarray<_Tp>& __v)
|         : _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); }

I'm not sure I understand what the problem is about.  Is the submitter
complaining that copying a valarray wasn't adjusting the target's size?
That is the mandated behaviour, in particular if the source and the
target don't have the same length then the behaviour is undefined.

-- Gaby



More information about the Gcc-bugs mailing list