Jonathan Boccara's blog

A new post every Tuesday and Friday morning

How to Make Custom Deleters More Expressive

Published September 1, 2017 - 3 Comments

Most of the times where we use std::unique_ptr, we’re fine without using a custom deleter. But sometimes, a custom deleter offers a way out of a tricky situation. Now that we’ve seen how to use custom deleters and when they can be useful, I would like to share with you a technique to make their usage […]

Smart developers use smart pointers (3/7) – Custom deleters

Published August 29, 2017 - 13 Comments

The previous episodes of the series explained what smart pointers are, and which ones to use in your code. Here I show a technique that allows to encapsulate complex memory management into std::unique_ptr, to relieve your code from low-level memory manegement. The series Smart developers use smart pointers contains: Smart pointer basics unique_ptr, shared_ptr, weak_ptr, scoped_ptr, […]

unique_ptr, shared_ptr, weak_ptr, scoped_ptr, raw pointers – Knowing your smart pointers (2/7)

Published August 25, 2017 - 7 Comments

This is episode 2 in y  series Smart Developers Use Smart Pointers. The series contains: Smart pointer basics unique_ptr, shared_ptr, weak_ptr, scoped_ptr, raw pointers: clearly stating your intentions by knowing your smart pointers Custom deleters and How to make them more expressive Changing deleters during the life of a unique_ptr How to implement the pimpl idiom […]

How to Handle Multiple Types in Max Without A Cast

Published August 18, 2017 - 4 Comments

Today I want to share with you an interesting technique shown by Arthur O’Dwyer in his CppCon talk, Template Normal Programming, to deal with min and max on different types. Arthur has kindly accepted that I share this content with you on Fluent C++. This will be a shorter post, fit for summer as you […]

Function Templates Partial Specialization in C++

Published August 15, 2017 - 5 Comments

Why doesn’t C++ allow partial specialization on function templates? Such was the question I asked to you, readers of Fluent C++, in the post covering Template Partial Specialization. Not because I wanted to test you, but simply because I couldn’t find the answer. And oh boy did I get an answer. The post received comments, questions, […]

Template Partial Specialization In C++

Published August 11, 2017 - 4 Comments

Today I want to share something about the right way to emulate partial function template specialisation in C++. I learnt it by watching Arthur O’Dwyer’s CppCon talk Template Normal Programming. Actually, the technique for emulating function template partial specialization through class template specialization is well known, but the naming convention used by Arthur is the […]

A Summary of the Metaclasses Proposal for C++

Published August 4, 2017 - 17 Comments

A couple of weeks ago, Herb Sutter posted his proposal about metaclasses, triggering a wave of enthusiasm among the C++ community. And for good reason. His proposal gradually introduces the reader to the impressive potential of metaclasses, in particular to improve the expressiveness of current C++ idioms. I think everyone should be aware of the […]

How to Use Overloaded Functions With The STL

Published August 1, 2017 - 6 Comments

The latest challenge on Fluent C++ wasn’t an easy one. It consisted in finding the best way to use overloaded functions with the STL – or with any other context that accepts functions as parameters, for that matter. You guys submitted solutions that took very different approaches, and this is awesome. Let’s see in details […]

1 4 5 6 7 8 14