std::bad_alloc
`std::bad_alloc` is an exception class in C++ that is thrown when a memory allocation request fails. This typically occurs when the program tries to allocate more memory than is available, either due to insufficient system resources or fragmentation. It is part of the C++ Standard Library and is included in the `<new>` header.
When a program encounters `std::bad_alloc`, it indicates that the requested memory could not be allocated, and the program can handle this exception to prevent crashes. Developers can use try-catch blocks to manage this exception and implement fallback strategies, ensuring more robust and stable applications.