Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider providing constants in a separate namespace #88

Open
Pharap opened this issue Mar 26, 2021 · 0 comments
Open

Consider providing constants in a separate namespace #88

Pharap opened this issue Mar 26, 2021 · 0 comments
Assignees
Labels
Minor This change is a minor addition Quality This change improves the code's quality

Comments

@Pharap
Copy link
Owner

Pharap commented Mar 26, 2021

At the moment the named constants (such as E, Pi, Tau and Phi) are static class members of SFixed and UFixed.

From a maintenance point of view, it would be beneficial to reduce the duplication by moving this functionality into a single place, e.g. a class or namespace provided by Utils.h.

These constants could then take the form of constexpr template functions rather than static constexpr data members. The functions would essentially pass a floating point value to the appropriate constructor of each type.

The old values could be deprecated and removed in some future breaking change, but for now simply adding a separate (preferred) source of constants would be a non-breaking additional improvement.

@Pharap Pharap added Minor This change is a minor addition Quality This change improves the code's quality labels Mar 26, 2021
@Pharap Pharap self-assigned this Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor This change is a minor addition Quality This change improves the code's quality
Projects
None yet
Development

No branches or pull requests

1 participant