Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6225763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:54:09+00:00 2026-05-24T08:54:09+00:00

The new C++11 standard requires STL implementations to support stateful allocators in containers. Do

  • 0

The new C++11 standard requires STL implementations to support stateful allocators in containers. Do main STL implementations (Visual Studio 2008, 2010, libstdc++) comply to this requirement now? I found nothing about this in MSDN or in libstdc++ documentation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:54:09+00:00Added an answer on May 24, 2026 at 8:54 am

    Looks like the feature of stateful allocators in STL containers is widely supported already. In most cases statefullness of the allocator does not cause trouble. What is not widely supported yet is the new standard’s way of handling the problematic situations (swap of a container(whether to swap the allocator too), splice of lists).

    This thread says:

    in code for most current standard libraries (including Dinkumware’s as used by MS), stateful allocators are supported

    This tread (libstdc++, 2004) says (if i understood correctly):

    We already support allocators where l1.get_allocator() != l2.get_allocator(). What we don’t do is make any special provisions to detect those allocators in splice() and swap().

    This blog entry (libstdc++, 2009) says:

    Existing containers in C++0x mode are now more efficient together with stateful allocators (i.e., no allocators are created on the fly at element construction time).

    This document says about the new libc++ library:

    All containers meet all of the latest allocator requirements
    which fully support stateful allocators.
    – Space for stateless allocators optimized away.

    EASTL supports statefull allocators.

    This thread contains an interesting dispute about how portable this feature is.

    So most STL implementations support statefull allocators, which means that they do not create additional instances of the allocator type under the hood, but store the client-supplied allocator instance and all allocations/deallocations are done via that. However the way that they handle swapping and list::splice is undocumented, non-portable.

    UPDATE: VS2008’s STL requires the allocators to have the templated copy constructor, which IMO makes the most important use of custom allocators impossible: simple segregated storage.

    For whoever is not satisfied with the current state of stateful allocators in STL, I recommend to consider Boost.Intrusive and Boost.Container.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does VS2008 have somewhat C++0x standard support? DUPLICATE Visual Studio support for new C
The new C++11 standard has unordered containers. In particular, the std::unordered_map<Key, Value> stores a
I'm attempting to use the new standard way of loading seed data in Rails
I'm new to Standard ML and I'm trying to get my head around the
I am relatively new to web services and am wondering what the standard best
Here's a standard scenario: if(string.IsNullOrEmpty(Configuration.AppSettings[foobar])) throw new SomeStandardException(Application not configured correctly, bozo.); The problem
I'm fairly new to PHP and have built a medium sized website using standard
From what I understand, in standard C++ whenever you use the new operator you
Ok , I know the two standard ways to create a new thread and
I am new to Zend and am working on a project that requires three

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.