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

前端 未结 9 676
时光取名叫无心
时光取名叫无心 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:34

    C++ has the concept of Resource Allocation is Initialization(RAII) & intelligent use of this method saves you from explicit resource management.

    C++ already provides shared_ptr which provides reference counting.

    Also, there are a host of other Smart pointers which employ RAII to make your life easier in C++.

提交回复
热议问题