Skip to content

Do something about @assert #51729

@LilithHafner

Description

@LilithHafner

@assert seems like a pretty useless macro right now.

Here are some plausible uses for @assert

  1. Input validation in a public-facing function
  2. Check invariants in the middle of an algorithm to give errors if the programmer made a mistake
    a. When small constant factors do matter
    b. When small constant factors do not matter
  3. Give the compiler a hint that a statement is true to improve performance.

Right now @assert is only useful in 2.b.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions