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

Mark new functions as const #134

Closed
kgv opened this issue Jul 5, 2019 · 2 comments · Fixed by #239
Closed

Mark new functions as const #134

kgv opened this issue Jul 5, 2019 · 2 comments · Fixed by #239

Comments

@kgv
Copy link

kgv commented Jul 5, 2019

It allows:
const COLOR: Srgba = Srgba::new(1.0, 1.0, 1.0, 1.0);

@kgv kgv changed the title Mark new-like functions as const Mark new functions as const Jul 5, 2019
@Ogeon
Copy link
Owner

Ogeon commented Jul 5, 2019

Yep, that's a good idea! It should be possible for most, if not all of them. I don't think any of them use float arithmetic, which wasn't stable yet in const, last time I checked.

@Ogeon
Copy link
Owner

Ogeon commented Jul 7, 2019

Turns out this has to wait for trait bounds other than Sized to be stabilized for const functions.

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

Successfully merging a pull request may close this issue.

2 participants