Skip to content

refactor: mark PartitionField and SortField getters [[nodiscard]]#17

Draft
smaheshwar-pltr wants to merge 2 commits into
mainfrom
cleanup/nodiscard-getters
Draft

refactor: mark PartitionField and SortField getters [[nodiscard]]#17
smaheshwar-pltr wants to merge 2 commits into
mainfrom
cleanup/nodiscard-getters

Conversation

@smaheshwar-pltr

@smaheshwar-pltr smaheshwar-pltr commented Jun 27, 2026

Copy link
Copy Markdown
Owner

What

Add [[nodiscard]] to the pure accessors and predicates on PartitionField (source_id, field_id, name, transform, ToString) and SortField (source_id, transform, direction, null_order, Satisfies, ToString).

Why

These are side-effect-free getters/predicates, so discarding their result is almost certainly a bug worth a compiler diagnostic. This mirrors the existing [[nodiscard]] annotations on the analogous SchemaField getters in schema_field.h. No in-tree call site discards these return values, so the change is clean under the project's -Werror build.

Sreesh Maheshwar and others added 2 commits June 28, 2026 00:21
These are pure accessors and predicates; discarding their result is a bug.
Mirrors the existing [[nodiscard]] annotations on the analogous SchemaField
getters in schema_field.h.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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