It seems to me people consistently shy away from, or rather vehemently oppose the use of, C++ on microcontrollers, but I can\'t for the life of me figure out why. If you sta
In C++ you essentially only pay for what you use over and above what would otherwise be C compilable code, and some of the extras are cost free.
The biggest issue with some C++ compilers for small targets is the completeness of available C++ implementations or the availability of a C++ compiler at all.
EETimes/Embedded.com has run a number of articles on the subject over the years:
The point most of these articles make is that you should not necessarily use all of C++ in an embedded system and they measure or explain the cost in terms of memory, speed, and determinism of various features. What parts you use will depend on the nature of your application (whether it has real-time constraints for example), and the available resources and performance of your target platform.