Boost C++ Libraries: Ticket #5369: quaternion/octonion pow() not working https://svn.boost.org/trac10/ticket/5369 <p> The pow() functions for quaternions/octonions do not work as they call quaternion&lt;T&gt;(1) instead of quaternion&lt;T&gt;(T(1)). </p> <p> The attached patches fixes this. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5369 Trac 1.4.3 Eduardo de Mattos Kalinowski <eduardo@…> Thu, 24 Mar 2011 14:22:19 GMT attachment set https://svn.boost.org/trac10/ticket/5369 https://svn.boost.org/trac10/ticket/5369 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">quat.patch</span> </li> </ul> <p> Patch for quaternion.hpp </p> Ticket Eduardo de Mattos Kalinowski <eduardo@…> Thu, 24 Mar 2011 14:22:54 GMT attachment set https://svn.boost.org/trac10/ticket/5369 https://svn.boost.org/trac10/ticket/5369 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">oc.patch</span> </li> </ul> <p> Patch for octonion.hpp </p> Ticket John Maddock Thu, 24 Mar 2011 18:08:15 GMT <link>https://svn.boost.org/trac10/ticket/5369#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5369#comment:1</guid> <description> <p> Works for me - what compiler are you using, and do you have a test case please? </p> <p> Note that quaternion&lt;T&gt;(1) and quaternion&lt;T&gt;(T(1)) should be exactly equivalent as in the former case the argument will be promoted to T anyway. </p> </description> <category>Ticket</category> </item> <item> <author>Eduardo de Mattos Kalinowski <eduardo@…></author> <pubDate>Thu, 24 Mar 2011 19:06:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5369#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5369#comment:2</guid> <description> <p> g++ 4.5.2 </p> <p> For simple types it works, but if there are multiple levels of indirection, it does not. The attached example shows that. A quaternion&lt;Wrapper&lt;int&gt; &gt; works, a quaternion&lt;Wrapper&lt;Wrapper&lt;int&gt; &gt; &gt; does not. </p> <p> Of course that example is somewhat silly, but I stumbled across this in a case where I do have more than one level of indirection - and not of the same class, naturally. </p> </description> <category>Ticket</category> </item> <item> <author>Eduardo de Mattos Kalinowski <eduardo@…></author> <pubDate>Thu, 24 Mar 2011 19:07:36 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5369 https://svn.boost.org/trac10/ticket/5369 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">testpow.cpp</span> </li> </ul> <p> Test showing multiple levels of indirection </p> Ticket John Maddock Sat, 26 Mar 2011 12:04:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5369#comment:3 https://svn.boost.org/trac10/ticket/5369#comment:3 <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/70569" title="Cast arguments to quaternion/octonion constructors so they still work ...">[70569]</a>) Cast arguments to quaternion/octonion constructors so they still work when there's no implicit conversion available. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5369" title="#5369: Bugs: quaternion/octonion pow() not working (closed: fixed)">#5369</a>. </p> Ticket