LWN.net Logo

A look at C++14, part 1

A look at C++14, part 1

Posted Mar 30, 2013 0:43 UTC (Sat) by Cyberax (✭ supporter ✭, #52523)
In reply to: A look at C++14, part 1 by cry_regarder
Parent article: A look at C++14, part 1

That's one thing that's long overdue. Allocators are really badly designed - containers among other things expect allocators to be stateless, so swapping two strings in different shared memory segments is impossible to do correctly, according to the Standard.


(Log in to post comments)

A look at C++14, part 1

Posted Mar 30, 2013 17:44 UTC (Sat) by jwakely (subscriber, #60262) [Link]

No, "according to the Standard" containers do not expect allocators to be stateless. The weasel words allowing them to assume allocators are equal were removed for C++11 and the new propagation traits and scoped allocator model make it well-defined what happens when two containers with non-equal allocators interact.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds