|
Boost : |
From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-06-07 06:32:27
On Sat, 7 Jun 2003 10:33:20 +0100, "Paul A Bristow"
<boost_at_[hidden]> wrote:
>None of the material is yet ready for inclusion in Boost,
>(with the possible exception of the C Macro values).
>
>What I would like to get is agreement on the presentation of constants.
You mean macros vs. constant variables vs. inline functions? This is
another thing I didn't understand by looking at the documentation: the
FAQ section seems sometimes to imply you have already done a choice in
this regard; for instance:
Q. Why not use floating-point hardware constants?
A. Because only a few are available, they are often not the right
size, are not available on all processors, and most important
are sometimes not accurate enough.
but then, in another point:
Q. Why are functions like double pi() which return constants
provided?
A. It provides a framework whereby users can plug in special
implementation and hardware-specific versions
Before that, there's even another answer:
"Because some compilers may be able to produce smaller and/or faster
code.(For example, note that MSVC 7 Standard edition only inlines
"__inline", so this will produce slower and longer code)."
Maybe you meant: "because some compilers generate better code with a
manifest constant and others better code with a function"? I agree
with Daniel that the material need some cleanups if you want us to
understand it.
Genny.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk