C ++中[in]等于运算符的求值顺序?

时间:2019-05-28 20:05:35

标签: c++ operator-precedence

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; } 中  -在左侧之前评估左侧?

1 个答案:

答案 0 :(得分:4)

未指定顺序like most binary operators in C++。编译器首先评估++nextlast是完全合法的,因此,如果nextlast是对同一基础变量的引用,则您将输入未定义的行为范围(在这种情况下,没有问题)。