This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: slice valarrays with std::string -> segfault


Jhair Tocancipa Triana <jhair_tocancipa@gmx.net> writes:

[...]

| I am not sure why *__b is a 0x0-string, and who should be responsible
| to initialize it correctly (__b is initialized in the C++ library). It
| is mandated by the standard that only POD types are allowed in a
| valarray?

The reason is because a careless thinking has led the implementor of
valarray to use _copy instead of _copy_construct.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]