Little-known C++: operator auto

A user-defined conversion function enables an implicit or explicit conversion between types. Such, a function has the following form (no return type and no parameters):

struct foo
   operator int() const {return 42;}

foo f;
int i = f;  // implicit conversion

cpplinq: set operators

In the previous posts I introduced cpplinq, a C++ template library that provides .NET-like query operators for sequences of objects in C++11. In this third installment I will discuss the set operators the library provides. There are four set operators: distinct, union_with (called so because union is a keyword in C++), intersect_with (suffix _with is…