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

Constexpr math (C++23) and arithmetic operators #71

Open
AbitTheGray opened this issue Dec 15, 2024 · 0 comments
Open

Constexpr math (C++23) and arithmetic operators #71

AbitTheGray opened this issue Dec 15, 2024 · 0 comments

Comments

@AbitTheGray
Copy link
Contributor

Hi, I've read in #52 about aiming for C++11 support but did you consider supporting constexpr arithmetic operators and math in general?

I don't see any sideeffects fpm::ceil function so it should not be a problem when it is correctly version-checked.

Operators are a little trickier as you have the += implemented but marking it as constexpr won't work. That means static_assert(P{1} + P{2} == P{3}, "Arithmetics failed"); won't compile.

I expect inlining allows the compiler to process it at compile time anyone but it is not possible to use inside explicit constexpr functions.

AbitTheGray added a commit to AbitTheGray/fpm that referenced this issue Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant