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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:58:35+00:00 2026-05-12T20:58:35+00:00

It appears in C# you can not override the post decrement operator? I was

  • 0

It appears in C# you can not override the post decrement operator?

I was “reflectoring” and ran across some code that reflector translated to decimal.op_Decrement(x) and I was trying to figure out whether it meant --x or x--.

public struct IntWrapper
{
    public static IntWrapper operator --(IntWrapper value)
    {
        return new IntWrapper(value.value - 1);
    }

    public static IntWrapper operator (IntWrapper value)--
    {
        ???
    }

    private int value;

    public IntWrapper(int value)
    {
        this.value = value;
    }
}

Does the framework just use the “pre-decrement” version for the “post-decrement” operation?

  • 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-12T20:58:36+00:00Added an answer on May 12, 2026 at 8:58 pm

    Postfix ++/-- operator is the same as it’s prefix counterpart, except the first creates a copy (if needed) of the variable before assigning.

    So, this code:

    int x = Function(y--);
    

    Is equal to this code:

    int x = Function(y);
    --y;
    

    That’s why there is no need to overload the postfix operator.

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

Sidebar

Related Questions

I have the following code: $r->find('user')->via('post')->over(authenticated => 1); Given that route I can get
It appears m2eclipse is not recognizing my $M2_OPTS variable. I can run the same
From reading the RFC it appears that CID can/must only contain characters from the
How can i make a UIPickerView that appears when i select a TextField, and
How can I change the default (blue) color that appears on a table view's
Can I pass some properties to an EntityManagerFactory by code, while still maintaining persistence.xml
From what I can gather it appears that this might be because my ListView
All my entities can not be deleted - only deactivated, so they don't appear
While we can add Inline Images in paragraphs there does not appear to be
I can't clone my repository via http: abort: ' http://MYREPO ' does not appear

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.