I am trying to create a class that can update the reference to an object (outside the class) upon destruction.
So, you create an instance of this object and pass it the reference type (in any way, constructor, etc.), and then when you destroy the object, the original link was changed to the link created by the object.
If I pass the link by reference (say, in the build), I can’t figure out how to save this link (as a link) for the destructor to update it? For example (pseudo):
class Updater { object privateReference; public Updater(ref object externalReference) { privateReference = externalReference;
The key point here is that I am not trying to mutate the original “external” object from this class. I am trying to “reassign” it or initialize it if you do.
c # reference-type
Adam naylor
source share