Allocation functions are always ``++static++``. Explicitly declaring such a function ``++static++`` needlessly clutters the code.


== Noncompliant Code Example

----
struct S {
  static void* operator new(std::size_t); // Noncompliant; static is redundant
  static void  operator delete(void*);    // Noncompliant; static is redundant
};
----


== Compliant Solution

----
struct S {
  void* operator new(std::size_t);
  void  operator delete(void*);
};
----


== See

* Reference: Since {cpp}98 (ISO IEC 14882 1998) 12.5 §1 and §6
____
Any allocation function for a class T is a static member (even if not explicitly declared static).

____
____
Any deallocation function for a class X is a static member (even if not explicitly declared static). 

____


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
