Hacker News new | past | comments | ask | show | jobs | submit login

I think you missed exceptions often being a problem in low level and embedded targets. That knocks out most of STL anyway.

I also think you are a bit harsh on virtual functions - it introduces a single indirection, yes, but sometimes that is fully justified. RTTI on the other hand... of course depends a bit on target characteristics.

Perhaps controversial, I've also found (especially bare) lambdas and even std::function objects useful, although may evolve into something purely static when the dust settled. Highly dependent on target of course.

It will be interesting to see the final form of the new MISRA std, since the active one predates all of this.




If you can't use the STL because of exceptions: https://www.etlcpp.com/


Sure, there are more embedded friendly libraries, but that wasn't the topic.


It’s almost as if this is some sort of discussion board where people can expand on the topic as they see fit :D


You can use quite a lot of STL even with -fno-exceptions. Things that you probably need to ditch are:

std::vector

std::list

std::map

std::unordered_map

std::set

std::unordered_set

std::sort

std::transform

std::merge

std::string

std::regex

std::swap

std::function

std::stable_partition

But there are much more than that in STL.


most (useful) containers are out, what else are left in STL for embedded systems, algorithms?


True: "most" was a stretch.


newest MISRA for c++ just came out, though it's based on c++17




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: