Posted inInformation Technology

C++ – Defaults and Deletes – Pt. 3

In this installment for Defaults and Deletes we finish the code for the example program. So far, among the things you have learned is that the default deconstructor does basically nothing. Near Heap allocations are reclaimed automatically when you return from a method/function. For Far Heap objects all it does is free the allocation. It will not free any sub allocations. You have already been shown the code for the ImplicitClass so we will not … C++ – Defaults and Deletes – Pt. 3Read more

Posted inInformation Technology

C++ – Defaults and Deletes – Pt. 2

Before we go much further with this discussion on Defaults and Deletes, I need you to read the section titled Near Heap in this blog post. It’s a short read with pictures. Then you need to go thank the fools . . . err . . . “learned academics”, cough cough, who re-purposed the word heap to be a binary tree data structure. To understand why things are the way they are, I need you … C++ – Defaults and Deletes – Pt. 2Read more

Posted inInformation Technology

C++ – Defaults and Deletes – Pt. 1

Defaults and Deletes tend to be needlessly confusing for new C++ developers. Trying to learn this topic is why so many put on a diaper and go code Python. Hopefully this example series and discussion will allow you to man up. This is a continuation of my C++ series to assist junior/new developers so they can do something meaningful with their lives. No, you can’t use Python for a medical device. Remember: In the real … C++ – Defaults and Deletes – Pt. 1Read more

Posted inInformation Technology

C++ — That Const Thing

Const is what makes C++ great. Const is what makes C++ too horrible to work with. Developers who read those “Effective” books on C++ really screw the pooch. The developers working on the Qt library who hide everything anyone would want to override inside a “private” class only documented in the source file for the actual class and buried behind a macro passing most everything to it as const make the “screw the pooch” developers … C++ — That Const ThingRead more

Posted inExperience / Information Technology

C++ Initialization and Constructors Explanation

While many of the tools I and other developers use making medical devices require C++17 much of the code we write is C++11. Usually this is mandated by the shop. There are good reasons for sticking with C++11. It is easier to change out a library, especially if another project has already vetted that version of the library with the FDA, than it is to change the coding standard of an existing device. Instead of … C++ Initialization and Constructors ExplanationRead more