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

  • SEARCH
  • Home
  • 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 6170675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:04:51+00:00 2026-05-23T23:04:51+00:00

First of all, I don’t think it is. But, I’ve observed such a behavior

  • 0

First of all, I don’t think it is. But, I’ve observed such a behavior with MSVC 10.0 in Debug mode. I’m using a custom allocator class which relies on the user to pass only pointers allocated on the same instance to deallocate. However, in Release mode, my code is working.

Is this a bug or am I mistaken?

  • 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-23T23:04:52+00:00Added an answer on May 23, 2026 at 11:04 pm

    The standard requires that any allocator be able to deallocate memory produced by any other allocator of the same type, even if it’s a totally different instance. This is required to get list::splice working correctly. It’s largely considered a design flaw in the C++ spec, and in C++0x they’re introducing a set of fixups to allocators to rememdy this. In the meantime, any allocator you use in the STL containers must not have its own local state.

    EDIT: For those of you who want the original language on this, here’s §20.1.5/4 of the C++ ISO spec:

    Implementations of containers described in this International Standard are permitted to assume that their
    Allocator template parameter meets the following two additional requirements beyond those in Table 32.

    — All instances of a given allocator type are required to be interchangeable and always compare equal to
    each other.

    In the latest ISO draft of the C++0x standard, this requirement is no longer present. The default std::allocator will still maintain this invariant as required, but it doesn’t look like you’ll have to constrain yourself this way in the future.

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

Sidebar

Related Questions

First of all, I don't think my title is good, but I couldn't think
First of all, I don't think this question is a duplicate of Detect 64bit
First of all I'm using netbeans as my IDE and I don't know if
first of all, I'm using RVM... and I don't know much about managing gem
First of all, I'm using sIFR3, r419 (I can't upgrade since I don't have
First of all let's emphasize that syntax rules don't work alone, but they need
First of all, there is already a similar question , but these answers don't
First of all, I know about the command line parameter, but I don't want
First of all, I want to apologize for such a long question. You don't
First of all, I don't want to use any framework but I am looking

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.