▲ | throwawaymaths 3 days ago | |
you can certainly allocate on the stack (like alloca). you just have to overallocate a compile-time known size and have some sort of fallback mechanism or fail if the size requested exceeds the amount created. moreover since the stack allocator is just an allocator, you can use it with any std (or user) datastructure that takes an allocator. |