3 ms·
Are there any C++ implementatons that actually heap-allocate temporaries? The only context where I can imagine that happening is an async (as in co_await) funct
by int_19h 5y ago
Are there any C++ implementatons that actually heap-allocate temporaries? The only context where I can imagine that happening is an async (as in co_await) function, where all autos might need to be heap-allocated for obvious reasons.
But that aside, it just seems like a very weird choice that would have profound perf implications - to the point of removing pretty much the sole remaining advantage of the language - for no gain whatsoever, since it's not even simpler.
As for non-trivial ctors - at that point you might as well worry that every function call made in pure C code can also heap-allocate, no?