Using classes/objects with CubeMX project
Dude 😊 I dont think you have C++ here. Only C.
C++ is very "heavy" and is to found only on the bigger ARMs (think Raspberry pi ARMs) etc.
For the "small" devices, like the oneswe have here (not running Linux) etc, you will have to make do with "standard" C.
The modern ubiquity of these ARMs make us forget that sometimes we work with very resource limited embedded devices.
Hope this clears it up (use and go C)