For my money, developers are better off knowing two tools (c + some very high level language) rather than the spork which is C++.
For my money, developers are better off knowing two tools (c + some very high level language) rather than the spork which is C++.
If 'C' would have had a decent native string type I think C++ might not have happened ;)
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? :-)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.
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 :)
It is funny how everybody really seems to have their own favorite subset of C++.
I'd say the justification for all of the large languages (like C++ and Common Lisp) is the same. You may not need all of it, but the features you do need will at least be standardized, compared to using a small language with ad-hoc extensions to achieve the same.
[ I here include the standard library as part of the language, for languages with extensive meta-programming support like C++ and Common Lisp, it makes little sense to distinguish. ]