Skip to content

Facilitate use of designated initializers for structs such as various Options #13293

Open
@pdillinger

Description

We have a number of P.O.D. Options structs that have unfortunate constructors with (positional) parameters that are easily used confusingly, as in ReadOptions{true, false}. Importantly, in C++20, the existence of this constructors interferes with use of the much healthier designated initializer syntax.

We should review our public APIs and deprecate these constructors, to promote better code hygiene. Along the same lines, we should avoid the pattern of describing default values in a comment, which could become out of sync with constructor code, and use default member initializers for defaults.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions