#include <iostream>
#include <boost/scoped_array.hpp>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/covariance.hpp>
int main( )
{
boost::scoped_array< int > arr( new int[2] );
*arr.get( ) = 10; // arr[0] = 10;
arr[1] = 100;
std::cout << arr[0] << ", " << arr[1] << std::endl;
arr.reset( );
return 0;
}
// TOASK: 会自动释放空间吗?如果遵从RAII机制,那么,就会释放。
boost域指针(智能指针)测试
最新推荐文章于 2021-07-26 23:43:24 发布