emlabcpp
modern opinionated embedded C++ library
throw_bad_alloc.h
Go to the documentation of this file.
1 
24 #pragma once
25 
26 #include <cstdlib>
27 #include <new>
28 
29 namespace emlabcpp::pmr
30 {
31 
32 [[noreturn]] inline void throw_bad_alloc()
33 {
34  // TODO: this needs customization point /o\...
35 #ifdef __EXCEPTIONS
36  throw std::bad_alloc{};
37 #else
38  std::abort();
39 #endif
40 }
41 
42 } // namespace emlabcpp::pmr
MIT License.
Definition: aliases.h:36
void throw_bad_alloc()
Definition: throw_bad_alloc.h:32