[Interest] QMap and thread-safe.

Thiago Macieira thiago.macieira at intel.com
Wed Jul 24 17:10:00 CEST 2013


On quarta-feira, 24 de julho de 2013 12:59:31, Mandeep Sandhu wrote:
> > http://channel9.msdn.com/posts/C-and-Beyond-2012-Herb-Sutter-You-dont-know
> > -blank-and-blank
> Thanks for sharing this link. It was very informative. (BTW, this applies
> only to C++11)

It does not apply to anything.

This is an idea by Herb Sutter and, to be honest, I agree with him that const 
*should* mean that.

But it doesn't. The language does not enforce anything. There's no way to 
guarantee that the user code in a const function is actually thread-safe. It's 
very easy to break out of the safety:

	const_cast
	mutable

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130724/37cb7067/attachment.sig>


More information about the Interest mailing list