Re:We used C++20 to eliminate a class of runtime bugs
by ncmncm on Friday January 14, 2022 @04:28PM
(#29940685)
It is good for initialization to look different. It is different. Not so much so for int, but maybe hugely different for other types.
Re:We used C++20 to eliminate a class of runtime bugs
by pjmlp on Saturday January 15, 2022 @03:57AM
(#29944945)
To build up on sibling's answer that isn't the same thing.
The first one will call the initialization constructor, whereas the second form will initialize the object and then apply one form of copy construction, depending on which ones are available (user provided or compiler generated).
It just happens that for int that doesn't matter in practice.
It makes code look silly, too, as now initialization looks different from assignment.