What value do you return for a function that has the return type TSharedRef&

Hexxxal
Sat, 25 Sep 2021 04:50:57 +0000
C++

I am overriding FChatRoomInfo and it requires to implement the function:

const TSharedRef& GetOwnerId() const = 0;

However I do not know how to return a reference to a shared reference. It keeps failing to compile with the error C4172: returning address of local variable or temporary, even though I am returning a class member variable of type TSharedRef.

3 posts - 1 participant