pros icon indicating copy to clipboard operation
pros copied to clipboard

feat: :sparkles: Make controller ctor constexpr

Open ion098 opened this issue 1 year ago • 4 comments

Summary:

Changes the pros::Controller constructor to be constexpr.

Motivation:

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

Test Plan:

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

ion098 avatar Jul 05 '24 00:07 ion098

/azp run

BennyBot avatar Jul 05 '24 14:07 BennyBot

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jul 05 '24 14:07 azure-pipelines[bot]

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

djava avatar Jul 07 '24 20:07 djava

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.

ion098 avatar Jul 08 '24 18:07 ion098