Tag Archives: generic programming

Diagnosable validity

Certain combinations of types and expressions can make a C++ program ill-formed. “Ill-formed” is a term taken from the C++ Standard and it means that a program is not valid, and compiler must (in most of the cases) reject it. … Continue reading

Posted in programming | Tagged , , , , | 8 Comments

Concepts without Concepts

“Concept” can mean two things in the context of C++ generic libraries: Something informal: something we know about template parameters, and can tell to other human programmers, e.g. in documentation. A language feature. This post is about concepts in the … Continue reading

Posted in programming | Tagged , , , , | 10 Comments

A customizable framework

In this post I want to describe a problem my colleagues have faced a couple of times recently, and show how it can be solved with C++. Here is the goal. We want to provide a function (or a set … Continue reading

Posted in programming | Tagged , , | 30 Comments

Overload resolution

This post is an introduction to another one that I intend to write in the future. The goal of this one is to go over the concepts of function template specialization, function (template) overloading, argument dependent lookup (ADL) and overload … Continue reading

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

Designing a generic library

I consider the Standard Template Library an amazing piece of work that constitutes a milestone in the evolution of programming languages. Not only is it useful in itself, but it also brought into existence the notion of generic programming. What … Continue reading

Posted in programming | Tagged | 1 Comment

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

Type erasure — Part II

In the previous post, we have seen that there is a number of ways to erase the type of an object while still holding a “handle” to it and being able to make use of it. This can be summarized … Continue reading

Posted in programming | Tagged , , , , | 6 Comments