We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is a fork-off from #13639 (comment) "Control-flow declarations" were formerly called "if-var" and "while-var", introduced in #17047 and #17304.
Right now the control-flow variable borrows from the control-flow expression of an owned or shared type:
var myC = new shared C(); if const temp = myC { // here 'temp' is a borrowed C }
This issue request allowing such temp to preserve the memory management of the control-flow expression, rather than borrowing from it:
temp
var myC = new shared C(); if const temp = /* Please share the ownership with me. -User */ myC { // here 'temp' is a shared C }
One possible syntax for this is to have the user specify the type of the temp, with the semantics of a cast from myC to that type, for example:
myC
var myC = new shared C(); if const temp: shared = myC { // here 'temp' is a shared C }
The text was updated successfully, but these errors were encountered:
I think this is a reasonable direction, but would probably opt to file it away until someone has a pressing use-case for it.
Sorry, something went wrong.
No branches or pull requests
This is a fork-off from #13639 (comment)
"Control-flow declarations" were formerly called "if-var" and "while-var", introduced in #17047 and #17304.
Right now the control-flow variable borrows from the control-flow expression of an owned or shared type:
This issue request allowing such
temp
to preserve the memory management of the control-flow expression, rather than borrowing from it:One possible syntax for this is to have the user specify the type of the
temp
, with the semantics of a cast frommyC
to that type, for example:The text was updated successfully, but these errors were encountered: