Re: Unhandled exception - How to turn off!
You can't separate the standardlibrary from the language, they are already
linked e.g. via typeid() which yields a std::type_info. Also, they are
both
defined by the same standard, i.e. the stuff in namespace std isn't in any
way optional, at least not as far as C++ is concerned. If you are using a
not in Microsoft C++. The typeid operator documentation page makes
absolutely no mention of namespace std.
subset and modifying other things to suit your needs you are not
programming in C++ anymore. This might not matter to you, but a library
that relies on C++ features could break when used in your environment.
Not any well-designed library. Even portions of the standard library, which
you'd think could rely on the standard library being available and used, use
templated allocators to prevent such breakage.
In any case, linking with a certain library should not change the
behaviour
of existing code.
Absolutely it should. As long as the new library meets the interface
specification, everything is perfect. This is needed by a whole slew of
memory allocators (garbage collectors, electric fence, etc) to name just one
example.
Luckily, that's only the default implementation of new, and
std::bad_alloc doesn't actually have a privileged place -- you can easily
redefine new to use your own exception type, or none at all -- and this
is
important -- using the same mechanism by which the default new is
provided.
Why not simply use the existing 'new (nothrow)'? It exists and works, your
code remains standard C++ and it doesn't break other code! I'm sorry for
you if you lived under the assumption that new returned zero in case of
failure and have to change lots of code now, but this is not the fault of
the language or its implementation.
You've mistaken me for the OP I think.
But in any case, I choose to use parts of the standard library because they
work well and are widely available. I don't want the compiler forcing me
into a particular implementation. If the typeid keyword is inextricably
tied to a type_info type, then make that a builtin type just like int (or
wchar_t), don't call it part of a library. String literals don't return a
std::string. They return arrays of char or wchar_t (which is why wchar_t
needs to be part of the language, not part of a library).