This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: slice valarrays with std::string -> segfault
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Jhair Tocancipa Triana <jhair_tocancipa at gmx dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: 11 Dec 2005 00:02:36 +0100
- Subject: Re: slice valarrays with std::string -> segfault
- References: <87irtx8bcr.fsf@mandala.my-fqdn.de>
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