Hi Jerry, On Tuesday 31 August 2004 19:55, Jerry Feldman wrote:
This is very true in context, but C++ is significantly more difficult to optimize. Reference types, const, and inline member functions certainly have an advantage, but many commercial C compilers inline many common library functions, such as strlen, strcpy, etc. I think this is true for free C compilers also!
Years ago, I used to avoid subscripts like the plague and use pointers for performance. Today, I use and teach the use of subscripts because subscripts allow better optimization than pointers. (And they improve readability). I came to realise this last year also! I was shocked.
Compiler writers tend to be much smarter than other programmers as they will constantly remind you. That was until Intel bought out KAI and then killed of their excellent optimising C++ compiler!
Michael