#Why does "->" operator works on TSharedRef
1 messages · Page 1 of 1 (latest)
because it has the operator implemented to get the wrapped ptr?
smth like
class Foo
{
public:
Bar* operator->() const { return MyBar; }
private:
Bar* MyBar{nullptr};
};
So are you saying that shared references are not actually references?
a shared reference is a sharedptr that can't wrap a nullptr
Bruh.
Thanks. This makes sense.
is it normal that -> operator returns pointer and not object? 🤔 .
Just trying to understand if this just an example or valid case :D.
cause I think then you should do -> twice on such object?
Cause it returns member as pointer? 🤔
Foo someObject{};
someObject->()->
or am I exaggerating