<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 28, 2018, at 5:55 PM, James Gregurich <<a href="mailto:bayoubengalml@mac.com" class="">bayoubengalml@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Mar 28, 2018, at 4:29 PM, John McCall <<a href="mailto:rjmccall@apple.com" class="">rjmccall@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">There is no existing concept of a move-only block. That is just not how blocks work.</span></div></blockquote></div><blockquote type="cite" class="">Just add __block to the declaration of tmp1.</blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">one cannot use __block with lambda syntax. One would have to give up lambda syntax. lambda syntax is preferable to blocks syntax because the explicit captures make for more understandable and configurable code. its much easier for a reader of code to reason upon what is going on in code with no non-obvious implicit activity happening as often happens with blocks syntax. we've had serious bugs that caused production hassles because objc pointers got implicitly and cyclically retained in a block capture. lambda syntax eliminates such bugs.</div><div class=""><br class=""></div><div class="">btw. I realize that "isn't how blocks work" currently... I'm inquiring about the potential of making it more friendly to the c++ way of doing things. Again, my purpose is to improve the experience of the c++ programmer doing cocoa development.</div></div></div></blockquote></div><br class=""><div class="">There is no feasible way to change blocks to a "move-only" system. It is not compatible with the language design, because the original identity of the block is immediately erased into a block pointer.</div><div class=""><br class=""></div><div class="">John.</div></body></html>