Share this postDaily bit(e) of C++Daily bit(e) of C++ | Init statementsCopy linkFacebookEmailNotesMoreDaily 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, 20232Share this postDaily bit(e) of C++Daily bit(e) of C++ | Init statementsCopy linkFacebookEmailNotesMoreShareInit 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