Boost C++ Libraries: Ticket #3514: enable support for complex @ int https://svn.boost.org/trac10/ticket/3514 <p> enable basic operators for mixed types: </p> <ul><li>c+i; i+c; i-c; c-i; i*c; c*i; i/c; c/i; </li></ul><p> The implementation should be roughly like </p> <pre class="wiki">template&lt;R&gt; std::complex&lt;R&gt; operator+ (int in1, const std::complex&lt;R&gt;&amp; in2 ){     return typename std::complex&lt;R&gt;::value_type(in1) + in2; } </pre><p> plus a carefully chosen enable_if to avoid "ambigous overload" errors when R is int </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3514 Trac 1.4.3 anonymous Fri, 15 Oct 2010 11:27:40 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3514#comment:1 https://svn.boost.org/trac10/ticket/3514#comment:1 <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> it's an old bug but now this is possible with ublas. </p> Ticket