On Fri, 26 Sep 2008, Tim Kroeger wrote:

> Parallel::max() (and other parallel functions) assume, when a vector
> is supplied, that std::vector stores all its elements consecutively.
> Does the STL guarantee that this is true,

>From what I've read, as of 2003, it's guaranteed in the standard to be
true, but even before that nobody had ever heard of a compiler doing
it differently.

> (I'm asking because I need to do some things like this an a context
> without libMesh, and I have dealt a lot with converting a std::vector
> to a C array in earlier times because I was unable to find a piece of
> information that guarantees that I can safely to what you are doing.)

The only big catch that you need to worry about with that conversion
is vector resizing - when the STL says that an operation might
invalidate an iterator, that basically translates as "might make us
move the whole underlying array somewhere else in memory".
---
Roy

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to