在(嵌套的)赋值操作中,首先评估左值或右值

考虑以下创建指针链的示例:

intptr_t* p = new intptr_t(0);
for (size_t i = 0; i < some_value; i++) {
    *p = reinterpret_cast<intptr_t>(p = new intptr_t(0));
}

The lvalue *p has to be evaluated before the rvalue for obvious reasons. Is it the case ?

评论