|
Boost : |
From: brianjparker_at_[hidden]
Date: 2001-10-20 01:53:53
Hi Boosters,
I have just uploaded in file "boost_ext_20_10_2001.zip" a few classes
and functions which I have found useful and which don't appear to
have equivalents in the Boost library. They are fully documented (see
index.htm) but here is a brief overview-
alignment_traits class which is used to align stack-based or static
memory
stack_allocator: a fast allocator adaptor for small contiguous-memory
(vector-like) data structures. It stores the initial allocation in a
stack-based per-object buffer and so avoids the overhead of dynamic
memory allocation for small vectors or strings.
hinted_node_allocator: this allocator is optimized for allocating
large numbers of small fixed-sized nodes and so is ideal for node-
based data structures such as std::list, slist, boost::f_heap
valunion: a discriminated union class- this type is essentially a
wrapper for the low-level C "union" compound type.
tuple: my version of the ubiquitous tuple abstraction. This is
superceded by boost::tuple but I have posted it here anyway as it
demonstrates some interesting features, esp. named members, that may
be worth adding to boost::tuple.
convert_traits: essentially a limited form of typeof() that is useful
for implementing conversions in the common case of template functions
that assume a simple signature of TxT->T
compact(): frees unused reserved memory from std::vector and
std::string.
min() and max(): these are distinguished from the std::min and
std::max as the lhs and rhs can be different, convertible types
to_string(): A simple function to convert any type to its string
representation. Its functionality is subsumed by boost::lexical_cast,
but I think this function would still be useful as a simpler synonym
for lexical_cast.
ct_dispatch: This is simply a compile-time integral dispatch class
based on the int2type<> class in Andrei Alexandrescu. CUJ Sept 2000
and the "dummy" class in Austern "Generic programming and the STL".
pd_debug.hpp: a platform independent debug library. The main
advantage is that it can output debug and performance messages in a
release build
f_heap.hpp: various bug fixes and interface changes to the Boost
Fibonacci heap class
Most of these could be just added to existing boost headers if found
to be useful- I have indicated the most suitable headers in
index.html.
Cheers,
Brian Parker
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk