Boost C++ Libraries: Ticket #4441: SFINAE for operator * breaking auto differentiation code https://svn.boost.org/trac10/ticket/4441 <p> A while back we had discussed adding overload resolution with SFINAE to the matrix/vector expressions involving scalars in order to implement operator*, etc. The choice was made to use is_convertible between the scalar and matrix type. </p> <p> But this ended up breaking an auto-differentiation library (CPPAD) I was using. Templated AD libraries will often have their own, arithmetic type which will record operations of the type * a double, etc. for a matrix multiplication by a scalar, etc. But you can't convert between them! </p> <p> The basic change is to change from using is_convertible to using is_arithmetic. A change to the result type is also needed for autodifferentation to work. </p> <p> See the attached patch for the change to matrix/vector expression. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4441 Trac 1.4.3 Jesse Perla <jesseperla@…> Thu, 15 Jul 2010 22:16:52 GMT attachment set https://svn.boost.org/trac10/ticket/4441 https://svn.boost.org/trac10/ticket/4441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">enable_if_sfinae.patch</span> </li> </ul> Ticket Jesse Perla <jesseperla@…> Thu, 15 Jul 2010 22:44:18 GMT attachment set https://svn.boost.org/trac10/ticket/4441 https://svn.boost.org/trac10/ticket/4441 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">enable_if_sfinae.2.patch</span> </li> </ul> Ticket Jesse Perla <jesseperla@…> Thu, 15 Jul 2010 22:44:49 GMT <link>https://svn.boost.org/trac10/ticket/4441#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4441#comment:1</guid> <description> <p> Actually, let me fix that patch... I used an older version. Use the .2. version. </p> <p> It is much simpler, just swapping out to is_arithmetic for now. If this doesn't patch properly, my apologies... I am trying to separate out a bunch of changes. </p> </description> <category>Ticket</category> </item> </channel> </rss>