Some languages, such as JavaScript or Visual Basic, offer the feature of a timer, that is to say an object that calls some code at defined intervals. At the time of this writing (C++17) and to my knowledge, C++ doesn’t offer such a feature. A library called timercpp, that replicates in C++ this handy functionality […]
To write expressive code in C++, mastering smart pointers is a necessity! Without them, our code becomes littered with memory management, news and delete, and unclear semantics about who owns what resources. If you’re part of my mailing list (which you can join at the bottom of this post), you will get as a Christmas gift […]
Today’s guest post is the second part of a two-posts series written by Sidney Congard. Sidney is an almost graduated student and an intern at QuasarDB, a company writing it’s own database in C++17. He has been doing C++ in his free time regularly for two years. Also interested in writing on Fluent C++? Check […]
Today’s guest post is the first part of a two-posts series written by Sidney Congard. Sidney is an almost graduated student and an intern at QuasarDB, a company writing it’s own database in C++17. He has been doing C++ in his free time regularly for two years. Also interested in writing on Fluent C++? Submit […]
Ah, named arguments! If the term “feature envy” wasn’t already used to designate a refactoring, we would have employed it to talk about named arguments: it’s a feature that languages that don’t have it envy to the languages that do. Named arguments consist in specifying at call site the parameter names of the arguments passed. […]
Today’s guest post is written by @walletfox, one of the hitchhikers in the C++ galaxy, trying to navigate its dark corners by writing articles, creating Mostly Harmless cheat sheets and observing the following rules: “Don’t panic! Always carry a cheat sheet next to the towel. So long and thanks for all the fish.”. Interested in writing on Fluent C++ too? Submit your […]
In a lot of cases, using STL algorithms in C++ code allows to make it more expressive. However, some developers reported to me they had a hard time diffusing the usage of the STL in their companies, as their co-workers weren’t always keen on putting the STL in their daily coding toolbox. There were several […]
Today’s guest post is written by Victor Zverovich. Victor is a software engineer at Facebook working on the Thrift RPC framework and the author of the popular {fmt} library, a subset of which is proposed into C++20 as a new formatting facility. He is passionate about open-source software, designing good APIs, and science fiction as […]
This is the final article in the series about function parameters. This series contains: Part 1: interface-level parameters, one-parameter functions, const parameters, Part 2: calling contexts, strong types, parameters order, Part 3: packing parameters, processes, levels of abstraction. To pack or not to pack? As a general rule, functions interfaces tend to become unclear when they […]
Let’s continue exploring how to design function parameters that help make both interfaces and their calling code more expressive. If you missed on the previous episode of this topic, here is what this series of articles contains: Part 1: interface-level parameters, one-parameter functions, const parameters, Part 2: calling contexts, strong types, parameters order, Part 3: packing […]