Make `riegeli::Reset(dest, args...)` an effective optimization of
`dest = T(args...)` for more types and patterns:

* `riegeli::Reset(dest, std::in_place, args...)` → `dest.emplace(args...)`
* `riegeli::Reset(dest, std::in_place_type<Type>, args...)` →
  `dest.emplace<Type>(args...)`
* `riegeli::Reset(dest, std::in_place_index<index>, args...)` →
  `dest.emplace<index>(args...)`
* `riegeli::Reset(dest)` → `dest.clear()` (`begin()` and `end()` must be
  defined because this pattern would be risky for non-containers)
* `riegeli::Reset(dest, args...)` → `dest.assign(args...)`
  (`begin()` and `end()` must be defined)

This covers in particular `std::optional`, `std::variant`, `std::any`,
`absl::InlinedVector`...

Describe some caveats when resetting may differ from assignment from a newly
constructed object.

Remove overrides of `RiegeliReset()` which became redundant.

PiperOrigin-RevId: 900610370
2 files changed
tree: 56b78dc68cca8ff0379c433e1e70c2f12f416c95
  1. doc/
  2. python/
  3. riegeli/
  4. tf_dependency/
  5. .bazelrc
  6. configure
  7. CONTRIBUTING.md
  8. LICENSE
  9. MANIFEST.in
  10. MODULE.bazel
  11. README.md
README.md

Riegeli

Riegeli/records is a file format for storing a sequence of string records, typically serialized protocol buffers. It supports dense compression, fast decoding, seeking, detection and optional skipping of data corruption, filtering of proto message fields for even faster decoding, and parallel encoding.

See documentation.

Status

Riegeli file format will only change in a backward compatible way (i.e. future readers will understand current files, but current readers might not understand files using future features).

Riegeli C++ API might change in incompatible ways.