Error on verge of extinction, or why I put if (x = 42) in Red List of C & C++ bugs
If we ask a programmer what bugs are the most common in C and C++ code, they'll name a null pointer dereference, undefined behavior, array overrun, and other typical error patterns. They may name an accidental assignment in condition as well. However, let's see if this error is common today.
Error on verge of extinction, or why I put if (x = 42) in Red List of C & C++ bugs
by Andrey Karpov
From the article:
Because of this bug, developers invented the Yoda notation: a programming style where the constant is placed on the left side of the comparison operator. This style was meant to prevent a typo. If a programmer writes = instead of ==, the code won't compile.

Registration is now open for CppCon 2024! The conference starts on September 15 and will be held
Registration is now open for CppCon 2024! The conference starts on September 15 and will be held
Last time, we built a stateful but coalescing update notification using a change counter to identify which request is the latest one, but noted that it does unnecessary work. Let’s see if we can avoid the unnecessary work.
In today's post, I will continue where I left off with last month's post Understanding the role of cv-qualifiers in function parameters. This time, I will focus on type deduction.
Registration is now open for CppCon 2024! The conference starts on September 15 and will be held
Registration is now open for CppCon 2024! The conference starts on September 15 and will be held
Registration is now open for CppCon 2024! The conference starts on September 15 and will be held
The new