"William Deegan" <bd******@hotmail.com> wrote in message
news:HE*******************@newssvr25.news.prodigy. com...
Greetings,
Anyone have a string class which will allow me to keep track of:
* average string length
* total memory allocated for strings
* # of strings of each given length?
You can wrap a std::string in a custom type which
implements static members to do this.
static std::string::size_type avg_len;
static std::size_t tot_capacity;
static std::map<std::string::size_type, std::size_t> histo;
Then you'll need to keep all these in sync when implementing
constructors, destructor, and all the desired operators
(these could delegate to those of std::string)
-Mike