Yearly Archives: 2018

A Simple Timer in C++

Published December 28, 2018 - 0 Comments
timer C++

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 […]

A Free Ebook on C++ Smart Pointers

Published December 25, 2018 - 2 Comments
C++ smart pointers free ebook

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 […]

The SoA Vector – Part 2: Implementation in C++

Published December 21, 2018 - 0 Comments

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 […]

Named Arguments in C++

Published December 14, 2018 - 9 Comments

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. […]

Overview of std::map’s Insertion / Emplacement Methods in C++17

Published December 11, 2018 - 2 Comments
insert_or_assign try_emplace map C++

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 […]

Algorithms on Ranges

Published December 7, 2018 - 5 Comments

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 […]

An Extraterrestrial Guide to C++ Formatting

Published December 4, 2018 - 0 Comments

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 […]

How to Design Function Parameters That Make Interfaces Easier to Use (3/3)

Published November 30, 2018 - 7 Comments

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 […]

How to Design Function Parameters That Make Interfaces Easier to Use (2/3)

Published November 27, 2018 - 8 Comments

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 […]

1 2 3 11