Why std::ifstream is working?

As far as I known unreal engine c++ scripting does not go along with ifstream and other std::anytype stuffs. Recently however I just tried ifstream in curiosity : I made a actor class in c++ and made it read a txt file using std::ifstream and print it on screen and it worked!? Is this a kind of new in unreal engine5.2 or me being just naive?

ue doesn’t go well with std, as it has a bunch of its own similar stuff implemented diffirently. Nevertheless there is no “doesn’t work at all”, its “both ue & std works according to their implementations”, and in the plenty of cases data between them can be converted both ways, albeit sometimes it can be isn’t simple.

read a txt file using std::ifstream and print it on screen and it worked!?

It can work for simple cases, but, for example, have you tried to read non-ascii text? it may not work, depending on project settings, or be not (simply) convertable to FString\FText.

Nevertheless, afaik, some things in engine was replaced with std:: methods, so it’s just a matter of how well both implementations goes along in each particular case.

So, if you tested particular function and it works well in all cases you need - i see no problems using it. Well, unless there is ue’s analog that solves problem better.

Thanks for your kindness!! It really helped! :smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.