Is it possible to introduce Automatic Reference Counting (ARC) to C++?

前端 未结 9 668
时光取名叫无心
时光取名叫无心 2021-02-04 01:54

Objective C has introduced a technology called ARC to free the developer from the burden of memory management. It sounds great, I think C++ developers would be very happy if g++

9条回答
  •  攒了一身酷
    2021-02-04 02:19

    1. There are already some implementations of similar technologies for C++; e.g., Boehm-Demers-Weiser garbage collector.
    2. C++11 has a special Application Binary Interface for anyone wishing to add her own garbage collection.
    3. In the vast majority of cases, techniques like smart pointers can do the job of painless memory management for C++ developers.

提交回复
热议问题