Also, `new`/`delete` aren't unidiomatic when strictly adhering to RAII and
- Writing exception-safe code (with the `new (std::nothrow) T` form).
- Writing custom smart pointers or data structures, or high-performance containers (especially with C++17 aligned `new`/`delete` and C++14 sized `delete`).
- Using memory pools (with placement `new`/`delete`).
`[std::]malloc`/`[std::]free` aren't necessarily unidiomatic either, such as
- When using a C API (or one in pre-standard C++ or a third language) which is incompatible with `new`/`delete`.
- When you need `[std::]realloc`, and for whatever reason a `std::vector` isn't an acceptable substitute.
- In embedded or other environments that don't provide a STL.
How do you think the std::vector is implemented under the hood ?
Also shared_ptr's make the ownership relation harder to understand. (Also there's additional synchronization cost for copying pointers.) Of course there are situations where you need them, but in general, I think it's better to avoid them.