|
Boost : |
From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-03-08 11:52:17
Hi everybody,
this is just to let you know that I've now committed the new version
of static_log2<> to the boost sandbox:
and a bunch of new traits to the Yahoo files section:
http://groups.yahoo.com/group/boost/files/MoreTraits.zip
Besides some templates that could IMHO be useful to improve the
portability of detail/limits.hpp (width<> and precision<>) there are
two simple knick-knacks, const_min<> and const_max, that I would like
to take the place of the analogous components in the Integer library.
Here's a complete list of the zip contents:
- const_max<>, const_min<>
Give maximum and minimum value of a built-in integral type
as integral constants. Differently from the traits already
available in Boost.Integer they don't use derivation from
std::numeric_limits.
- has_sign<>
Tells whether the type can represent negative values.
Probably useful before they clarify whether numeric_limits<T> ::
is_signed tells for built-in types the same information than this,
or just says whether T is one of the four signed types listed in
3.9.1 [to illustrate the difference: char is not a "signed integer
type"; but it can have negative values on many implementations]
BTW, there's something similar to this in detail/numeric_traits.hpp,
so it could be useful at least to refactor that code (Incidentally:
Dave, the comment there seem to reveal that intent was for it to
work for UDTs too. Of course it doesn't even work for built-in
floating points.)
- padding.hpp
Gives the number of bits of an integral type that do not contribute
to represent the value.
- promoted.hpp
Gives the promoted type for an rvalue expression of integral or
floating point type. Example:
promoted<bool>::type // -> int
promoted<char>::type // -> int or unsigned int,
// depending on the implementation
- wchar_min_max.hpp
Implementation detail to make up for broken libraries lacks.
- unit_test.cpp/.hpp
Obvious purpose.
Any comments will be greatly appreciated.
Genny.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk