QuesHub > 函数 > 这是 > 对象 > ASK DETAIL

Can you call a destructor in C++ 2024?

Daniel Rodriguez | 2023-05-05 10:26:10 | page views:1336
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Penelope Gonzales

Studied at the University of São Paulo, Lives in São Paulo, Brazil.
Local objects are automatically destroyed by compiler when they go out of scope and this is the guarantee of C++ language. In general, special member functions shouldn't be called explicitly. Explicit call to destructor is only necessary when object is placed at particular location in memory by using placement new.
2023-05-09 10:26:10

Daniel Adams

QuesHub.com delivers expert answers and knowledge to you.
Local objects are automatically destroyed by compiler when they go out of scope and this is the guarantee of C++ language. In general, special member functions shouldn't be called explicitly. Explicit call to destructor is only necessary when object is placed at particular location in memory by using placement new.
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4