Hacker News new | ask | show | jobs
by kccqzy 1479 days ago
It is a rookie mistake to wrap the result of new into a shared_ptr. It makes two heap allocations. You should use std::make_shared. It combines both and makes only one allocation.