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

✨ Make controller ctor constexpr #685

Open
wants to merge 1 commit into
base: develop-pros-4
Choose a base branch
from

Conversation

ion098
Copy link

@ion098 ion098 commented Jul 5, 2024

Summary:

Changes the pros::Controller constructor to be constexpr.

Motivation:

Allows pros::Controller instances to be declared constinit/constexpr.

Test Plan:

  • Check it compiles
  • Check that Controller instances can be declared as constinit/constexpr.

@BennyBot
Copy link
Member

BennyBot commented Jul 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@djava
Copy link
Contributor

djava commented Jul 7, 2024

While you're doing this, what other ctors should this be applied to? I imagine this isn't the only one.

@ion098
Copy link
Author

ion098 commented Jul 8, 2024

While you're doing this, what other ctors should this be applied to? I imagine this isn't the only one.

The issue is that some device ctors can't be made constexpr becuase they touch global state (changing this would require a breaking change to the PROS API which I don't think is gonna happen now), it feels a bit weird to have some devices with constexpr ctors and others without.

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 this pull request may close these issues.

None yet

3 participants