vector-of-bool / cmrc

A Resource Compiler in a Single CMake Script
MIT License
672 stars 74 forks source link

Fix pre-increment and post-increment operators on iterator #35

Closed richardhozak closed 2 years ago

richardhozak commented 2 years ago

As per https://en.cppreference.com/w/cpp/language/operator_incdec

the operator++() is pre-increment and should behave:

Pre-increment and pre-decrement operators increments or decrements the value of the object and returns a reference to the result.

the operator++(int) is post-increment and should behave:

Post-increment and post-decrement creates a copy of the object, increments or decrements the value of the object and returns the copy from before the increment or decrement.

The implementations are just switched with this.

vector-of-bool commented 2 years ago

Sorry for the delay on this. Thank you for noticing and the providing a fix!