Garbage Collection in C++ — why?

后端 未结 16 2124
北恋
北恋 2020-11-29 18:32

I keep hearing people complaining that C++ doesn\'t have garbage collection. I also hear that the C++ Standards Committee is looking at adding it to the language. I\'m afrai

16条回答
  •  死守一世寂寞
    2020-11-29 18:47

    I, too, have doubts that C++ commitee is adding a full-fledged garbage collection to the standard.

    But I would say that the main reason for adding/having garbage collection in modern language is that there are too few good reasons against garbage collection. Since eighties there were several huge advances in the field of memory management and garbage collection and I believe there are even garbage collection strategies that could give you soft-real-time-like guarantees (like, "GC won't take more than .... in the worst case").

提交回复
热议问题