Home | Libraries | People | FAQ | More |
The library includes a couple of predefined objects for generating booleans, signed and unsigned integers, and real numbers. These generators are fully parametric. Most of the important aspects of numeric generation can be finely adjusted to suit. This includes the radix base, the exponent, the fraction etc. Policies control the real number generators' behavior. There are some predefined policies covering the most common real number formats but the user can supply her own when needed.
The numeric parsers are fine tuned (employing loop unrolling and extensive
template metaprogramming) with exceptional performance that rivals the
low level C functions such as ltoa
,
ssprintf
, and _gcvt
. Benchmarks reveal up to 2X speed
over the C counterparts (see here: Performance
of Numeric Generators). This goes to show that you can write extremely
tight generic C++ code that rivals, if not surpasses C.
// forwards to <boost/spirit/home/karma/numeric.hpp> #include <boost/spirit/include/karma_numeric.hpp>
Also, see Include Structure.