My String class provides an operator char* overload to allow you to pass the string to C functions.
Unfortunately a colleague of mine just inadvertently discovered a bug.
He effectively had the following code.
StringT str;
// Some code.
delete str;
Is there anyway to prevent delete from casting the string object to a char* to prevent future bugs like this cropping up? std::string gets round this problem by not providing a char operator overload but, ideally, I'd like to keep the overload but prevent that delete from working.