ReadingC/C ++ Embedded System ProgrammingWhen I was writing a book, I found a very meaningful topic and recorded it here for future use.
This article contains knowledge points: C ++ features that are usually not used in Embedded Systems
/*********************************** I am a lovely splitting line * * *_^ ************************************** */
Embedded C ++ standards
You may want to know why C ++ creators have joined so many expensive tasks-execution time andCodeSize-features. You are not a minority. People all over the world are confused about the same thing-especially users who use C ++ for embedded programming. Many of these expensive features are recently added. They are neither absolutely necessary nor part of the original C ++ specification. These features are added one by one to the ongoing "Standardization" process.
In 1996, a group of Japanese chip manufacturers joined forces to define a subset of the C ++ language and library, which is more suitable for embedded software development. They call their new industrial standards embedded C ++. Surprisingly, in its early stages, it had a huge impact on the C ++ user group.
As a proper subset of the C ++ standard draft, Embedded C ++ skips many things that can be omitted without limiting the expressiveness of lower-layer languages. These omitted features include not only imagesMultiple inheritance, virtual base class, runtime type identification, and Exception HandlingAnd some new features, such:Template, namespace, new type conversion. The rest is a simple version of C ++, which is still object-oriented and a superset of C, but it has obviously less runtime overhead and smaller Runtime Library.
Many commercial C ++ compilers have already specifically supported Embedded C ++ standards. Some other compilers allow you to manually disable specific language features, so that you can imitate Embedded C ++ or create your customized C ++ language.
/*********************************** I am a lovely splitting line * * *_^ ************************************** */
Note: C ++ also has a very handsome feature called " function overload " -- for Embedded users, it is best not to use it, this will be realized when "C, C ++ mixed programming" is used in the future!