Reason why not to have a DELETE macro for C++

前端 未结 12 1085
臣服心动
臣服心动 2020-11-29 07:01

Are there any good reasons (except \"macros are evil\", maybe) NOT to use the following macros ?

#define DELETE( ptr ) \\
i         


        
12条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 07:15

    Use boost::shared_ptr<> instead.

    http://www.boost.org/doc/libs/1_39_0/libs/smart_ptr/shared_ptr.htm

    The MACRO here provides some of the functionality you are probably looking for.

提交回复
热议问题