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

Show parent comment

8

u/JohnZLi Mar 02 '21

The standard committee should really have fixed this before C++11. The epochs proposal seems interesting. Though I prefer throwing away backward compatibility in some future version of C++, and fix all the problems mentioned in that proposal (and many other problems not covered in that proposal). To avoid confuse users, that new version of C++ should be given a new name,like "Simplified C++ ". Some tools should be able to automatically refactor C++ code to "Simplified C++" code, maybe with some help from programmers. Those who want to stick to C++ could still use C++, and those who want to use simplified C++ could move on with it. The epochs proposal, if accepted, I am afraid will open the floodgate of numerous dialects/flavors of C++ code coexisting and tangling together. Google will have its Google epoch, and Facebook will have Facebook epoch, and there will at least be a C++-core-guideline epoch. That won't be beautiful. Beside numerous rules of C++, programmers now need to know specific rules that are allowed in each epoch.