In the previous episode we presented how to uncover 32 Qt best practices at compile time with clazy. Today it’s time to show 5 more and other new goodies present in the freshly released clazy v1.2.
Warns when the content of
Q_RETURN_ARG() is not normalized. Using normalized signatures allows to avoid unneeded memory allocations.
// warning: Signature is not normalized. Use void mySlot(int) instead of void mySlot(const int)…
Because it is so easy to setup QZXing in a Qt application, we and most of our customers end up using it when they need to scan images for barcodes. There is, or rather was, a big problem though: When you want to analyze a live camera video stream, e.g. from a phone camera, the latency can …
Bringing software into a safety critical environment can be tricky, especially when using the complex APIs needed for modern 3D graphics. That’s what makes OpenGL SC (Safety Critical) so important: it bridges the gap between beautiful displays and functional safety, while trying to remain as close to existing embedded standards that we all know and love. OpenGL SC will only become more prevalent in embedded graphics work as industries increasingly try to merge safety conscious methodologies with user-friendly interfaces.…
This blog series will introduce the clang-tidy utility from the Clang/LLVM project and show how to use it to automatically refactor…
I’m extremely happy to finally announce the first stable release of heaptrack, the FOSS heap memory profiler for C/C++ Linux applications. You can download the source tarball from the KDE mirrors: https://download.kde.org/stable/heaptrack/1.0.0/src/
Heaptrack is a fast heap memory profiler that runs on Linux. It allows you to track all heap memory allocations at run-time. Afterwards, the accompanying GUI tool can be used to find optimization opportunities in your code by analyzing the recorded profiling data. It allows you to:
In this article, I will take a look at one of the fundamental concepts introduced in Alex Stepanov and Paul McJones’ seminal book “Elements of Programming” (EoP for short) — that of a (Semi-)Regular Type and Partially-Formed State.
Using these, I shall try to derive rules for C++ implementations of what are commonly called “value types”, focusing on the bare essentials, as I feel they have not been addressed in sufficient depth up to now: Special Member Functions.…
Functional Safety is the term used for systems designed to minimize risk to human health. But there’s a dilemma in today’s tech-driven world.
We are more reliant than ever on software to control our planes, trains, cars, and boats, to operate our medical equipment, to process our food, to clean our water, and to power our homes. If these systems don’t function properly, they have the ability to injure, or even kill us. Meanwhile software complexity continues to increase exponentially …
Quick: When you design C++ APIs, when and how should you use pair and tuple?
The answer is as simple as it is surprising: Never. Ever.
When we design APIs, we naturally strive for qualities such as readability, ease-of-use, and discoverability. Some C++ types are enablers in this regard:
gsl::string_span, and, of course,
std::unique_ptr. They help you design good interfaces by providing what we call vocabulary types. These types may …
Is your code burning a lot of cycles hunting for strings? Maybe you need to find the proper charset nestled in a chunk of HTML, or look for the dimensions in an XPM image file, or locate the email attachment boundaries in a block of MIME. If you string search a lot and performance is important to you, you’ll want to keep reading!
You may have encountered Boyer-Moore string searches if you have a formal education in Computer Science or …