4 ms·
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
by aminuit 17y ago
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? :-)
- jacquesm 17y agoNo, 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.
- fauigerzigerk 17y agoThat'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 :)