You should always avoid translation operators, as they tend to introduce ambiguity into your code, which can only be resolved using other tricks, or, even worse, compile, but not do what you expect. The char * () operator would have many problems. For example:
string s = "hello"; strcpy( s, "some more text" );
will compile without warning, but compresses the string.
There may be a variant with a constant, but since the lines should (possibly) be copied for its implementation, this will have an undesirable hidden cost. The explicit function c_str () means that you should always indicate that you are really going to use const char *.
anon
source share