When a variable appears in a compound expression (for instance ``a{plus}{plus}`` or `a+=2`), the variable is accessed twice. This detail only matters for `volatile` variables. And it may not be obvious to all developers that two accesses happen while the variable is only named once. The standard was not explicit on this topic up until {cpp}23.
In C++, it usually does not matter how many times you access a variable, as long as the variable value is the right one. This is not the case when the variable is in a memory region that is mapped to external hardware. In that case, for instance, several successive reads can yield different values (if the memory is updated by the hardware in-between) and several writes of the same value may be significant (some hardware trigger events each time a memory location is written to).
To specify that every read and write has an impact outside of the abstract machine of the language, access to a variable may be qualified as `volatile`. In that case, the program must perform all reads and writes that are specified, without optimizing anything away.
Note: In {cpp}20, compound expressions on volatile variables were deprecated. This deprecation was removed in {cpp}23, and the number of accesses was made explicit. The reason for removing the deprecation is that such operations are commonly used in embedded code, especially to access specific bits of a variable. However, using a function with a dedicated name instead of direct bit manipulation usually leads to code that is easier to read.