<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:49:09 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-60173] Ban implicit capture of `this` via `[=]` in lambda expressions</title>
                <link>https://jira.mongodb.org/browse/SERVER-60173</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The ask here is basically to remove `-Wno-deprecation` and fix the lambda problems that are a result of that. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=billy.donahue%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;billy.donahue@mongodb.com&quot;&gt;billy.donahue@mongodb.com&lt;/a&gt; &apos;s comment is probably accurate about exactly what should be disabled.&lt;/p&gt;


&lt;p&gt;Quoting the same source this is what we are getting rid of.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The implicit capture of&#160;*this&#160;when the capture default is&#160;&lt;tt&gt;=&lt;/tt&gt;&#160;is deprecated.&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
        <key id="1881906">SERVER-60173</key>
            <summary>Ban implicit capture of `this` via `[=]` in lambda expressions</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="juan.gu@mongodb.com">Juan Gu</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                            <label>auto-reverted</label>
                            <label>post-c++20</label>
                    </labels>
                <created>Thu, 23 Sep 2021 14:24:47 +0000</created>
                <updated>Sun, 29 Oct 2023 21:48:16 +0000</updated>
                            <resolved>Tue, 23 May 2023 18:09:53 +0000</resolved>
                                                    <fixVersion>7.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="5443840" author="xgen-internal-githook" created="Mon, 22 May 2023 22:41:00 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Juan Gu&apos;, &apos;email&apos;: &apos;juan.gu@mongodb.com&apos;, &apos;username&apos;: &apos;juangugit&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60173&quot; title=&quot;Ban implicit capture of `this` via `[=]` in lambda expressions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60173&quot;&gt;&lt;del&gt;SERVER-60173&lt;/del&gt;&lt;/a&gt; Ban implicit capture of this via &lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;#93;&lt;/span&gt; in lambda expressions&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ef97bdd7c76afbc5376358bed15e7c5325a329ad&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ef97bdd7c76afbc5376358bed15e7c5325a329ad&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5439525" author="xgen-buildbaron-user" created="Sat, 20 May 2023 00:05:18 +0000"  >&lt;p&gt;Ticket re-opened due to revert. &lt;a href=&quot;https://evergreen.mongodb.com/task/mongodb_mongo_master_macos_debug_suggested_compile_dist_test_02bf3f55f88874bf397b42758c9cd36093633f9e_23_05_17_22_34_33&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;compile_dist_test&lt;/a&gt; began a consistent failure of compile_dist_test&lt;/p&gt;</comment>
                            <comment id="5439522" author="xgen-internal-githook" created="Sat, 20 May 2023 00:04:03 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;auto-revert-processor&apos;, &apos;email&apos;: &apos;dev-prod-dag@mongodb.com&apos;, &apos;username&apos;: &apos;&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60173&quot; title=&quot;Ban implicit capture of `this` via `[=]` in lambda expressions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60173&quot;&gt;&lt;del&gt;SERVER-60173&lt;/del&gt;&lt;/a&gt; Ban implicit capture of `this` via `&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;#93;&lt;/span&gt;` in lambda expressions&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 02bf3f55f88874bf397b42758c9cd36093633f9e.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0d9af71984bbec1f51538e34b04a4fd399c1ebfd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0d9af71984bbec1f51538e34b04a4fd399c1ebfd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5433468" author="xgen-internal-githook" created="Wed, 17 May 2023 22:34:39 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Juan Gu&apos;, &apos;email&apos;: &apos;juan.gu@mongodb.com&apos;, &apos;username&apos;: &apos;juangugit&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60173&quot; title=&quot;Ban implicit capture of `this` via `[=]` in lambda expressions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60173&quot;&gt;&lt;del&gt;SERVER-60173&lt;/del&gt;&lt;/a&gt; Ban implicit capture of `this` via `&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;#93;&lt;/span&gt;` in lambda expressions&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/02bf3f55f88874bf397b42758c9cd36093633f9e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/02bf3f55f88874bf397b42758c9cd36093633f9e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5375295" author="billy.donahue" created="Tue, 25 Apr 2023 20:59:51 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alexander.neben%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;alexander.neben@mongodb.com&quot;&gt;alexander.neben@mongodb.com&lt;/a&gt; for the updated description. I went ahead and made the title equally specific. &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="5372226" author="billy.donahue" created="Mon, 24 Apr 2023 21:35:19 +0000"  >&lt;p&gt;The ticket is underspecified and has no description.&lt;/p&gt;

&lt;p&gt;I&apos;m not entirely sure what it&apos;s proposing, but a reading at face value implies that it&apos;s proposing a ban of all &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;#93;&lt;/span&gt;&lt;/tt&gt; captures, which are implicit in that they rely on that default capture spec.&lt;/p&gt;

&lt;p&gt;But these are perfectly valid before and after C++20, and will be valid forever, presumably (per my previous comment).&lt;/p&gt;

&lt;p&gt;I think you&apos;re thinking of the implicit capture of &lt;tt&gt;*this&lt;/tt&gt; (as a reference) when there&apos;s a default capture spec of &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;#93;&lt;/span&gt;&lt;/tt&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://en.cppreference.com/w/cpp/language/lambda#Lambda_capture&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://en.cppreference.com/w/cpp/language/lambda#Lambda_capture&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;The current object &lt;tt&gt;(*this)&lt;/tt&gt; can be implicitly captured if either capture default is present. If implicitly captured, it is always captured by reference, even if the capture default is &lt;tt&gt;=&lt;/tt&gt;. The implicit capture of &lt;tt&gt;*this&lt;/tt&gt; when the capture default is &lt;tt&gt;=&lt;/tt&gt; is deprecated. (since C++20)&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;That&apos;s what we should be sweeping for, but this ticket doesn&apos;t say so explicitly and doesn&apos;t mention the &lt;tt&gt;*this&lt;/tt&gt; reference at all. So maybe it needs an updated description with details on what it&apos;s talking about so that we don&apos;t end up trying to enforce a ban on good code by accident.&lt;/p&gt;</comment>
                            <comment id="5056213" author="JIRAUSER1268551" created="Wed, 14 Dec 2022 23:33:35 +0000"  >&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; the context here is that it is banned by default in c++20. This would be primitively fixing the problem.&lt;/p&gt;</comment>
                            <comment id="4081099" author="billy.donahue" created="Thu, 23 Sep 2021 16:37:44 +0000"  >&lt;p&gt;-1: I think banning &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;#93;&lt;/span&gt;&lt;/tt&gt; is interfering with a valid programmer choice. I think we should be expected to apply good judgment in deciding which kind of capture to use. I don&apos;t use it often but I know where it&apos;s appropriate to lambda capture by-value and when it isn&apos;t. In a short lambda capturing a few variables and it all fits on a few lines, I don&apos;t see any risk. Retyping the variable names (especially if they are long names) just to bind them will obscure otherwise elegant and concise expressions. I would not want to uglify lambdas that are obvious and safe simply to satisfy a linter.&lt;/p&gt;

&lt;p&gt;It&apos;s also slightly more unfriendly to maintenance to have explicit captures. Instead of simply mentioning a variable in the lambda body, you have to mention it and add it to the capture list unnecessarily. Lambdas are meant to be usable as &quot;1-liners&quot;, and &lt;tt&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;=&amp;#93;&lt;/span&gt;&lt;/tt&gt; supports that notion. Removing it from the toolbox would be downgrade.&lt;/p&gt;

&lt;p&gt;I have heard the statement that &quot;explicit is better than implicit&quot; repeated a lot over the years, and it&apos;s not a true statement.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1880979">SERVER-60151</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1880979">SERVER-60151</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25130"><![CDATA[Server Development Platform]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 23 Sep 2021 16:37:44 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        37 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-3140</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            37 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>157.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alex.neben@mongodb.com</customfieldvalue>
            <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>billy.donahue@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>juan.gu@mongodb.com</customfieldvalue>
            <customfieldvalue>Xgen-BuildBaron-User</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i02wvz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr1r4s:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i02j1b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>