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 184803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:21:26+00:00 2026-05-11T15:21:26+00:00

I’ve recently come across this rant . I don’t quite understand a few of

  • 0

I’ve recently come across this rant.

I don’t quite understand a few of the points mentioned in the article:

  • The author mentions the small annoyance of delete vs delete[], but seems to argue that it is actually necessary (for the compiler), without ever offering a solution. Did I miss something?
  • In the section ‘Specialized allocators’, in function f(), it seems the problems can be solved with replacing the allocations with: (omitting alignment)

    // if you're going to the trouble to implement an entire Arena for memory, // making an arena_ptr won't be much work. basically the same as an auto_ptr, // except that it knows which arena to deallocate from when destructed. arena_ptr<char> string(a); string.allocate(80); // or: arena_ptr<char> string; string.allocate(a, 80); arena_ptr<int> intp(a); intp.allocate(); // or: arena_ptr<int> intp; intp.allocate(a); arena_ptr<foo> fp(a); fp.allocate(); // or: arena_ptr<foo>; fp.allocate(a); // use templates in 'arena.allocate(...)' to determine that foo has // a constructor which needs to be called. do something similar // for destructors in '~arena_ptr()'. 
  • In ‘Dangers of overloading ::operator new[]’, the author tries to do a new(p) obj[10]. Why not this instead (far less ambiguous):

    obj *p = (obj *)special_malloc(sizeof(obj[10])); for(int i = 0; i < 10; ++i, ++p)     new(p) obj; 
  • ‘Debugging memory allocation in C++’. Can’t argue here.

The entire article seems to revolve around classes with significant constructors and destructors located in a custom memory management scheme. While that could be useful, and I can’t argue with it, it’s pretty limited in commonality.

Basically, we have placement new and per-class allocators — what problems can’t be solved with these approaches?

Also, in case I’m just thick-skulled and crazy, in your ideal C++, what would replace operator new? Invent syntax as necessary — what would be ideal, simply to help me understand these problems better.

  • 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. 2026-05-11T15:21:26+00:00Added an answer on May 11, 2026 at 3:21 pm

    Well, the ideal would probably be to not need delete of any kind. Have a garbage-collected environment, let the programmer avoid the whole problem.

    The complaints in the rant seem to come down to

    1. ‘I liked the way malloc does it’
    2. ‘I don’t like being forced to explicitly create objects of a known type’

    He’s right about the annoying fact that you have to implement both new and new[], but you’re forced into that by Stroustrups’ desire to maintain the core of C’s semantics. Since you can’t tell a pointer from an array, you have to tell the compiler yourself. You could fix that, but doing so would mean changing the semantics of the C part of the language radically; you could no longer make use of the identity

    *(a+i) == a[i] 

    which would break a very large subset of all C code.

    So, you could have a language which

    • implements a more complicated notion of an array, and eliminates the wonders of pointer arithmetic, implementing arrays with dope vectors or something similar.

    • is garbage collected, so you don’t need your own delete discipline.

    Which is to say, you could download Java. You could then extend that by changing the language so it

    • isn’t strongly typed, so type checking the void * upcast is eliminated,

    …but that means that you can write code that transforms a Foo into a Bar without the compiler seeing it. This would also enable ducktyping, if you want it.

    The thing is, once you’ve done those things, you’ve got Python or Ruby with a C-ish syntax.

    I’ve been writing C++ since Stroustrup sent out tapes of cfront 1.0; a lot of the history involved in C++ as it is now comes out of the desire to have an OO language that could fit into the C world. There were plenty of other, more satisfying, languages that came out around the same time, like Eiffel. C++ seems to have won. I suspect that it won because it could fit into the C world.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6

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.