Is a destructor called for an object created by static member function?

I have an object created

class A{
  static T * staticfn(){ 
    // A a   ...created using unique ptr
    return a
  }
};
void function(){
  // ...
  T *t = staticfn();
  // ...
  
// is the object pointed to by t destroyed here?
}


Read more here: https://stackoverflow.com/questions/68471058/is-a-destructor-called-for-an-object-created-by-static-member-function

Content Attribution

This content was originally published by rohitt at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: