|
Boost : |
From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-06-10 16:32:14
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Daniel Frey
| Sent: Tuesday, June 10, 2003 4:51 PM
| To: boost_at_[hidden]
| Subject: [boost] Re: Math Constants Formal Review
|
|
| > [3] Physics-based constants should be definable within the constants
| > framework and should be set to their current accuracy (possibly making
| > use of intervals).
|
| Maybe we could provide some defaults that can be overwritten by the
| user? Something like:
|
| --- header physics_constant_values.hpp
|
| template< typename T > struct g_default_value;
| template<> struct g_default_value< double >
| { double operator()() const { return 9.81; };
|
| template< typename T > g_value : g_default_value< T > {};
|
| --- header physics_constants.hpp
|
| #include <boost/physics_constant_values.hpp>
| struct g_t : constant< g_t, g_value > {} g;
|
| --- user adds to his project-header physics_constants.h:
|
| #include <boost/physics_constant_values.hpp>
| template<> struct g_value< double >
| { double operator()() const { 9.81424242424; } }; // Ha, I know better!
| #include <boost/physics_constants.hpp>
No objections to this but I really would like to follow the conclusion of the
previous review that we should concentrate on math constants FIRST - getting
agreement on them seems to be plenty difficult enough!
Paul
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk