Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-10-24 14:45:04

From: "Ed Brey" <edbrey_at_[hidden]>
> From: "Peter Dimov" <pdimov_at_[hidden]>
> > namespace math
> > {
> > float const pi_f = ...;
> > double const pi = ...;
> > long double const pi_l = ...;
> > }
> I like this. The only disadvantage is that someone using, say floats,
> get access to unqualified, minimally named constants with a simple using
> statement. However, if we can assume use of anything besides double is
> rare, this is OK.

Actually I expect this to be a feature. You can't get access to minimally
named literals when using floats, so for consistency I'd prefer to see the
_f suffix on the math constants as well.

But this is subjective.

> Yes, to the non-generic part of the problem. It is still desirable to
have a
> generic interface, but it is allowed to be completely different.
> This would be in addition to the math::pi interface.

And can be added later, if deemed necessary.

It's always better to provide less and add later, than to provide more and
then find ourselves unable to take some portions away.

BTW this applies to boost::semaphore as well. Now is the right time to take
it away since nobody uses it yet. :-)

Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at, gregod at, cpdaniel at, john at