Hacker News new | ask | show | jobs
by anonymoushn 4629 days ago
Does idiomatic C++ do heap allocations with malloc then?
2 comments

Idiomatic C++ would allocate everything possible on the stack, and if that wasn't possible, use `make_shared`/`make_unique`. So maybe I will change it to say "doesn't use `new` directly".
No. Idiomatic C++ allocates everything at compile time by means of template metaprogramming magic (just joking).
No that is D and it is with CTFE. Also joking... mostly.