File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
docs/error-messages/compiler-errors-1 Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -7,22 +7,22 @@ helpviewer_keywords: ["C2323"]
77---
88# Compiler Error C2323
99
10- 'identifier': non-member operator new or delete functions may not be declared static or in a namespace other than the global namespace
10+ 'identifier': non-member operator ` new ` or ` delete ` functions may not be declared ` static ` or in a namespace other than the global namespace.
1111
12- Overloads for the ` new ` and ` delete ` operators must be defined as non-static in the global namespace or as a class member function .
12+ The ` new ` and ` delete ` overload operators must be non-static, defined in the global namespace or as a class members .
1313
1414The following sample generates C2323:
1515
1616``` cpp
1717// C2323.cpp
1818// compile with: /c
19- static void * operator new (size_t ); // C2323
20- static void operator delete (void *); // C2323
19+ static void * operator new (size_t ); // C2323 since static
20+ static void operator delete (void *); // C2323 since static
2121
2222namespace NS
2323{
24- void* operator new(size_t); // C2323
25- void operator delete(void*); // C2323
24+ void* operator new(size_t); // C2323 since not defined in the global namespace
25+ void operator delete(void*); // C2323 since not defined in the global namespace
2626}
2727```
2828
You can’t perform that action at this time.
0 commit comments