Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 917 Bytes

compiler-error-c2323.md

File metadata and controls

31 lines (24 loc) · 917 Bytes
titledescriptionms.datef1_keywordshelpviewer_keywords
Compiler Error C2323
Learn more about: Compiler Error C2323
03/20/2024
C2323
C2323

Compiler Error C2323

'identifier': non-member operator new or delete functions may not be declared static or in a namespace other than the global namespace.

The new and delete overload operators must be non-static, defined in the global namespace or as class members.

The following generates C2323:

// C2323.cpp// compile with: /cstaticvoid* operatornew(size_t); // C2323 since staticstaticvoidoperatordelete(void*); // C2323 since staticnamespaceNS { void* operatornew(size_t); // C2323 since not defined in the global namespacevoidoperatordelete(void*); // C2323 since not defined in the global namespace }

See also

new and delete operators

close