To be in line with the strictest and most proper C++ design principles (a very good idea), you don’t want to use void* in the scenario you describe. Rather, you want to take advantage of polymorphism and use an abstract base class pointer instead.
For example, if all your sensors derive from a single abstract base class (like the WPILib classes do), then you can use a pointer to the base class to access the inherited class functions.
I assume that GetValue is inherited from SensorBase and is virtual. ( I don’t have the library in front of me at the moment.) Therefore, rather than using a void* you can use a SensorBase* like this:
If you want to use the void* you need to recast it for the compiler to know what you are doing. So, you need a recast for each different sensor. This leads to all sorts of extra code that you avoid by going the polymorphic route.