Yearly Archives: 2017

STL Algorithms on Sets

Published December 29, 2017 - 2 Comments
STL algorithms sets C++

If you want to become proficient at manipulating collections in C++, you have to know your STL algorithms. And in particular, you have to know your STL algorithms on sets. The algorithms on sets are less famous than the classical std::for_each or std::accumulate algorithms but they are just as useful, if not more. The algorithms on sets include […]

How to Emulate The “super” Keyword In C++

Published December 26, 2017 - 11 Comments
super c++

  [A Russian translation of this article is available on howtorecover.me – courtesy of Vlad Brown]   A derived class sometimes needs to call the code of its base class and name it explicitly. But for bases classes with a long name, repeating it in the body of the derived class adds a lot of clutter to […]

Why Expressive Code Matters

Published December 22, 2017 - 0 Comments
Why expressive code matters

On Fluent C++, we talk a lot about topics related to expressive code: writing expressive code, making existing code more expressive, and how to keep our motivation up and improve even when facing code that is not expressive. But WHY do we do this? Why is expressive code the main technical characteristic of code we […]

More Tips On Naming

Published December 15, 2017 - 0 Comments
More tips on naming

Getting naming right is crucial to convey your intentions through code. Indeed, the compiler doesn’t care if your names are clear enough. It is just for the people who work with you. And that includes you. The clarity of the names in a piece of code has a strong impact on how easy it is […]

Mixin Classes: The Yang of the CRTP

Published December 12, 2017 - 2 Comments
Mixin classes CRTP

Now that we’re clear on how the CRTP works, let me share with you another technique involving templates that is complementary to the CRTP: Mixin classes. I learnt about mixin classes by watching Arthur O’Dwyer’s Template Normal Programming talk at CppCon (actually you can find them in the slides because they were skipped over during the presentation). I find […]

Make Your Functions Functional!

Published December 8, 2017 - 2 Comments
functions functional inputs outputs

A function takes input and produces outputs. Simple, right? If so, how come that a lot of functions in C++ code don’t look that way? And how to overcome those difficulties to make them look like proper functions and show a clear interface? This is the subject of this week’s video: Don’t want to miss […]

A Minimal Interface: Both Expressive And Fast Code

Published December 5, 2017 - 0 Comments
Minimal interface

Have you ever used std::inserter to insert the outputs of an STL algorithm into a sorted container such as an std::set? And if you have, weren’t you annoyed by how its interface forces you to specify the position to insert the elements in the set? I find this very annoying, because most of the time we have […]

1 2 3 11