Forgive what might seem to some to be a very simple question, but I have this use case in mind:
struct fraction {
fraction( size_t num, size_t denom ) :
numerator( num ), denominator( denom )
{};
size_t numerator;
size_t denominator;
};
What I would like to do is use statements like:
fraction f(3,5);
...
double v = f;
to have v
now hold the value represented by my fraction.
How would I do this in C++?