...
Some standard library vendors, such as GCC's libstdc++, throw a std::logic_error when a null pointer is used in these function calls. However, it is std::logic_error is not a requirement of the C++ Standard, and not all some vendors (LLVM's libc++ and the Microsoft Visual Studio STL, for example) do not implement this behavior. For portability, you should not rely on this behavior.
...