scoped_array P82
scoped_array 类似scoped_ptr,封装了new[]操作符,为动态数组提供了一个代理
scoped_array<int> sa(new int[100]);
sa[0] = 10;
*(sa+1) = 20;
除非对性能有非常苛刻的要求,或者编译器不支持标准库,否则不建议使用scoped_array.
scoped_array 类似scoped_ptr,封装了new[]操作符,为动态数组提供了一个代理
scoped_array<int> sa(new int[100]);
sa[0] = 10;
*(sa+1) = 20;
除非对性能有非常苛刻的要求,或者编译器不支持标准库,否则不建议使用scoped_array.