Skip to content

Sentinel values should have constexpr names. #282

Description

@rpatters1

Right now it seems like sentinel values, in particular -1, are hard-coded. It would be nice to have one or more constants defined that eliminated the need for that hard coding, e.g.,

constexpr int INDEX_UNSPECIFIED = -1;

If we wanted to, there could be a constant defined per use case.

EDIT: alternatively we could move towards std::optional, which is the C++ way but has its drawbacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions