#include #include #include #include int const n = 8 * 1024 * 1024; int main() { std::vector< boost::shared_ptr > v; boost::shared_ptr pi(new int); std::clock_t t = std::clock(); for(int i = 0; i < n; ++i) { v.push_back(pi); } t = std::clock() - t; std::cout << static_cast(t) / CLOCKS_PER_SEC << '\n'; }