Single Abstract Method Traits

from blog mcyoung, | ↗ original
↗ original
Rust and C++ both have very similar operational semantics for their “anonymous function” expressions (they call them “closures” and “lambdas” respectively; I will use these interchangably). Here’s what those expressions look like. auto square = [](int x) { return x * x; }C++ let square = |x: i32| x * x;Rust The type of square in both versions is...