This is the mail archive of the
mailing list for the libstdc++ project.
Re: libstdc++/10064: crash when using valarray's operator=
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Brian dot R dot Landy at mortgage dot wellsFargo dot COM
- Cc: libstdc++ at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: 14 Mar 2003 16:33:30 +0100
- Subject: Re: libstdc++/10064: crash when using valarray's operator=
- Organization: Integrable Solutions
- References: <D592EDE69B901F4280214087B1942430052D088E@msgsn55iadsm06.wellsfargo.com>
Brian dot R dot Landy at mortgage dot wellsFargo dot COM writes:
| Sorry, I assumed it should resize since MS's STL (in VC++ 6.0) does resize.
| I take it this is particular to valarray?
Yes, the behaviour I was describing is particular to valarray<> -- as
opposed to vector<> which does resizing. Valarray<> should be thought
of as a low level building bloc. Automatic resizing is too high level
for the purpose of valarray.
| Because I think I remember
| checking vector (in gcc's STL) and it does. By undefined do you mean that
| the behavior is left up to the implementer, or that MS should not do the
| resize? Thanks!
By "undefined behaviour", I meant what the C++ standard means.
Anything can happen. The implementation may accept or reject it, or
the program may reformat your hard drive.