Why garbage collection when RAII is available?

前端 未结 7 1286
深忆病人
深忆病人 2021-02-01 14:00

I hear talks of C++14 introducing a garbage collector in the C++ standard library itself. What is the rationale behind this feature? Isn\'t this the reason that RAII exists in

相关标签:
7条回答
  • 2021-02-01 14:32

    There isn't, because there isn't one. The only features C++ ever had for GC were introduced in C++11 and they're just marking memory, there's no collector required. Nor will there be in C++14.

    There is no way in hell a collector could pass Committee, is my opinion.

    0 讨论(0)
提交回复
热议问题