slice valarrays with std::string -> segfault

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Dec 10 22:09:00 GMT 2005


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



More information about the Gcc mailing list