libstdc++/10064: crash when using valarray's operator=

Gabriel Dos Reis gdr@integrable-solutions.net
Fri Mar 14 15:36:00 GMT 2003


Brian.R.Landy@mortgage.wellsFargo.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.

Thanks,

-- Gaby



More information about the Libstdc++ mailing list