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
For "small footprint" where I would be concerned is code bloat. If your code needs to reside in a small piece of hardware, an instance of the template class
std::vector
has its own set of instructions, seperate from
std::vector
So every time you create a new kind of vector, the compiler effectively copy-pastes the code to create the new class, with its own set of functions, duplicating every instruction. If you have constraints on the amount of memory to store instructions, this could become problematic very fast. Its become problematic for people on non Embedded systems.
In terms of runtime performance, though, I think you don't have much to worry about. In some cases, such as sorting, C++ outperforms C.