)]}'
{
  "commit": "e4a5ec48f9fbcd3a28f06c7763d58c5b67d6a566",
  "tree": "2ae2ed2fefa126e539097c14f328b6b94b3272c5",
  "parents": [
    "2f0068c129b4a39e3dcbe075d50f28b8cd5d726f"
  ],
  "author": {
    "name": "Mike Blume",
    "email": "mikeblume@google.com",
    "time": "Tue Oct 20 13:32:59 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Wed Nov 25 13:34:32 2026 -0800"
  },
  "message": "Support C++20 contiguous iterators in absl::MakeSpan and MakeConstSpan.\n\nCallers frequently construct spans from container iterators by writing\n`absl::MakeSpan(\u0026*it1, \u0026*it2)` or `absl::MakeSpan(\u0026*it, len)`. Dereferencing\nan end iterator is undefined behavior—and traps under hardened/bounded\niterators (such as `libc++`\u0027s `__bounded_iter`). Rewriting those calls to drop\ndown to `c.data() + ...` is verbose and throws away iterator bounds checking.\n\nThe cleanest and safest rewrite is `absl::MakeSpan(it1, it2)` or\n`absl::MakeSpan(it, len)`. This lets callers keep any offset arithmetic\n(`it + n`, `end - k`) in iterator space, where bounded iterators check it,\ninstead of converting to raw pointers first and doing unchecked pointer\narithmetic.\n\nAs a backstop, the new overloads also validate the range themselves: the\n`(first, length)` form checks that `first + length` is in bounds, and the\n`(first, last)` form checks that `last - first` is non-negative and that\n`last` lies within `first`\u0027s bounds (catching mismatched containers).\n\nSpecifically, under `ABSL_INTERNAL_CPLUSPLUS_LANG \u003e\u003d 202002L` in\n`absl/types/span.h`:\n- Add `absl::MakeSpan` and `absl::MakeConstSpan` overloads taking a\n  `std::contiguous_iterator` with a size or a sized sentinel. Raw pointers\n  keep using the existing overloads.\n- Validate `length \u003c\u003d max(iter_difference_t)` / `last - first \u003e\u003d 0`, and\n  compute `first + \u003cspan length\u003e` so bounded iterators trap on out-of-bounds\n  ranges. The data pointer is taken with `std::to_address(first)`, which is\n  valid even for an end iterator.\n- Mark the existing pointer-pair `MakeSpan` and `MakeConstSpan` overloads\n  `constexpr`.\n\n`absl::Span` itself gains no constructors. An iterator-pair constructor makes\nexisting calls such as `f({it1, it2})` ambiguous when `f` is overloaded on\n`Span` and a container, and compilers disagree on whether marking it\n`explicit` avoids that.\n\nPiperOrigin-RevId: 1003354434\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "96cbef28c61e2e1cebc94b5dafeecf43cb651e3c",
      "old_mode": 33188,
      "old_path": "absl/types/span.h",
      "new_id": "4b9fb601b8ca379c2c7d1efd6a3398f2821f5199",
      "new_mode": 33188,
      "new_path": "absl/types/span.h"
    },
    {
      "type": "modify",
      "old_id": "c81472654c489598a1fe3d63abdcf3f0492f5e92",
      "old_mode": 33188,
      "old_path": "absl/types/span_test.cc",
      "new_id": "fdb9bd55271d57abd6299c4174609829a88fda39",
      "new_mode": 33188,
      "new_path": "absl/types/span_test.cc"
    }
  ]
}
