| 1 |
/* Copyright (C) 2015 Povilas Kanapickas <[email protected]> |
| 2 |
|
| 3 |
This file is part of cppreference-doc |
| 4 |
|
| 5 |
This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 |
| 6 |
Unported License. To view a copy of this license, visit |
| 7 |
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative |
| 8 |
Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. |
| 9 |
|
| 10 |
Permission is granted to copy, distribute and/or modify this document |
| 11 |
under the terms of the GNU Free Documentation License, Version 1.3 or |
| 12 |
any later version published by the Free Software Foundation; with no |
| 13 |
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. |
| 14 |
*/ |
| 15 |
|
| 16 |
#ifndef CPPREFERENCE_NEW_H |
| 17 |
#define CPPREFERENCE_NEW_H |
| 18 |
|
| 19 |
namespace std { |
| 20 |
|
| 21 |
/* SIMPLIFIED: these are implicitly declared even if <new> is not included. |
| 22 |
No point in declaring them |
| 23 |
void* operator new ( std::size_t count ); |
| 24 |
void* operator new[]( std::size_t count ); |
| 25 |
void* operator new ( std::size_t count, const std::nothrow_t& tag); |
| 26 |
void* operator new[]( std::size_t count, const std::nothrow_t& tag); |
| 27 |
|
| 28 |
void* operator new ( std::size_t count, void* ptr ); |
| 29 |
void* operator new[]( std::size_t count, void* ptr ); |
| 30 |
void* operator new ( std::size_t count, user-defined-args... ); |
| 31 |
void* operator new[]( std::size_t count, user-defined-args... ); |
| 32 |
|
| 33 |
void* T::operator new ( std::size_t count ); |
| 34 |
void* T::operator new[]( std::size_t count ); |
| 35 |
void* T::operator new ( std::size_t count, user-defined-args... ); |
| 36 |
void* T::operator new[]( std::size_t count, user-defined-args... ); |
| 37 |
|
| 38 |
void operator delete ( void* ptr ); |
| 39 |
void operator delete[]( void* ptr ); |
| 40 |
void operator delete ( void* ptr, const std::nothrow_t& tag ); |
| 41 |
void operator delete[]( void* ptr, const std::nothrow_t& tag ); |
| 42 |
|
| 43 |
#if CPPREFERENCE_STDVER>= 2014 |
| 44 |
void operator delete ( void* ptr, std::size_t sz ); |
| 45 |
void operator delete[]( void* ptr, std::size_t sz ); |
| 46 |
#endif |
| 47 |
|
| 48 |
void operator delete ( void* ptr, void* place ); |
| 49 |
void operator delete[]( void* ptr, void* place ); |
| 50 |
void operator delete ( void* ptr, user-defined-args... ); |
| 51 |
void operator delete[]( void* ptr, user-defined-args... ); |
| 52 |
|
| 53 |
void T::operator delete ( void* ptr ); |
| 54 |
void T::operator delete[]( void* ptr ); |
| 55 |
void T::operator delete ( void* ptr, std::size_t sz ); |
| 56 |
void T::operator delete[]( void* ptr, std::size_t sz ); |
| 57 |
void T::operator delete ( void* ptr, user-defined-args... ); |
| 58 |
void T::operator delete[]( void* ptr, user-defined-args... ); |
| 59 |
*/ |
| 60 |
|
| 61 |
typedef void (*new_handler)(); |
| 62 |
|
| 63 |
#if CPPREFERENCE_STDVER>= 2011 |
| 64 |
std::new_handler get_new_handler(); |
| 65 |
#endif |
| 66 |
std::new_handler set_new_handler(std::new_handler new_p); |
| 67 |
|
| 68 |
class bad_alloc : public std::exception { |
| 69 |
public: |
| 70 |
bad_alloc(); |
| 71 |
bad_alloc& operator=(const bad_alloc& other); |
| 72 |
virtual const char* what() const; |
| 73 |
}; |
| 74 |
|
| 75 |
#if CPPREFERENCE_STDVER>= 2011 |
| 76 |
class bad_array_new_length : public bad_alloc { |
| 77 |
public: |
| 78 |
bad_array_new_length(); |
| 79 |
}; |
| 80 |
#endif |
| 81 |
|
| 82 |
struct nothrow_t {}; |
| 83 |
extern const std::nothrow_t nothrow; |
| 84 |
|
| 85 |
|
| 86 |
} // namespace std |
| 87 |
|
| 88 |
#endif // CPPREFERENCE_NEW_H |