lightning talk
Lambda under the hood What if we capture by reference instead? [&] vs [=] Lambda template Move cannot move if const C++17: Clamp Before C++17, we were relying on the following code (or similar) to clamp a value. Now, with C++17, we can simply use std::clamp. Reverse Unique Sort Algos […]

Lightning talk #7 – C++ functionality: Did you know… ...


lightning talk
Paranthesis [crayon-5d5e8c0a3de7c195182139/] Returning non-bools [crayon-5d5e8c0a3de88912470549/] Returning bools [crayon-5d5e8c0a3de8f757534797/] Reusing data Similar behavior in if/else branches [crayon-5d5e8c0a3de96102433106/] Similar behavior in if/else branches [crayon-5d5e8c0a3de9d902361952/] Same behavior on both branches – move it outside the branches. [crayon-5d5e8c0a3dea3072161706/] Condition that appears on all steps – Check it only once. [crayon-5d5e8c0a3deaa830734662/]

Lightning talk #6 – Refactoring steps


code
Definition [crayon-5d5e8c0a3e5da090027148/] Fills the range [first, last) with sequentially increasing values, starting with value and repetitively evaluating ++value.   Syntax [crayon-5d5e8c0a3e5e6868943132/] But now let’s create a custom incrementable class. Iota is working with a T type, so we only need to overload the ++ operator. [crayon-5d5e8c0a3e5ed903195451/] So what do we have here? I’ve added a […]

std::iota and custom incrementable



trip report
A few days ago there was the WG21 meeting in San Diego and the committee have some excellent news for the upcoming C++20 and C++23. From the major features: Ranges, Concepts, and Contracts were merged into the C++20 standard. Modules and Coroutines will most likely be added in C++23. For […]

(C++20) 2018 San Diego ISO C++ Committee Trip Report : ...


code
Below you’ll find a list of problems I’ve made for testing the modern C++ knowledge. There are no hints here, so this is a knowledge check. Refactor as much as you want. All the answers are in my other posts, feel free to check them here. [crayon-5d5e8c0a3eedb299432749/]  

Practical work: Refactoring old code to Modern C++ (11 / ...


code
Definition std::terminate is called when exception handling fails, if: an exception was thrown and not handled the constructor or the destructor of a static or thread-local object throws an exception a noexcept specification is violated (exception is thrown in a function declared noexcept) …and many others – But these are […]

using std::terminate or “how to call that last function before ...



information
Hello guys, CPPCon 2018 is here (on youtube actually) so there’s a whole bunch of new videos ready to be seen. Click here for the playlist! Enjoy your view!

CPPCon 2018 is here!


code
Syntax [crayon-5d5e8c0a3fb88070648658/] Usage / Usability This feature is introduced mainly to take care of the pitfalls generated by using the (infamous and nasty) NULL macro. NULL is nothing but a preprocessor expanding to 0 at compile time and this expansion often leads to ambiguity. [crayon-5d5e8c0a3fb93999582498/] Given the following functions, how […]

General features: nullptr


code
Definition – unordered set / multiset [crayon-5d5e8c0a40508092970188/] Definition – unordered map / multimap [crayon-5d5e8c0a40513030032141/] Syntax [crayon-5d5e8c0a40519778568615/] Internally, the elements are not sorted in any particular order, but organized into buckets. Which bucket an element is placed into depends entirely on the hash of its value. This allows fast access to […]

STL Containers: Unordered containers



information
CPPEurope 2019 is almost here, and I’m excited to be there next year too! Make sure you follow their website and buy the tickets when they will be available. Feel free to also check my post about last year’s con. See you there!

CPPEurope 2019


code
Below you’ll find a list of problems I’ve made for testing the modern C++ knowledge level. All the answers are in my other posts, feel free to check them here or in the following link.

Practical work: Modern C++ (11 / 14)


code
Syntax [crayon-5d5e8c0a40b26277261664/] Invoke gives a uniform way of calling methods and functions. But why would we use this ? Let’s try to call some class functions, assuming we have the following struct defined. [crayon-5d5e8c0a40b31055456892/] Before invoke: [crayon-5d5e8c0a40b38635480659/] After invoke: [crayon-5d5e8c0a40b3e590909832/] This is pretty handy when you would like / need […]

Library feature: std::invoke