Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
全局 new 和 delete 可以像平常一样使用,但你也可以在它们前面加上 :: 运算符,它的工作原理是一样的。是否有任何其他关键字具有相同的行为?
是的,您还可以限定operator关键字,例如::operator+(a, b).
operator
::operator+(a, b)
我相信new,delete并且operator是标准 C++ 中唯一允许这样做的。
new
delete