Skip to content

Normalize the empty-state semantics of buffer #12

Description

@vshalygin

This issue was identified during a Codex code review.

Empty buffers currently have inconsistent observable states:

  • buffer{} has size zero, a null data pointer, and converts to false;
  • buffer{0} has size zero but normally receives a non-null allocation and converts to true;
  • copying a default empty buffer can change its boolean state from false to true.

Define whether operator bool() means “contains data” or “owns an allocation”, and make construction and copying preserve that meaning. Add tests for every empty-buffer construction path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions