Boost logo

Boost :

From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2001-04-19 12:10:46


Ralf wrote:

> - What are the reasons for including support for C in Boost?

On my first floating of these constants,
it seemed impossible to achieve agreement about packaging and names,
which is why I have gone for a lowest common denominator proposal.

> - The heavy use of macros seems very unfortunate.
> Especially, something like BOOST_UNITY looks like pretty bad
> namespace pollution to me.

An undef file is provided to remove all the pollutants after use,
as the examples demonstrate.
>
> - Naively I was expecting something like:

and you can get it thus:

> namespace boost {
> namespace math {
> namespace F {
> const float pi = static_cast<float>BOOST_PI;
> //...
> }
> namespace D {
> const double pi = static_cast<double>BOOST_PI;
> //...
> }
> namespace L {
> const long double pi = BOOST_PI;
> //...
> }
> template <typename T> // just for the idea, details might need
> work
> pi(const T&) { return boost::math::L::pi; }
> //...
> }
> }
> }
>
> - The header file math_constants.h seems to be generated by
> a the defineConstants.cpp program. Wouldn't it be possible to make
> the program also generate a real C++ header that does not contain
> any macros?

Indeed that's what I did originally - but without agreement about the names!

Paul

Dr Paul A Bristow, hetp Chromatography
Prizet Farmhouse
Kendal, Cumbria
LA8 8AB UK
+44 1539 561830
mailto:pbristow_at_[hidden]


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