Daily Shaarli

All links of one day in a single page.

February 1, 2015

Adding an 'in' operator to C++14

In languages such as python, there is an in operator that is used to check if element is in a range:

if 5 in [1, 2, 3, 4, 5]: print("There is a 5")

What’s nice about this, is the almost english type readability of it. Let’s look at how we can implement such an operator in C++14.

Named operator made easy:
https://github.com/klmr/named-operator

Improving error messages in C++ by transporting substitution failures

This is an advanced blog post more geared to library writers who want to improve error messages due to substitution failure. It discuss how substitution failures can be transported so the correct information can be presented to the user. Lets first look at the problem.