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.
我有一个需要参考的函数
void TestFunction(Class &instance);
当我调用 Test 函数时,我将 *this 传递给参数。
前任:
TestFunction(*this);
这会导致内存泄漏吗?
不,它不会泄漏。没有分配需要释放的额外内存。您只是传递对内存中已有对象的引用。