valarray assignment
Gabriel Dos Reis
gdr@codesourcery.com
Sun Oct 14 09:36:00 GMT 2001
Philip Charlton <charlton@ligo.caltech.edu> writes:
| what I was going to ask was, in valarray assignment it seems that no check
| for self-assignment is made, instead __valarray_copy() is called which
| immediately calls memcpy() to do the copying. Was this choice made
| for efficiency, to avoid the overhead of an "if" statement?
I've already replied to a private email from Philip. I'll make
another public answer here for future reference.
The library specification makes some form of non-aliasing and
parallelim assumptions; those includes non self-assignments.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com
More information about the Libstdc++
mailing list