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
struct A {
A() = default; // OK
A(int v) : v(v) { } // OK
const int& v = 42; // OK
};
A a1; // error: ill-formed binding of temporary to reference
A a2(1); // OK, unfortunately
I understand why it's unfortunate (code compiles although it immediately produces a dangling reference), but I'm wondering, do words like "unfortunately" belong to the Standard? Is there a reference somewhere about what kind of "lexicon" / "register" (as in social linguistics) is one expected to use in the Standard itself?
The text was updated successfully, but these errors were encountered:
The ISO drafting directives define the language to be used, but this is just a comment in a non-normative example. It's not specifying anything, it's just commentary on what is defined elsewhere.
This is a comment in a non-normative example, the phrasing is not actively insulting or disrespectful to anyone, and does offer probably helpful interpretation.
@tkoeppe, please re-open if you want a change here.
jensmaurer
changed the title
"Unfortunately" in standardese text ([class.base.init])
[class.base.init] "Unfortunately" in standardese text
Feb 16, 2021
Hi,
In [class.base.init] https://eel.is/c++draft/class.base.init#11 there's this example with comments:
I understand why it's unfortunate (code compiles although it immediately produces a dangling reference), but I'm wondering, do words like "unfortunately" belong to the Standard? Is there a reference somewhere about what kind of "lexicon" / "register" (as in social linguistics) is one expected to use in the Standard itself?
The text was updated successfully, but these errors were encountered: