How to reference a variable in c++ ue5

Hi there. I am currently working in a multithreaded environment where I need to pass a reference as a global variable. The basic structure would look something like this:

Worker::JoyInit(TSet<Worker>& w)
{
    UE_LOG(LogTemp, Warning, TEXT("w.num() = %d"), w.Num());
}

But the editor crashes every time I try to play it! I am not very comfortable with pointers so any quick advice would be greatly appreciated.

Ok so I figured out what I did wrong. The calling method was:
Worker::JoyInit(*queue) and the initialization for queue was TSet<Worker> *queue
I changed this to:
Worker::JoyInit(queue); and TSet<Worker> queue;
and it compiles.