考虑以下创建指针链的示例:
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 ?
考虑以下创建指针链的示例:
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 ?