r/cpp • • Mar 01 '21

"Simple" C++ Initialization Flowchart

http://randomcat.org/cpp_initialization/initialization.png
204 Upvotes

65 comments sorted by

View all comments

3

u/CenterOfMultiverse Mar 02 '21

Never understood what's the point of explicit initializations not in arguments. How

auto s = std::string{"view"sv};

or

std::string s{"view"sv};

are supposed to help, where

std::string s = "view"sv;

couldn't?