Boost C++ Libraries: Ticket #5271: is_convertible with 16-byte aligned types causes errors on MSVC https://svn.boost.org/trac10/ticket/5271 <p> This appears to be caused by passing those types by value to functions, as is done by "...". MSVC doesn't allow types with alignment higher than that of the stack to be passed by value to functions. </p> <p> The fix would involve forcing everything to be references somehow. </p> <p> Testcase: </p> <pre class="wiki">#include &lt;boost/type_traits/is_convertible.hpp&gt; struct A { __declspec(align(16)) int value; }; struct B { }; typedef boost::is_convertible&lt;A, B&gt;::type C; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5271 Trac 1.4.3 Mathias Gaunard Mon, 07 Mar 2011 13:51:22 GMT <link>https://svn.boost.org/trac10/ticket/5271#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5271#comment:1</guid> <description> <p> It doesn't really seem fixable within the field of portable C++03, so I see three solutions: </p> <ul><li>use std::is_convertible or std::tr1::is_convertible if either is available </li><li>use the <code>__is_convertible_to</code> built-in on MSVC (available since 7.1) </li><li>use SFINAE extended to expressions, if available, to implement this trait without passing by value to a function </li></ul><p> Solution number 2 seems to be the easiest one for a quick fix, and the one most MSVC versions will be able to benefit from. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 10 Mar 2011 16:52:42 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5271#comment:2 https://svn.boost.org/trac10/ticket/5271#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/69822" title="Change is_convertible to use C++0x behaviour where possible. Change ...">[69822]</a>) Change is_convertible to use C++0x behaviour where possible. Change is_converible to use MSVC <span class="underline">is_convertible intrinsic. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5271" title="#5271: Bugs: is_convertible with 16-byte aligned types causes errors on MSVC (closed: fixed)">#5271</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4530" title="#4530: Bugs: errors with is_convertible on msvc10 (closed: fixed)">#4530</a>. </span></p> Ticket