<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 11, 2014 at 2:00 PM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="">On Mar 11, 2014, at 10:32 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<br>
<div><br><blockquote type="cite"><blockquote class="gmail_quote" style="font-family:LucidaGrande;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
 {<br>-private:<br>-    mutable _Iter __t;<br></blockquote><div style="font-family:LucidaGrande;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br></div><div style="font-family:LucidaGrande;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
This looks like an ABI break; is that OK?</div></blockquote><br></div></div><div>Sigh. Yes; yes, it is.</div><div>This changes the size of a reverse_iterator.</div><div><br></div><div>Thanks for catching this, Richard. Apparently I was asleep at the wheel.</div>
<div><br></div><div>I’m open to suggestions here:</div><div>a) I can put the instance variable back, and never use it. No ABI break, but an unused iterator in every reverse iterator.</div></div></blockquote><div><br></div>
<div>Any code that passes a reverse_iterator between TUs built against different libc++ versions would still not work.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>b) I can leave it the way it is, and say - yeah, it’s an ABI break. Fortunately, I suspect that very few people hvea a reverse_iterator stored in a data file somewhere.</div><div>c) Something else.. ?</div>
</div></blockquote><div><br></div><div>You could push the choice onto the user: leave it how it was in std::__1,  add a "correct" reverse_iterator in std::__2, and give people an option to pick whether they want the newest-available version or the ABI-stable version (maybe selected by a macro).</div>
<div><br></div><div>(Hopefully this will clarify what I mean:</div><div><br></div><div>#ifndef _LIBCPP_UNSTABLE_ABI</div><div>_LIBCPP_BEGIN_NAMESPACE_STD // std::__1</div><div>  // old reverse_iterator</div><div>_LIBCPP_END_NAMESPACE_STD</div>
<div>#else</div><div>_LIBCPP_BEGIN_NAMESPACE_STD_UNSTABLE // std::__2</div><div>  // new reverse_iterator</div><div>_LIBCPP_BEGIN_NAMESPACE_STD_UNSTABLE</div><div>#endif</div><div><br></div><div>... or even:</div><div><br>
</div><div>_LIBCPP_BEGIN_NAMESPACE_STD_MULTI_ABI // std::__1 or std::__2 depending on UNSTABLE_ABI macro</div><div>class reverse_iterator { //...</div><div>#ifdef _LIBCPP_UNSTABLE_ABI</div><div>private:</div><div>  mutable _Iter __t;</div>
<div>#endif</div><div>// ...</div><div>};</div><div>_LIBCPP_END_NAMESPACE_STD_MULTI_ABI</div><div><br></div><div>... with the intent that the __2 ABI is subject to change for now, but when any platform next gets to do an ABI break, we define __2 as the new stable ABI, and use __3 as the next unstable ABI).</div>
</div></div></div>