C ++中相等运算符的求值顺序是什么?
我看到许多类似this
的代码示例 for bucket in self.resource.buckets.all():
File "/usr/local/venv/azionmanager/lib/python2.7/site-packages/boto3/resources/collection.py", line 83, in __iter__
for page in self.pages():
File "/usr/local/venv/azionmanager/lib/python2.7/site-packages/boto3/resources/collection.py", line 161, in pages
pages = [getattr(client, self._py_operation_name)(**params)]
File "/usr/local/venv/azionmanager/lib/python2.7/site-packages/botocore/client.py", line 324, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/venv/azionmanager/lib/python2.7/site-packages/botocore/client.py", line 622, in _make_api_call
raise error_class(parsed_response, operation_name)
ClientError: An error occurred (502) when calling the ListBuckets operation (reached max retries: 4): Bad Gateway
和template <class ForwardIt, class Compare>
ForwardIt is_sorted_until(ForwardIt first, ForwardIt last, Compare comp)
{
if (first != last) {
ForwardIt next = first;
while (++next != last) {
if (comp(*next, *first))
return next;
first = next;
}
}
return last;
}
中
-在左侧之前评估左侧?
答案 0 :(得分:4)
未指定顺序like most binary operators in C++。编译器首先评估++next
或last
是完全合法的,因此,如果next
和last
是对同一基础变量的引用,则您将输入未定义的行为范围(在这种情况下,没有问题)。