LWN.net Logo

A look at C++14, part 1

A look at C++14, part 1

Posted Mar 29, 2013 23:43 UTC (Fri) by cry_regarder (subscriber, #50545)
Parent article: A look at C++14, part 1

The Polymorphic Allocators one has me excited. It is frustrating that I can't assign a string to a string defined with an allocator. This makes it somewhat unnatural working with items stored in boost::interprocess segments.

Cry


(Log in to post comments)

A look at C++14, part 1

Posted Mar 30, 2013 0:43 UTC (Sat) by Cyberax (✭ supporter ✭, #52523) [Link]

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.

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