optional in Containers Ⅱ — Not All std::vector Usages Are The Same

Okay, so in the previous post I talked about putting optional<T> in container. I came to conclusions which I though were reasonable at the time, however, people — rightfully — pointed out some flaws in my argumentation.

As I was at ACCU last week, I wasn’t able to respond to them earlier (note to self: don’t publish and then fly away to a conference), so I’m doing that now. Let’s revisit my argumentations and see where I was wrong.

» read more »
Author's profile picture Jonathan

Should You Put optional in a Container?

Title says it all: should you put std::optional<T> in a container?

To answer that we have to take a slight detour first.

» read more »
Author's profile picture Jonathan

Guidelines For Rvalue References In APIs

I’ll be giving a talk at ACCU about when to use which pointer types and why.

While working on that I made some guidelines for rvalue references in interfaces which didn’t quite fit the talk, so I’m writing about them here.

When should you use rvalue references as function parameters?

When as return types?

What are ref-qualified member functions and when and how should you use them?

Let’s tackle it one by one.

» read more »
Author's profile picture Jonathan