Boost logo

Boost :

From: helmut.zeisel_at_[hidden]
Date: 2001-08-24 14:35:12


--- In boost_at_y..., scleary_at_j... wrote:
> > > Having said that, I must also say that I personally think
conversion
> > > functions are evil; they always allow users to hurt themselves.
> Providing a
> > > conversion to bool and hiding the other conversions will
probably make
> code
> > > such as this ambiguous (it will if your "BigInt" has an implicit
> conversion
> > > from int's):
> > > BigInt a;
> > > int b;
> > > a + b; // operator+(a, BigInt(b)) or bool(a) + b ?
> >
> > Fortunately this is no problem.
> > Thanks to operator.hpp (again)
> > I have an explicit overload for operator+(const BigInt&, int)
> > and all other related operators.
>
> That would work on a bounded set of types. But how would it react
to
> __int64? Or __int128 on next year's compilers?
>

Hopefully the set of built-in types will
always be finite.
OTOH, you are right,
it is not very elegant to be forced
to overload the operators for all built-in types.

Helmut


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk