[CLASSPNP] Fix MSVC build. Brought to you by Timo.
[reactos.git] / reactos / sdk / include / c++ / new
1 // Standard C++ dynamic memory management header
2
3 #ifndef _NEW
4 #define _NEW
5
6 #include <cstddef>
7 #include <exception>
8
9 extern "C++" {
10
11 class bad_alloc : public exception
12 {
13 public:
14 bad_alloc(const char *name = "bad alloc") throw()
15 : exception(name) { }
16
17 virtual ~bad_alloc() throw() { }
18 };
19
20 namespace std
21 {
22 using ::bad_alloc;
23
24 struct nothrow_t { };
25
26 extern const nothrow_t nothrow;
27 } // namespace std
28
29 typedef void (*new_handler)();
30
31 new_handler set_new_handler(new_handler) throw();
32
33 void* operator new (std::size_t size, const std::nothrow_t& nothrow_constant) throw();
34 inline void* operator new (std::size_t size, void* ptr) throw() { return ptr; }
35 void* operator new[] (std::size_t size, const std::nothrow_t& nothrow_constant) throw();
36 inline void* operator new[] (std::size_t size, void* ptr) throw() { return ptr; }
37
38 void operator delete (void* ptr) throw ();
39 void operator delete (void* ptr, const std::nothrow_t& nothrow_constant) throw();
40 inline void operator delete (void* ptr, void* voidptr2) throw() { }
41 void operator delete[] (void* ptr) throw ();
42 void operator delete[] (void* ptr, const std::nothrow_t& nothrow_constant) throw();
43 inline void operator delete[] (void* ptr, void* voidptr2) throw() { }
44
45 } // extern "C++"
46
47 #endif