Even though default parameters are simple to understand for their basic usage, there are many things to know to make the most out of them. Like, really many. To explore various aspects of this vast topic, let’s start a series of post dedicated to the topic: Default parameters in C++: the facts (including the secret […]
The comma operator is a curious operator and seldom used, but it happens to encounter it in code. And sometimes by mistake. Such encounters can give a hard time understanding the code. For this reason it is useful to know what it does, and what it doesn’t do. This article is not made to show […]
Today’s guest post is written by guest author jft, as a sequel to his previous article How to Convert a String to an int in C++. In this post, jft presents the performance analyses he conducted to find out which method is fastest to extract numbers from a string. Interested in writing on Fluent C++ […]
Today’s guest post is written by guest author jft. In this article, he presents us a thorough comparison between the various ways C++ offers to extract number from a string. You will see how they differ from each other in terms of features as well as in term of ease of use in code. Interested […]
Last week, Jon Kalb and Phil Nash, the organizers of C++Chat, invited Kate Gregory and I on the show to discuss “Simplicity” in C++ code, and in designing code in general. We had a very interesting discussion, that includes topics such as: how to measure complexity, coupling in code, levels of abstraction, the hard decisions […]
Today’s guest post is written by guest author Miguel Raggi. Miguel is a Computer Science and Math professor at UNAM, Mexico’s largest university. He loves clean, expressive, performant C++ code (and strives to convince students to write it in this way!). Miguel is the author of discreture, an open source C++ library to efficiently generate […]
While working on the NamedType library I came across a situation that left me stunned in bewilderment: a const reference that allows modification of the object it refers to. Without a const_cast. Without a mutable. Without anything up the sleeve. How can this be? And how to enforce the const in that const reference? A const reference […]
This article is a guest post written by guest author jft. C++17 has brought a lot of features to the C++ language. Let’s dig into three of them that help make coding easier, more concise, intuitive and correct. We’ll begin with Structured Bindings. These were introduced as a means to allow a single definition to […]
I originally wrote this article for Morning Cup of Coding. Morning Cup of Coding is a newsletter for software engineers to be up to date with and learn something new from all fields of programming. Curated by Pek and delivered every day, it is designed to be your morning reading list. Learn more. C++ structs are little bundles […]
One of the common guidelines about naming things in code is to be consistent. But what does that mean, in practice? I had the chance to be at C++Now this year, and attend Tony Van Eerd’s great talk called Words of Wisdom, where he gave a very practical approach to that question (amongst many other […]