Creating a generic Numeric class in C++
<p>What is the best approach to create a generic Numeric class in C++ ? I'm thinking at an object that can contain integers, floats and doubles.</p>

<p>My first idea is to use a union that will be used in a Numeric class where you can define the allowed operations for each type. Something like:</p>

<pre><code>union mixed_number{
    int a;
    float b;
    double c;
};

class Number{
    //define operations
    ...
};
</code></pre>

<p>Please let me know if there is a better approach.</p>
