You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: