> Here is a c++ string class:
>
> Class String {

---[ snip ]---

> This code takes a lot of cpu to run, is bloat free, abstracts
> away a bunch of details the pgmr does not need to have deal
> with, does not give much chance to optimize and would make
> our as400 grind to a halt if run as frequently as efficient
> RPG pgms are run.

The example you provided was a very inefficient implementation of a C++
string class, and it's no wonder that you have performance issues !

Why allocate the internal buffer every time a copy is made ?
Why are you using strcpy() in the overloaded = operator function ?
Why are you writing your own C++ standard library ?

--phil


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.