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 making some Entity methods const #5687

Closed
djeedai opened this issue Aug 14, 2022 · 0 comments
Closed

Consider making some Entity methods const #5687

djeedai opened this issue Aug 14, 2022 · 0 comments
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@djeedai
Copy link
Contributor

djeedai commented Aug 14, 2022

What problem does this solve or what need does it fill?

Most methods on Entity can be made const. This allows building compile-time
constants, and more generally extend their use to a const context.

What solution would you like?

Make those methods const.

What alternative(s) have you considered?

To have compile-time constants, there's none, by Rust design.

@djeedai djeedai added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Aug 14, 2022
djeedai added a commit to djeedai/bevy that referenced this issue Aug 14, 2022
Update the methods on the `Entity` struct to be `const`, so we can
define compile-time constants and more generally use them in a const
context.

Fixes bevyengine#5687
@rparrett rparrett added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed S-Needs-Triage This issue needs to be labelled labels Aug 15, 2022
@bors bors bot closed this as completed in fe6246d Aug 30, 2022
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective

Fixes bevyengine#5687

## Solution

Update the methods on the `Entity` struct to be `const`, so we can
define compile-time constants and more generally use them in a const
context.

---

## Changelog

### Added

- Most `Entity` methods are now `const fn`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

Fixes bevyengine#5687

## Solution

Update the methods on the `Entity` struct to be `const`, so we can
define compile-time constants and more generally use them in a const
context.

---

## Changelog

### Added

- Most `Entity` methods are now `const fn`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants