Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++sequencing and evaluation orderSingle-choice MCQ

For a user-defined type, `x++` calls the overloaded `operator++(int)`. How does the sequencing of `f(x++, x++)` differ from the built-in `int` case when the type's postfix operator is a normal function?

struct Counter { int v = 0; Counter operator++(int) { Counter old = *this; ++v; return old; } }; Counter c; f(c++, c++);