Are you suggesting that std::string, or as my not-so-friendly c++ compiler likes to call it
std::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*,
const _Alloc&) [with _CharT = char, _Traits = std::char_traits<char>,
_Alloc = std::allocator<char>]
is an improvement? :-)No, not at all. I was thinking of strings the way Dennis Ritchie would have done it.
I can see why they chose to omit it, but in retrospect I think it was a mistake. The problem they were faced with was that the language didn't include any 'runtime' at all the way they wrote it, a string package would have made it a must to have some runtime.
Everything that is 'runtime' in C is in libraries, and everything that is 'core' is in the compiler.
Re:C++ in Coders at Work
by fauigerzigerk on Saturday October 17, 2009 @03:22AM
(#886737)
That's not what your compiler calls the string class. That's what it calls one particular constructor of the string class.
This constructor lets you customize the way the string class allocates memory. Now I would like to see the equivalent constructor in your favorite language :)
If 'C' would have had a decent native string type I think C++ might not have happened ;)