C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Should postfix increment and decrement operators be automatically obtainable from their prefix versions?

From: Matthew Taylor <mjtaylor214_at_[hidden]>
Date: Wed, 24 Jan 2024 15:29:01 +0000
Hi there Tiago,

I did consider this possibility, but I'm not sure that it is so commonplace that it should define the rule. Do you have a particular example in mind?

To address the general-case concern, I'd say that the author continues to have the option to delete postfix overloads or of course define their own to behave how they please. If the concern is primarily performance from copying the class, I'd argue that if it doesn't fall into the realm of being optimized away by the compiler, then if a user calls a postfix operator they shouldn't be too surprised when they receive postfix behaviour.

In any case, thank you for your response. All feedback is appreciated.

Received on 2024-01-24 15:29:04