Removing Virtual Inheritance
<p>I am working on an embedded project I am trying to remove a virtual number class that has + / - * implemented. removing this class saves a lot of code space so I have replaced + with the following function,</p>

<pre><code>if (BASE(h)-&gt;type() == FLOAT &amp;&amp; BASE(v)-&gt;type() == FLOAT)
{
    res = FLOAT(h)-&gt;floatValue() + FLOAT(v)-&gt;floatValue();
}
else if (BASE(h)-&gt;type() == INTEGER &amp;&amp; BASE(v)-&gt;type() == INTEGER)
{
    res = INTEGER(h)-&gt;intValue() + INTEGER(v)-&gt;intValue();
}
else if (BASE(h)-&gt;type() == INTEGER &amp;&amp; BASE(v)-&gt;type() == FLOAT)
{
    res = INTEGER(h)-&gt;floatValue() + FLOAT(v)-&gt;floatValue();
}
else 
{
    res = FLOAT(h)-&gt;floatValue() + INTEGER(v)-&gt;floatValue();
}
</code></pre>

<p>Is there a less uglier way to achieve this? cause I have to use the same scheme for other ops and comparison?</p>
