I have read about the different types of reference. I understand how strong, soft and weak references work.
But when I read about phantom references, I could not really understand them. Maybe because I could not find any good examples that show me what their purpose is or when to use them.
Could you show me some code examples that use a phantom reference?
I’ve never done this myself — very few people ever need it — but I think this is one way to do it.
This is more or less similar to what this post suggests.