|
Boost : |
From: Michael Kenniston (Msk_at_[hidden])
Date: 2001-07-10 16:09:54
At least two compilers reserve the identifier "pascal" as a keyword.
By my reading of the C++ standard this is ISO-non-compliant, and it
creates problems for any units library. Normally one could just choose
a new name for something, but the word "pascal" /is/ the internationally
standard term for the basic SI unit of pressure.
Changing the first letter to upper case ("Pascal") is not a good
solution,
because it violates a standard - [NIST SP811] par 9.1 says "When spelled
out in full, unit names are treated like ordinary English nouns. Thus
the
names of all units start with a lower-case letter, except at the
beginning
of a sentence or in capitalized material such as a title.")
Adding an underscore on the end ("pascal_") works, but it doesn't
seem fair to impose that irregularity on users of compliant compilers.
We could make it regular by adding an underscore to the end of
/every/ unit of measurement, but that's even uglier.
Would it be reasonable to add new macro
BOOST_NO_PASCAL_IDENTIFIER to config.hpp?
This would allow compliant compilers to use "pascal", and only
non-compliant users would see the irregular "pascal_".
At first this seems like an application-specific flag, but it does look
like a true compliancy failure and it could impact /any/ program
that does scientific or engineering calculations.
-- - Michael Kenniston mkenniston_at_[hidden] msk_at_[hidden] http://www.xnet.com/~msk/ [NIST SP811] National Institute of Standards and Technology, Special Publication 811, "Guide for the Use of the International System of Units (SI)". http://www.nist.gov/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk