Skip to content

docs: frequent items: the item move or copy constructor must not throw - #606

Closed
stojkomilos wants to merge 1 commit into
apache:masterfrom
stojkomilos:stojkomilos/fi-purge-copy-only-key
Closed

stojkomilos wants to merge 1 commit into
apache:masterfrom
stojkomilos:stojkomilos/fi-purge-copy-only-key

Conversation

@stojkomilos

Copy link
Copy Markdown
Contributor

What the docs now say

  • frequent_items_sketch says the map copies or moves items when an item is added, when it grows, and when it purges.
  • So the move constructor of T must not throw, and neither must the copy constructor, which takes the move's place if T has no move constructor.
  • If one throws, do not use the sketch, and destroying it may be undefined behavior.

Why

Not changed

  • No code change.

Checks

  • Docs only. Built fi_test with ASan and UBSan (Debug): no warnings, 170 assertions in 29 test cases pass.
  • Doxygen was not run (not installed on the build host).

This pull request and its description were written by Isaac.

The map copies or moves items on add, growth and purge. If a constructor
throws, the sketch is inconsistent and must not be used.

Co-authored-by: Isaac <no-reply@databricks.com>
@stojkomilos stojkomilos closed this Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant