我在这里读了几行代码,在我看来应该有一些括号。
template<class InputIterator, class OutputIterator>
OutputIterator copy ( InputIterator first, InputIterator last, OutputIterator result )
{
while (first!=last)
*result++ = *first++; // <--- this line
return result;
}
根据此处的运算符优先级表,我认为后缀增量优先,然后是取消引用,然后是赋值。但在我看来,其意图是首先发生取消引用,然后是赋值,然后是后缀增量。
我读错了吗?还是表格错了,还是代码片段错了?或者还有别的原因吗?