Hello everyone, I recently learned about placement new, but so far I can only find examples of it's usage on heap memory.
I was wondering if it's valid for stack allocated objects to reuse their memory.
For example if i have
auto fn(){
Type object{};
object.~Type();
new (&object) Type;
}
would this be valid? additionally what if I use it ok member variables of the class in the same way?
https://redd.it/1qdzg2q
@r_cpp