Skip to main content
just added a std:: the user who wrote this answer forgot.
Source Link

Overloading new and delete operators

class my_class { public: // ... void* operator new(std::size_t); void operator delete(void*); void* operator new[](std::size_t); void operator delete[](void*); // ...  }; 

Overloading new and delete

class my_class { public: // ... void* operator new(std::size_t); void operator delete(void*); void* operator new[](size_t); void operator delete[](void*); // ... }; 

Overloading new and delete operators

class my_class { public: // ... void* operator new(std::size_t); void operator delete(void*); void* operator new[](std::size_t); void operator delete[](void*); // ...  }; 
syntax
Source Link
anatolyg
  • 28.5k
  • 9
  • 66
  • 149
class my_class { public: // ... void* operator new(std::size_t); void operator delete(void*,std::size_t); void* operator new[](size_t); void operator delete[](void*,std::size_t); // ... }; 
class my_class { public: // ... void* operator new(); void operator delete(void*,std::size_t); void* operator new[](size_t); void operator delete[](void*,std::size_t); // ... }; 
class my_class { public: // ... void* operator new(std::size_t); void operator delete(void*); void* operator new[](size_t); void operator delete[](void*); // ... }; 
Commonmark migration
Source Link

#Overloading new and delete#

Overloading new and delete

##Basics##

Basics

Placement new

##Placement new## C++C++ allows new and delete operators to take additional arguments.
So-called placement new allows you to create an object at a certain address which is passed to:

##Class-specific new and delete##

Class-specific new and delete

##Global new and delete##

Global new and delete

#Overloading new and delete#

##Basics##

##Placement new## C++ allows new and delete operators to take additional arguments.
So-called placement new allows you to create an object at a certain address which is passed to:

##Class-specific new and delete##

##Global new and delete##

Overloading new and delete

Basics

Placement new

C++ allows new and delete operators to take additional arguments.
So-called placement new allows you to create an object at a certain address which is passed to:

Class-specific new and delete

Global new and delete

deleted 3 characters in body
Source Link
Aganju
  • 6.4k
  • 1
  • 15
  • 25
Loading
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot
Loading
deleted 36 characters in body
Source Link
sbi
  • 225k
  • 46
  • 267
  • 447
Loading
added 6 characters in body
Source Link
sbi
  • 225k
  • 46
  • 267
  • 447
Loading
added 67 characters in body
Source Link
sbi
  • 225k
  • 46
  • 267
  • 447
Loading
added 97 characters in body
Source Link
sbi
  • 225k
  • 46
  • 267
  • 447
Loading
added 487 characters in body
Source Link
sbi
  • 225k
  • 46
  • 267
  • 447
Loading
added 55 characters in body
Source Link
sbi
  • 225k
  • 46
  • 267
  • 447
Loading
Source Link
sbi
  • 225k
  • 46
  • 267
  • 447
Loading