3 ms·
> Coming from Go, I was surprised that something like > > if let Some(x) = > some_var; expr(x) { } > > isn't a thing. The same thing in C++17: if (aut
by spacechild1 2y ago
> Coming from Go, I was surprised that something like
>
> if let Some(x) = > some_var; expr(x) { }
>
> isn't a thing.
The same thing in C++17:
if (auto x = something();
expr1(x)) {}
else if (expr2(x)) {}
It's really neat to have the variable scoped to the if/else-clause.