I've spent most of today upgrading the code for my game to replace my arrays and char* strings with STL containers and strings.
While I was at it I started thinking about my old-style C macros. Where I use to have:
I now use:Code:#define SafeRelease(DirectXptr) {if(DirectXptr) {DirectXptr->Release(); DirectXptr=0;}}
It's the kind of feeling when I first moved from VB to C++ for writing games. Like I was doing something "naughty" before....Code:template<typename _T> inline void SafeRelease(_T T) { T->Release(); T=0; }