====================================================
#include <iostream>
#include <ctime>
#include <sys/timeb.h>
#include <boost/shared_array.hpp>
using namespace std;
time_t getms()
{
}
int main()
{
本文通过测试代码分析了boost智能指针(shared_array)与原始指针在内存操作上的性能差异。结果显示,智能指针的构造较慢,大约是原始指针的20倍,而赋值和访问速度接近原始指针。在考虑编译器优化的情况下,智能指针虽然有性能成本,但其带来的内存管理便利性值得权衡。
1099

被折叠的 条评论
为什么被折叠?