It seems to be a warning but it compiles anyway so I don’t know if this is a Rider false-positive or what when I compiled and tested it the ID showed as a bunch of Zeroes, but when I deleted the folders and regenerated the project files and compiled again it seemed to fix it.
Cannot print value of type FPlayInEditorID with format specifier %d that implies type int
Correct me if I’m wrong, I am still learning. I have never seen an operator that looks like a function but is it possible that your actually supposed to cast it to an int32?
Update:
Ok so after looking into this a little further the ‘operator int32() const;’ is an implicit conversion that should be handled automatically without the need for a cast unless the explicit keyword is added, unless my sources are wrong. (For clarification it allows the class to be converted to another data type and unless I’m mistaken doesn’t require a direct cast for that to happen)
With this being said I think it’s more of a warning from the compiler as it may not think it’s safe for whatever reason. I don’t think it’s anything to be concerned about though.
Just so you know, when working with Unreal Engine you should use Cast<>() and not static_cast where possible. Unreal have their own version which is an inline function and as such, is probably more efficient… You may hit issues when dealing with actors as well if you try using static_cast.
There are a number of quirks like this in Unreal C++ over standard C++ but generally you don’t need to dive as deep into the language as you would writing C++ software for embedded systems, for example.
Yeah that clears it up quite a bit. I was just confused by the return type it was showing in Rider. Thanks for the tip on Casting, I had a feeling Unreal had their own version but wasn’t sure of the syntax.
Again, thanks for the insight. That clears it up quite a bit for me.