<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 9, 2015 at 3:56 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><span class=""><blockquote type="cite"><div>On Jan 9, 2015, at 12:17 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr">On Fri, Jan 9, 2015 at 11:35 AM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span><br><div><blockquote type="cite"><div>On Jan 9, 2015, at 9:06 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 7, 2015 at 12:31 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">Author: marshall<br>
Date: Wed Jan  7 14:31:06 2015<br>
New Revision: 225375<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=225375&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=225375&view=rev</a><br>
Log:<br>
In C++03, a bunch of the arithmetic/logical/comparison functors (such as add/equal_to/logical_or) were defined as deriving from binary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.<br></blockquote><div><br>Are there any tests around to ensure the C++03 behavior remains in C++03? Or is that not worth worrying about/preserving/implementing?</div></div></div></div></div></blockquote><br></div></span><div>The tests will continue to pass if the functors are derived from binary_function (which is how libc++ implements them).</div></div></blockquote></div></div></div></div></blockquote><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div></div></div></div></blockquote><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div></div></blockquote><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div></div></div></div></blockquote></span><span class=""><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Other than that, no.</div><div><br></div><div>binary_function is an empty struct with three nested typedefs:</div><div><br></div><div><div>template <class Arg1, class Arg2, class Result></div><div>struct binary_function</div><div>{</div><div>    typedef Arg1   first_argument_type;</div><div>    typedef Arg2   second_argument_type;</div><div>    typedef Result result_type;</div><div>};</div><div><br></div><div>The tests (now) check for the existence (and correctness) of first_argument_type, second_argument_type and result_type.</div><span><font color="#888888"><div><br></div></font></span></div></div></blockquote></div></div></div></blockquote><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Right, what I mean is that if/when the functors no longer derive from binary_function, the tests would continue passing - not catching a regression for C++03, yes? (libc++ would no longer be a conforming implementation of C++03?)</div></div></div></div></div></blockquote><br></span></div><div>Yes, but when C++03 and C++11 differ, libc++ has consistently chosen the C++11 implementation.</div></div></blockquote><div><br>Do they differ here, or does 11 just offer more flexibility (is the C++03 implementation a conforming C++11 implementation, or must the inheritance be removed)<br><br>In any case, I think maybe I'm being unclear:<br><br>There's no test to ensure we don't regress the C++03 required behavior, now that these tests have been generalized. It seems like that's a hole/should be fixed?<br><br>- David<br> </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"><span class="HOEnZb"><font color="#888888"><div><br></div><div>— Marshall</div><div><br></div><div><br></div></font></span></div></blockquote></div><br></div></div>