Question

I'm learning to program my Arduino, but I have a pretty solid background in C++, which means that I was very disappointed to find that I couldn't use the C++ Standard Library. I've been looking around trying to find out exactly why that is, and so far the only plausible explanation is that AVR-GCC is not compliant with the C++ Language Standard.

Now, I know that most compilers have minor deviations from the Standard, but I'm thinking that there must be something really big that separates AVR-GCC with GCC, Clang, or any of the other compilers I've used before. Like some massively important feature that's totally missing, or something. There must be a good reason for why I can't use std::vector for instance. It's just way too useful to leave off for no reason.

So what is it? What is the giant hole in the AVR-GCC dialect that makes the C++ Standard Library unworkable on an Arduino? And I'm asking this out of more than just curiosity, because if there are giant holes in the language, then I need to know about them before I go blundering into some undefined behavior that I didn't expect.

Was it helpful?

Solution

AVR-GCC is clearly the work of hobbyists. Essentially, nobody is willing to pick up the hard work of writing a Standard Library implementation. Writing a standard library is not a trivial task for desktop platforms, and the limited capabilities of the Arduino only make it harder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top