“…There are issues such as dynamic memory allocation in C/C++, which is forbidden, under the DO-178B standard, in safety-critical embedded avionics code…”
Before knowing the above, the other day I have developed a handy little template to hold and provide, a plain 2d array, completely on the stack (aka the “matrix”).
It is also fully “compile time capable” with the full static internal presentation.
It is very handy to gently enforce company-wide C++ policies and to give some useful functionality in return. I am calling this approach “almost a pod”. Continue reading “Simple matrix for the rest of us”
Interface inheritance is good.
Just stumbled upon this excellent and succinct short text on how not to use inheritance. In C++ in particular, and I am adding: in general.
The purpose of inheritance in C++ is to express interface compliance (subtyping), not to get code reuse.
That text is precisely about differences v.s. the Objective-C, but it is priceless if and when you spot the growth of the weed of inheritance. Continue reading “C++ Inheritance easily grows out of control”
As I am also claiming since ages ago, inheritance as (class or component) composition method is evil. There is no reason to use class inheritance.
And I am not the inventor of this advice.
What more can we say? Ah yes, please read this little text first. Immediately. Then come back here.
Continue reading “C++ Inheritance is Anti-Pattern”
Well, they were, but not any more. Here is what I have realized since. Continue reading “C++ Are std::any and std::optional , “driving you up the wall” ?”
Sometimes ago I have shown a first real life example of the reason of existence of generic lambda, I have managed to make.
Now please consider this: Continue reading “C++ On and off the bandwagon”