std::vector<int> allocated and freed on the stack will allocate an array for its int’s on the heap…
I've heard that MSVC does (did?) that, but if so that's an MSVC problem. gcc and clang don't do that.
https://godbolt.org/z/nasoWeq5M
Sure, but my point was that RAII doesn't need to involve the heap. Another example would be acquiring abd releasing a mutex.
I've heard that MSVC does (did?) that, but if so that's an MSVC problem. gcc and clang don't do that.
https://godbolt.org/z/nasoWeq5M