New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[namespace.udecl] tweak the example in para 17 so that the comment is… #726
[namespace.udecl] tweak the example in para 17 so that the comment is… #726
Conversation
… clear as to the reason for the ambiguity - the current comment could be interpreted as suggesting that the result of member-name-lookup (i.e. the declaration-set of S(x,D)) is ambiguous, which is certainly not the case -- the reason for the ambiguity is specified in [expr.ref]/5 -- and hopefully better reflected in the new comment. - add some additional examples that highlight the nuances of how the wording rejects or resolves certain member ambiguity.
@faisalv: Can you please attach a diffpdf screenshot? |
@faisalv: Ping. |
int f(D* d) { | ||
return d->x(); // ambiguous: \tcode{B::x} or \tcode{C::x} | ||
void f(D* d) { | ||
d->x(); // ambiguous: \tcode{x}'s direct parent \tcode{A} is an ambiguous base of the naming class \tcode{D} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We never use the word "parent" in the context of classes. (We only use it in the context of threads and directories.) "Parent-child" is a terrible metaphor for class inheritance (children aren't parents). A better metaphor is "base-derived".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed - that parent sinifies the container of the declaration - so in
struct A { void f(); }; - regardless of how member lookup finds 'f' in
whichever hierarchy - the direct parent would be 'A'. Should I use direct
containing class?
Faisal Vali
On Wed, Jun 8, 2016 at 5:33 PM, Thomas Köppe notifications@github.com
wrote:
In source/declarations.tex
#726 (comment):@@ -2935,8 +2935,12 @@
using C::x;
int x(double);
};
-int f(D* d) {
- return d->x(); // ambiguous: \tcode{B::x} or \tcode{C::x}
+void f(D* d) {- d->x(); // ambiguous: \tcode{x}'s direct parent \tcode{A} is an ambiguous base of the naming class \tcode{D}
We never use the word "parent" in the context of classes. (We only use it
in the context of threads and directories.) "Parent-child" is a terrible
metaphor for class inheritance. A better metaphor is "base-derived".—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/cplusplus/draft/pull/726/files/b79aef1dd96dd35e71094a5453967c5b74cf8646#r66352769,
or mute the thread
https://github.com/notifications/unsubscribe/AAxzPhiSgZHCtSD45VUKIW6EdEtj21rWks5qJ0M2gaJpZM4If6p6
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - what about x's declaring class 'A' - i think i like prefer that in many ways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure. Technically correct terminology would be good, but brevity is also good.
@zygoloid, @villevoutilainen: Wording masters, any suggestions on improving this example code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the class \tcode{A} where \tcode{x} is declared is an ambiguous base of the naming class \tcode{D} ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. I made some changes. Let me know if you folks think this is better or worse or too much? Also do you still need a diffpdf (if so, if you could point me to any resources that show a non-cumbersome way to do it in windows would certainly be appreciated)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The explanation and local terms are too much for my tastes, and I think they detract from the example as they're not directly linked to the terminology in the normative wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough - I'm not entirely unsympathetic to that POV. I might get motivated to re-style it at a future date - but if anyone sees any value in the general idea, feel free to take a crack at it. Thanks for the feedback.
just seeing this - never done it before - will look into it - thanks! Faisal Vali On Tue, May 31, 2016 at 6:05 AM, Thomas Köppe notifications@github.com
|
…ted member lookup ambiguities
… clear as to the reason for the ambiguity - the current comment could be interpreted as suggesting that the result of member-name-lookup (i.e. the declaration-set of S(x,D)) is ambiguous, which is certainly not the case -- the reason for the ambiguity is specified in [expr.ref]/5 -- and hopefully better reflected in the new comment. - add some additional examples that highlight the nuances of how the wording rejects or resolves certain member ambiguity. - alter the Note comment so that it is clear that using-declarations can resolve certain inherited lookup ambiguities, and include an example to reflect that.
…/faisalv/draft into fv-adjust-ambiguous-base-example
Thanks a lot for making the screenshot! That's really nice. With something that is difficult to lay out, it's always nice to see not just the source but also how it turns out.
|
… clear as to the reason for the ambiguity