STL containers and boost interprocess allocators

Hi, I had sent this mail earlier, but that seems to have... disappeared. Am sending it again - hopefully there won't be duplicates. My Question: Is it possible to use boost interprocess' shared memory allocator with the normal STL containers that come with standard C++ build environments (gcc on Linux and Solaris, Visual C++ on Windows, etc.)? I know that there might be an issue with some STL containers not properly supporting encapsulated pointers in allocators that handle offset differences in memory addresses. Is this the reason why interprocess has its own containers? I apologize if this is a fairly basic question. But I think I may have hit a search blind-spot, and need some help getting out. Thanks in advance! Regards, Vishnu. ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091

Hi, Vishnu M Menon wrote:
... My Question: Is it possible to use boost interprocess' shared memory allocator with the normal STL containers that come with standard C++ build environments (gcc on Linux and Solaris, Visual C++ on Windows, etc.)? I know that there might be an issue with some STL containers not properly supporting encapsulated pointers in allocators that handle offset differences in memory addresses. Is this the reason why interprocess has its own containers?
You are right. I don't know any STL implementation fully compatible with Boost.Interprocess allocators, but I haven't tested recent gcc (4.0 or newer) or Msvc 8.0 STL containers. And this is the main reason to offer specialized containers. Last time I checked STLport and the Rogue Wave STL (stdcxx) weren't compatible. Regards, Ion

Ion, Thanks for the reply!
Last time I checked STLport and the Rogue Wave STL (stdcxx) weren't compatible.
Do you know of any STL-like implementation (independent of boost) that allows encapsulated pointer types in allocators? Regards, Vishnu ____________________________________________________________________________________ No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail

Seems like the Lakos allocator model (http://www.open-std.org/jtc1/ sc22/wg21/docs/papers/2005/n1850.pdf) would answer your question in the affirmative? -- Hervé Brönnimann hervebronnimann@mac.com On Mar 9, 2007, at 11:34 AM, Vishnu M Menon wrote:
Ion,
Thanks for the reply!
Last time I checked STLport and the Rogue Wave STL (stdcxx) weren't compatible.
Do you know of any STL-like implementation (independent of boost) that allows encapsulated pointer types in allocators?
Regards, Vishnu
______________________________________________________________________ ______________ No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. http://mobile.yahoo.com/mail _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/ listinfo.cgi/boost

Hervé Brönnimann wrote:
Seems like the Lakos allocator model (http://www.open-std.org/jtc1/ sc22/wg21/docs/papers/2005/n1850.pdf) would answer your question in the affirmative? -- Hervé Brönnimann hervebronnimann@mac.com
The Lakos allocator model does not stress the need of specifying "allocator::pointer" for smart pointers. Although I personally don't fully support the Lakos model, it tries to solve some well-known problems with STL allocators. Regards, Ion
participants (3)
-
Hervé Brönnimann
-
Ion Gaztañaga
-
Vishnu M Menon