The string
part of the library was developed after streams, and nobody thought to make the obvious modifications.
It's merely out of political and temporal reality that they never got around to this before shipping C++98, and nobody bothered bringing it up again because you could always solve it with .c_str()
.
C++0x fixes this (see 27.9.1.6).
Welcome to C++.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…