We haven’t talked too much about refactoring on Fluent C++ so far, but this is a topic related to code expressiveness. Indeed, most of the time we don’t start working on production code from scratch, but we rather work on an existing base. And to inject expressiveness into it, this can come through refactoring. To […]
In C++11, a host of new features were introduced in the language and the Standard Library, and some of them work in synergy. Move iterators are an example of how the STL collaborates with move semantics, to allow expressing several important concepts in a very well integrated piece of code. Well, almost. By using the native features only, we don’t get […]
How to split a string in C++? That is to say, how to get a collection of substrings representing the words of a sentence, or the pieces of data contained in a CSV entry? This is a simple question, but one which has multiple answers in C++. We will see 3 solutions, each one having advantages and […]
As a logical part of the STL learning resource, here is how the STL has been designed, and how you can design your components to make them benefit from the power of the STL. The design of the STL has been driven by the intention of separating algorithms from data structures. Algorithms include: those in the […]
A couple of days ago, the range-v3 library got a new component: the view::cartesian_product adaptor. Understanding what this component does, and the thought process that went through its creation is easy and will let you have a better grasp of the range library. (Note that you could just as well understand all the following by looking at the […]
Min and max are such simple functions that there is not much to say about them… or are they? The basic algorithms min, max Functionally speaking, std::min and std::max are doing simple things indeed: they take two values, and return the smaller of the two for std::min and the bigger of the two for std::max. Here […]
My colleague and friend Jonathan came up to me the other day with this request: “Jonathan”, he said – you won’t have too many names to remember to follow this story – “Jonathan, how would you go about restricting the methods of an interface? We’ve got a class which we use in a broader context, […]
If there is one thing that we, as developers, all have in common, it is our desire to learn. We like to get better at our language, or maybe take on a new one. We are avid of code design techniques, we want to know about the best practices to apply, we are passionate about […]
For the third time I attended the meetup of Software Craftmanship in Paris. And like the first time and the second one, it was superb experience again. This meetup lets the participants collectively choose the topics to be discussed. There I proposed to confront, as a group, the various languages that the people in the room knew (the […]
A couple of weeks ago, I had the chance to hear some feedback from Stephan T. Lavavej about the STL learning resource on Fluent C++. This was done during an episode of CppCast (the podcast for C++ developers by C++ developers) where he was a guest. Stephan said that he found it overall pretty good (yay!) but he had […]