Daily bit(e) of C++ | Init statementsDaily bit(e) of C++ #125, The C++17 (if, switch) and C++20 (range-for) init statements.Šimon TóthMay 06, 20232ShareInit statements enable fully encapsulated if, switch (C++17) and range-for loop (C++20) statements by adding an additional init section that can be used to create variables with a lifetime matching the statement block.Click to open in Compiler Explorer.Leave a commentThanks for reading Daily bit(e) of C++! Subscribe for free to receive new posts and support my work.Subscribe