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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:29:45+00:00 2026-05-10T19:29:45+00:00

I know that you can use a dummy int parameter on operator++ and operator–

  • 0

I know that you can use a dummy ‘int’ parameter on operator++ and operator-- to override the postfix versions of those operators, but I vaguely recall something about a dummy parameter that you could declare on a destructor. Does anyone know anything about that, and if so, what that dummy parameter did?

This was in my old Turbo C++ tutorial books, which I read when I was a teenager (i.e. a long time ago), so I might be completely misremembering it. That was also very early C++, before it was standardized, so it’s possible that it was something Turbo C++-specific.

  • 1 1 Answer
  • 1 View
  • 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-10T19:29:45+00:00Added an answer on May 10, 2026 at 7:29 pm

    You’re possibly thinking of the placement and nothrow forms of operator delete, which have the signatures:

    void operator delete(void *, void *) throw(); void operator delete(void *, const std::nothrow_t&) throw(); void operator delete[](void *, void *) throw(); void operator delete[](void *, const std::nothrow_t&) throw(); 

    These are never called during normal operation, but would be used in the case where the constructor for an object being constructed with placement new throws an exception. Generally you don’t have to define them, since the compiler already called the destructor(s) on the dead object’s bases and members, and for placement new there’s no memory to be freed. But can exist if you are overloading placement new and need a corresponding operator.

    The second argument is not really used, and just distinguishes the signature for the ordinary:

    void operator delete(void *) 

    These aren’t special dummy arguments the way the operator++ ones are, though. They’re just an instance of the general rule that call to new with extra arguments, such as:

    obj = new(x,y,z) Object(a,b,c)  

    will generate implicit code to clean up from constructor errors that passes those same additional arguments to the operator delete, which will function (approximately) like:

    void *raw = operator new(sizeof(Object), x,y,z) try {     obj = new(raw) Object(a,b,c); } catch(...) {    operator delete(raw,x,y,z);    throw; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that some website are applications, but not all websites are applications (albeit
I know this might sound as really dummy question, but I'm trying to ensure
I recently saw some Perl code that confused me. I took out all of
I want to write a stored procedure that lists the name of all the
Hi I was interested in what assembly code will gcc generate from this code
I'm doing some test to learn how to create shared library. The template for
If I have this code: class A { ... }; class B { ...
Here's my high level problem. I want to read a number max_age_in_secs from a
My problem I want to clean HTML pasted in a rich text editor (FCK
I've disabled sessionState in my mvc2 app via the web.config and also created my

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.