Tag Archives: optional

Efficient optional values

In this post we will see a library for storing nullable/optional values that can in certain situations replace and outperform Boost.Optional. Advertisements

Posted in programming | Tagged , , , , | 4 Comments

Set-up and tear-down

Recently as part of program run-time performance optimization effort, I was scanning through the code for occurrences of keyword new. The goal was to find unnecessary memory allocations. I was surprised to find most of news in the unit test … Continue reading

Posted in programming | Tagged , , | 5 Comments

A conditional copy constructor

In this post we will try to define a ‘wrapper’ class template that does or does not have a copy constructor depending on whether the wrapped class has it. This will be a good opportunity to explore in depth a … Continue reading

Posted in programming | Tagged , , , , , | 3 Comments

A gotcha with Optional

This post is about one gotcha in Boost.Optional library. When starting to use it, you might get the impression that when you try to put optional<T> where T is expected, you will get a compile-time error. In most of the … Continue reading

Posted in programming | Tagged , , , | 22 Comments

On operator<

Today I want to share with you a more philosophical issue I face with how the meaning of operator< is overloaded in C++. This could cause subtle bugs in programs.

Posted in programming | Tagged , , , , | 17 Comments

Clever overloading

This post is intended to be a light introduction to certain C++ guru tricks. I want to introduce a couple of concepts that typically put normal people off. If you are an expert you will probably not learn anything new, … Continue reading

Posted in programming | Tagged , , , , | 24 Comments

Ref-qualifiers

In this post I want to describe a small language feature added in C++11 that, although essential for full value semantics support, is often neglected in tutorials and in compiler implementations.

Posted in programming | Tagged , , | 4 Comments