Recently, these two questions:
have made me wonder if we need a solid canonical duplicate for c++ initialization. The reason why I picked these two particular questions is because:
they demonstrate little to no research effort, but they are highly upvoted, indicating interest
they are recent
the questions seem basic but the answers can be complex. On the other hand, the question implies a supposed significant difference between two forms of syntax, when in fact they are very similar.
The broad and general nature of these questions also make it hard to mark them as duplicates, although I'm certain that they exist in some form or the other. I'm looking for something like How do I use arrays in C++?, whenever somebody asks about sizeof
or confuses arrays and pointers.
Some examples of good resources would be:
Herb Sutter's blog, which talks about all forms of initialization
cppreference, which pulls information directly from the Standard, but makes it human-readable and organizes them neatly into separate pages
Because the nature of such a canonical question is likely to be too broad, as I believe the two linked questions are, I suggest a condensed version of cppreference's approach, which succinctly covers most cases, like T.C.'s answer. The benefit of having the information in one place is that contemporary knowledge, like defects and the subtle differences between language standards, can be found in one place. It would also reduce the need to copy/paste fervently from the almighty ISO standard, which I feel most of the time spent in an answer is spent copy editing.
Is such a question viable or would it be too broad?