Boost logo

Boost :

From: Kevin Lynch (krlynch_at_[hidden])
Date: 2001-10-03 12:30:42


Take 2:

I've uploaded to the vault in standard_functions/std_math/ a second cut
of my attempt at a templatized function interface to the standard
library functions. Again, they've only been tested on gcc-2.96, but the
idea should be clear. Now, you've got to define
BOOST_NONCOMPLIANT_CMATH if your compiler has a noncompliant cmath
(thanks Darin!). Unfortunately, the only noncompliant compiler/library
currently supported is gcc, and since I don't have access to a compliant
compiler, there is no guarantee that it works on those. I have Fernando
Cacciola's information about Borland 5.5.1, but I haven't tried to fix
that one yet due to time constraints, but will do so tonight for
certain. There is also no documentation, unfortunately, and some of the
macro names should probably change to be less generic (such as my STD
macro to work around a gcc code generation bug). I'll try to do those
things tonight. I also haven't implemented the "default template
creation macro" that we talked about before, but that should be more or
less trivial (one hopes....).

Another plan is still to provide the c99 functions in template form ...
it should work identically to what has already been provided (copy
std_math.hpp and change the names), except for the c99 macros (isnan,
isinf, etc....). These should also be easy to provide, assuming the
platform supports them.I may or may not get around to that tonight.

The good news, at least on gcc/x86, is that if you compile with
optimizations on, all of the intermediate calls are chopped out of the
object code as one would have hoped, meaning that calling through the
templates is no less efficient than hand coding the calls directly in
assembly. Which makes me happy.

Comments and criticisms will all be addressed asap, although asap may
not be tonight :-) But send them in nonetheless. Also, information on
other platforms cmath compliance would be nice, so send that information
in if you have please! And thanks in advance.

-- 
-------------------------------------------------------------------------------
Kevin Lynch				voice:	 (617) 353-6065
Physics Department			Fax: (617) 353-6062
Boston University			office:	 PRB-565
590 Commonwealth Ave.			e-mail:	 krlynch_at_[hidden]
Boston, MA 02215 USA			http://physics.bu.edu/~krlynch
-------------------------------------------------------------------------------

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