Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENABLE_OPERATORS_ON has incorrect definitions of post-increment and post-decrement operators. In particularly the returned value is the variable already incremented/decremented, while instead they should return the variable _before_ inc/dec. This has no real effect because are only used in loops and where the returned value is never used, neverthless it is wrong. The fix would be to copy the variable to a dummy, then inc/dec the variable, then return the dummy. So instead, rename to pre-increment that can be implemented without the dummy, actually the current implementation it is already the correct pre-increment, with the only change to return a reference (an l-value) and not a copy, so to properly mimic the pre-increment on native integers. Spotted by Kojirion. No functional change.
- Loading branch information
Showing
4 changed files
with
49 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters