tcanens added a comment.

Hmm, for `vector` and `deque`, we define a temporary variable, check that sizes 
match and then use range-and-a-half `equal`:

  const typename vector<_Tp1, _Allocator1>::size_type __sz = __x.size();
  return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), 
__y.begin());

For `list` we check that sizes match and then use range-and-a-half `equal`, but 
don't use a temporary variable:

  return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), 
__y.begin());

For `array` we check that sizes match and then use dual-range `equal`:

  if (_Size1 != _Size2)
      return false;
  return _VSTD::equal(__x.begin(), __x.end(), __y.begin(), __y.end());

Is there a subtle reason for this inconsistency that I'm not seeing?


https://reviews.llvm.org/D43773



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to