Несколько неопозиционных модификаций после оценки аргумента - определенного или неопределенного поведения?C++

Программы на C++. Форум разработчиков
Anonymous
Несколько неопозиционных модификаций после оценки аргумента - определенного или неопределенного поведения?

Сообщение Anonymous »

The standard states that the behavior of unsequenced operations that have side effect on the same memory location is undefined [intro.execution§10].
Does the following code have undefined behavior, for having multiple unsequenced side effects on the variable sid, through the unsequenced call to bar in main:

Код: Выделить всё

int bar() {
static int sid;
return ++sid;
}

void foo(int i1, int i2) {
std::cout 

Подробнее здесь: [url]https://stackoverflow.com/questions/79673162/multiple-unsequenced-modifications-following-argument-evaluation-defined-or-un[/url]

Вернуться в «C++»