Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: optimized code example

...

Code Block
bgColor#ccccff
langcpp
#include <algorithm>
#include <vector>

void f(const std::vector<int> &c) {
  const auto e = i + std::vector<int>::size_type maxSize = 20min( 20, c.size());
  for (auto i = c.begin(), e = i + std::min(maxSize, c.size()); i != e; ++i) {
    // ...
  }
}

...

Noncompliant Code Example (Linear Address Space)

...