-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
document ref-return-scope function parameters #2584
Conversation
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
|
||
--- | ||
U xerxes(ref return scope V v); // (1) ref and return scope | ||
ref U xerxes(ref return scope V v); // (2) return ref and scope |
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.
This is still a bit cryptic to me, could you add some (il)legal uses/definitions please?
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.
done
9de844e
to
672e709
Compare
int foo2(return scope ref S s); | ||
|
||
ref int* foo3(return ref scope S s); | ||
ref int foo4(return ref scope S s); |
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.
Please avoid aligning the code. It will just require more work if new examples are added.
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 disagree, in this particular case it really helps to get the point across.
|
||
$(P The second form attaches the `return` to the `ref`, and has | ||
$(LINK2 #return-ref-parameters, return ref parameter) semantics | ||
with additional |
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.
Don't use relative LINK2 in the specification. It doesn't work with Latex.
Part of DIP1000.