关闭

Type-safe comparision between "operator new/delete" and "allocator"

238人阅读 评论(0) 收藏 举报

In general, it is more type-safe to use an allocator than using the operator new and operator delete functions directly.

Comments:

The allocate member allocate typed memory, so programs that use it  can avoid the necessity of calculating the size of memory needed.

They also can avoid casting(forced conversion) the return from operator new .

Deallocate frees memory of a specific type , again avoiding the necessity for converting  to void* . --------operator delete( void *)


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:6204次
    • 积分:159
    • 等级:
    • 排名:千里之外
    • 原创:10篇
    • 转载:1篇
    • 译文:1篇
    • 评论:0条
    文章分类
    文章存档