Hi, I’m just a starter in both C++ and Unreal Engine5, I have run into confusion about the following lines when I was learning, which is:
there is an obj “TSubclassOf ScoreDisplay_Widget_Class;” which I’ve framed red.
we can see it’s considered valid in the “if” statement where Im putting obj ScoreDisplay_Widget_Class with the operator “!=” and keyword “nullptr”, which I believe is checking if it is a null pointer.
"if (ScoreDisplay_Widget_Class != nullptr) " be noticed the operator “!=” has no overloaded version for the class “TSubclassOf”
but this thought come to me:
how come an operator that has never been overloaded before validly accepts a specific class operand ???
whereas here I wrote a few lines based on the basically same idea as above, but the compiler says it needs an overloaded version of operator “!=” for operand “A” and “nullptr”. why???