<div dir="ltr">On Mon, Oct 7, 2013 at 3:53 PM, 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"><div><div class="im"><div>On Oct 7, 2013, at 1:26 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:</div>
</div><div class="im"><blockquote type="cite"><div dir="ltr">On Sun, Oct 6, 2013 at 9:37 AM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:</div>
<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">
Ref: <a href="http://cplusplus.github.io/LWG/lwg-defects.html#2141" target="_blank">http://cplusplus.github.io/LWG/lwg-defects.html#2141</a><br>
<br>
Fix common_type to match the suggested implementation in the standard.<br>
Add tests to make sure it (now) does what it should.<br>
<br>
Also, a drive by fix on the tests for is_trivially_copyable. Clang recently fixed a bug in the intrinsic that libc++ uses for this type_trait, and this exposed an error in the test suite.<br>
<br>
Note that most of the change in <type_traits> is from hoisting the definition of std::decay from the end of the file to somewhere closer to the front.<br>
That's just a movement of source code - there are no changes to decay.<br></blockquote></div></div></blockquote><div><blockquote type="cite"><br></blockquote></div><blockquote type="cite"><div class="gmail_extra"><div dir="ltr">
You don't seem to have any test coverage outside C++1y mode. Could you move the tests out of the _LIBCPP_STD_VER > 11 block and switch them from common_type_t to common_type<...>::type ?</div></div></blockquote>
<br></div></div><div><br></div><div>Was this what you had in mind?</div></div></blockquote><div><br></div><div>Yep =) Thanks!</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><div>Index: test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp</div><div>===================================================================</div><div>--- test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp<span style="white-space:pre-wrap"> </span>(revision 192102)</div>
<div>+++ test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp<span style="white-space:pre-wrap">  </span>(working copy)</div><div>@@ -18,10 +18,24 @@</div><div>     static_assert((std::is_same<std::common_type<int>::type, int>::value), "");</div>
<div>     static_assert((std::is_same<std::common_type<char>::type, char>::value), "");</div><div> #if _LIBCPP_STD_VER > 11</div><div>-    static_assert((std::is_same<std::common_type_t<int>, int>::value), "");</div>
<div>+    static_assert((std::is_same<std::common_type_t<int>,   int>::value), "");</div><div>     static_assert((std::is_same<std::common_type_t<char>, char>::value), "");</div>
<div> #endif</div><div> </div><div>+    static_assert((std::is_same<std::common_type<               int>::type, int>::value), "");</div><div>+    static_assert((std::is_same<std::common_type<const          int>::type, int>::value), "");</div>
<div>+    static_assert((std::is_same<std::common_type<      volatile int>::type, int>::value), "");</div><div>+    static_assert((std::is_same<std::common_type<const volatile int>::type, int>::value), "");</div>
<div>+</div><div>+    static_assert((std::is_same<std::common_type<int,           int>::type, int>::value), "");</div><div>+    static_assert((std::is_same<std::common_type<int,     const int>::type, int>::value), "");</div>
<div>+    </div><div>+    static_assert((std::is_same<std::common_type<long,       const int>::type, long>::value), "");</div><div>+    static_assert((std::is_same<std::common_type<const long,       int>::type, long>::value), "");</div>
<div>+    static_assert((std::is_same<std::common_type<long,    volatile int>::type, long>::value), "");</div><div>+    static_assert((std::is_same<std::common_type<volatile long,    int>::type, long>::value), "");</div>
<div>+    static_assert((std::is_same<std::common_type<const long, const int>::type, long>::value), "");</div><div>+</div><div>     static_assert((std::is_same<std::common_type<double, char>::type, double>::value), "");</div>
<div>     static_assert((std::is_same<std::common_type<short, char>::type, int>::value), "");</div><div> #if _LIBCPP_STD_VER > 11</div></div><div class="im"><div><br></div><div>-- Marshall</div><div>
<span style="border-collapse:separate;border-spacing:0px"><br>Marshall Clow     Idio Software   <<a href="mailto:mclow.lists@gmail.com" target="_blank">mailto:mclow.lists@gmail.com</a>><br><br>A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).<br>
        -- Yu Suzuki</span>

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