<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 27, 2017 at 10:12 AM, Ben Craig <span dir="ltr"><<a href="mailto:ben.craig@ni.com" target="_blank">ben.craig@ni.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_-7395448833208294734WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif">Will libc++ make any policy changes regarding implementations of unreleased standards as a result of this?  </span></p></div></div></blockquote><div><br></div><div>The only policy change I can think of for this is a reminder that things in unreleased standards are subject to change.  Maybe put that on <a href="http://libcxx.llvm.org/cxx1z_status.html">http://libcxx.llvm.org/cxx1z_status.html</a> (and now <a href="http://libcxx.llvm.org/cxx2a_status.html">http://libcxx.llvm.org/cxx2a_status.html</a>)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-7395448833208294734WordSection1"><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif">Perhaps all future-standard work should go in an experimental namespace,
 or be hidden behind an ifdef of some sort?</span></p></div></div></blockquote><div><br></div><div>These were already behind an #ifdef - you had to use -std=c++1z to get them.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-7395448833208294734WordSection1"><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif"><u></u> </span><span style="font-family:Calibri,sans-serif;font-size:11pt">Or is the occasional break like this considered acceptable in the long term, so long as the breaking feature hasn’t received large adoption?</span></p></div></div></blockquote><div><br></div><div>In general, I'd like to avoid all breaking changes.</div><div><br></div><div>But I'm also uninterested in supporting things that were in a draft standard and then removed/changed before the standard became final.</div><div><br></div><div>The other alternative is to delay implementing things in libc++ until the standard is ratified.</div><div><br></div><div><br></div><div>-- Marshall</div><div>  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div class="gmail-m_-7395448833208294734WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> cfe-dev [mailto:<a href="mailto:cfe-dev-bounces@lists.llvm.org" target="_blank">cfe-dev-bounces@lists.<wbr>llvm.org</a>]
<b>On Behalf Of </b>Marshall Clow via cfe-dev<br>
<b>Sent:</b> Thursday, July 27, 2017 12:05 PM<br>
<b>To:</b> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<b>Subject:</b> [cfe-dev] Breaking change for libc++ incoming (Minor, C++17 only)<u></u><u></u></span></p>
</div>
</div><div><div class="gmail-h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">In C++17, we introduced a new variadic class called scoped_lock.<u></u><u></u></p>
<div>
<p class="MsoNormal">It took a set of mutexes, and locked them all (in the constructor) and unlocked them all (in the destructor).  It also has an option to "adopt" the locks (i.e, you can pass it already locked mutexes and it will not lock them again).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The constructors look like this (as originally defined):<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">class scoped_lock {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">...<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">    explicit scoped_lock(MutexTypes&... m);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">    scoped_lock(MutexTypes&... m, adopt_lock_t);<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">...<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">};<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">but this caused some problems with template deduction (specifically in deduction guides)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">So, at the last minute in the C++17 cycle, the committee decided to change the second constructor to take the `adopt_lock` flag AT THE START.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">class scoped_lock {<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">...<u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">    explicit scoped_lock(MutexTypes&... m);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">    scoped_lock(adopt_lock_t, <wbr>MutexTypes&... m);<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal">...<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">};<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">scoped_lock is a new feature in C++17, and so the installed base of people using it should be very small. There are no uses of it in the LLVM code base outside of the libc++ test suite.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm going to make this change to bring libc++ in conformance with the (hopefully final) standard, and people who are using the old call will have to update their code. Sorry about that.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">-- Marshall<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">P.S. Only people who are using the second constructor (the one with adopt_lock) will be affected by this change.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br></div></div>