<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 12, 2015, at 1:26 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: LucidaGrande; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div 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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Fri, Jan 9, 2015 at 3:56 PM, Marshall Clow<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:mclow.lists@gmail.com" target="_blank" class="">mclow.lists@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><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;" class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jan 9, 2015, at 12:17 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">On Fri, Jan 9, 2015 at 11:35 AM, Marshall Clow<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:mclow.lists@gmail.com" target="_blank" class="">mclow.lists@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><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;" class=""><span class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 9, 2015, at 9:06 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jan 7, 2015 at 12:31 PM, Marshall Clow<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:mclow.lists@gmail.com" target="_blank" class="">mclow.lists@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><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;">Author: marshall<br class="">Date: Wed Jan  7 14:31:06 2015<br class="">New Revision: 225375<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=225375&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=225375&view=rev</a><br class="">Log:<br class="">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 class=""></blockquote><div class=""><br class="">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 class=""></div></span><div class="">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" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""></div></div></div></div></blockquote><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div></div></div></div></blockquote><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""></div></div></div></div></blockquote></span><span class=""><blockquote type="cite" class=""><div dir="ltr" class=""><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;" class=""><div class="">Other than that, no.</div><div class=""><br class=""></div><div class="">binary_function is an empty struct with three nested typedefs:</div><div class=""><br class=""></div><div class=""><div class="">template <class Arg1, class Arg2, class Result></div><div class="">struct binary_function</div><div class="">{</div><div class="">   <span class="Apple-converted-space"> </span>typedef Arg1   first_argument_type;</div><div class="">   <span class="Apple-converted-space"> </span>typedef Arg2   second_argument_type;</div><div class="">   <span class="Apple-converted-space"> </span>typedef Result result_type;</div><div class="">};</div><div class=""><br class=""></div><div class="">The tests (now) check for the existence (and correctness) of first_argument_type, second_argument_type and result_type.</div><span class=""><font color="#888888" class=""><div class=""><br class=""></div></font></span></div></div></blockquote></div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">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 class=""></span></div><div class="">Yes, but when C++03 and C++11 differ, libc++ has consistently chosen the C++11 implementation.</div></div></blockquote><div class=""><br class="">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 class=""></div></div></div></blockquote><div><br class=""></div>No, the C++03 implementation is a conforming C++11 implementation, _and_ the implementation in libc++ is unchanged.</div><div>[ and is a conforming C++03 implementation ]</div><div><br class=""></div><div>The inheritance is still there in the code.</div><div><br class=""></div><div>However, this may change in the future, because the current draft of the C++17 standard actually *removes* unary<span style="font-family: LucidaGrande;" class="">_function and </span><span style="font-family: LucidaGrande;" class="">binary_function.</span></div><div><span style="font-family: LucidaGrande;" class="">Hrm.</span></div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div 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; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="">In any case, I think maybe I'm being unclear:<br class=""><br class="">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?</div></div></div></blockquote></div><div><br class=""></div>We could add C++03 specific tests, I suppose. <div class=""><br class=""></div><div class="">— Marshall</div><div class=""><br class=""><div class=""><div class=""><br class=""></div><div class=""><br class=""></div></div></div></body></html>