You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quoting the whole email, although the typeid aside is already #1
The only reason I see personally, for why one might want to allow
this, is to support a default/value-initialized return object (such as
"return {};"). The ambiguity-resolution seems not to be so motivating,
as that can always be solved simply by putting extra parentheses
around the type (BTW a "void()" within sizeof, typeid etc does not
declare a function, but specifies a type. you may want to correct that
in the paper).
As such, you may want to change your example, by instead writing
"return {};". Because when you are already fine with repeating the
type name, you can easily write your return statement as "return
Return();". I see no problem with that, and advices such as "ES.23:
Prefer the {} initializer syntax" are based on personal taste and like
any rule-of-thumb, there may be exceptions. "Type()" is just as safe
as "Type{}". In fact, you can argue that "Type()" is yet safer because
"Type{}" allows the construction of unnamed references initialized by
temporaries, and therefore to hide this error:
I need to find my notes from ACCU2017, I'm sure people suggested better motivations to me after the lightning talk, but I don't know if I wrote them down or not.
The motivating example's pretty weak, and as noted in https://groups.google.com/a/isocpp.org/d/msg/std-proposals/eoU_uFtOOUA/I2i4D9MzCQAJ is actually flawed.
Quoting the whole email, although the
typeid
aside is already #1The text was updated successfully, but these errors were encountered: