|
Boost : |
From: Beman Dawes (beman_at_[hidden])
Date: 1999-11-18 21:06:46
Howard Hinnant and Greg Colvin have suggested we include Nathan
Myer's empty base optimization in boost/utility.hpp. Seems quite
useful to me, too.
If you are not familiar with this optimization, check out
http://www.cantrip.org/emptyopt.html
Greg suggested sticking with Nathat's code (except for changing the
name from BaseOpt, to match Boost practice):
template <typename Base, typename Member>
struct base_opt : Base {
Member m;
base_opt(Base const& b, Member const& m)
: Base(b), m(m) {}
};
My preference would be for more descriptive names, like
"empty_base_optimization" and "member".
Anyone out there care to write some brief documentation? Nathan?
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk