Pairs

let cons = (a, b) => (pick) => ({1: a, 2: b}[pick]); let car = (x) => x(1); let cdr = (x) => x(2); What if we could build pairs out of nothing at all?…

`std::decay` and perfect forwarding

Once again, @kerrek-sb explains how to correctly use std:decay when implementing perfect forwarding (both in C++11 and C++14) Here's the answer. I found myself in a similar situation. Namely, I was trying to implement a generic algorithm via tag dispatching. namespace detail { template<class Range>…