The Stmt will get de-allocated automatically when it goes out of scope, so rarely you have to call the reset function. But if you really want to set it to null, you can do s = Stmt(), which assigns s to an empty node and it is equivalent to reset
Thanks for the previous answers. I have one more question.
Let’ say I have a pointer Node* from which I want to make an instance of Operation which is derived from NodeRef . How do i go about that one in the new object protocol ? I don’t think i can use Downcast or GetRef in this case.
e.g. Previosly, I could simply do something like following:
Node* n;
Operation i = Operation(n->GetNodePtr());
Or
Do you think it is a good idea to add method similar to GetNodePtr() to Object e.g. GetObjectPtr ? Because many Nodes have constructors that take in ObjectPtr<Object>.