switch (and other control flow) as expressions? - Rust inspired
switch
文でこんな感じに値を返したいな!という話。
auto x = switch (something) { case FOO: break 1; case BAR: break 2; default: break 3; }
auto x = [&]{ switch (something) { case FOO: return 1; case BAR: return 2; default: return 3; }}();