frc-docs icon indicating copy to clipboard operation
frc-docs copied to clipboard

C++ Custom triggers example broken

Open sciencewhiz opened this issue 3 years ago • 1 comments

The directions for creating a custom trigger by subclassing Trigger in C++ is broken because https://github.com/wpilibsuite/allwpilib/pull/2259 removed the virtual Get() method. I'm not sure that there is a solution other then removing subclass example and only referencing the the lambda method for C++.

https://docs.wpilib.org/en/stable/docs/software/commandbased/binding-commands-to-triggers.html#creating-your-own-custom-trigger

sciencewhiz avatar Feb 28 '22 02:02 sciencewhiz

I'm all for removing the subclassing option for both languages; it's unidiomatic, not recommended, and a very niche use case that if anyone stumbles upon it it will probably be a team with enough knowledge to do it properly regardless of whatever we write in the docs.

Teams should be using the lambda ctor, maybe as a super() call from a subclass (like NetworkButton etc).

Starlight220 avatar Aug 30 '22 09:08 Starlight220