"copy"实现示例中的运算符优先级

sje*_*397 3 c++ increment variable-assignment operator-precedence dereference

在这里阅读了几行代码,它在我看来应该有一些括号.

template<class InputIterator, class OutputIterator>
  OutputIterator copy ( InputIterator first, InputIterator last, OutputIterator result )
{
  while (first!=last) 
     *result++ = *first++; // <--- this line
  return result;
}
Run Code Online (Sandbox Code Playgroud)

根据这里的运算符优先级表,我认为后缀增量优先,然后取消引用,然后是赋值.但它在我看来,意图是首先发生取消引用,然后是赋值,然后是后缀增量.

我读错了吗?或者表格错误,还是代码段?或者还有别的东西吗?

Mar*_*k B 6

后缀增量首先执行,但后缀增量的返回值是指针的原始值.这就是它的原因.