关于C++Primer 第四版的翻译问题
在我看第五部分的allocator时,看到表18-1 标准allocator类和定制算法中的:
a.deallocate(p, n)
他的翻译是:释放内存,在名为p的T*指针中包含的地址处保存T类型的n个对象,运行调用deallocate之前在该内存中构造的任意对象的destroy使用户的责任;
--------------------------------
从这看,前后是对立的,先是释放内存,后边是保存n个对象,开始时我怎么也没有看明白,后来我找到了英文原版,上边是这么说的:
Deallocates memory that held n objects of type T starting at address contained in the T* pointer named p. It is the user 's responsibility to run destroy on any objects that were constructed in this memory before calling deallocate.
----------------------------------
即使我英文再差,我也知道是:删除保存在 T*类型的指针p 处开始的n个 T类型的对象 ,在调用deallocate之前调用这段内存中的每个对象的析构函数使用户的责任。
-----------------------------------
不知道我翻译的对不对,请各位高手说明一下这个部分,如果能讲解一下allocate就最好了,谢谢
[解决办法]
以英文为准。另外,中文版的东西,先找勘误表