On Wednesday 11 February 2015 01:59:40 Olivier Goffart wrote: > Unless it is a buffer of std::atomic, it is an undefined behavior, so not > only the contents of the buffer is unpredictable, but anything, really. > > (A sufficiently smart conforming compiler could see that you are writing at > the same location without proper synchronization and conclude that you are > not using threads and optimize away all the other locks) > > (This is getting a bit out of topic)
Unless there are out-of-thin-air values, I don't see how a UB could kick in and I don't think atomics are necessary. See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4323.html - "Out-of-Thin-Air Execution is Vacuous" -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development