Standard C++ in Unreal

Is there a way to use the standard c++ library in Unreal? Like making a wrapper class or making the code a plugin to call from the engine?

Hi,

You can use the standard libraries, but you should be aware of a few of things:

  • I would not mix Unreal types and standard types. Our container type requirements are not as strong as the standard libraries, for example, see: TMap value type limitations - Programming & Scripting - Unreal Engine Forums

  • UE4 tends not to enable exceptions nor written to be exception-safe, so stack-unwinding of UE code is likely to go wrong if an exception is thrown through it.

  • We override ‘new’, so you should not pass standard library types between modules which have been compiled separately from UE4, as this will inevitably lead to crashes due to mismatched memory allocators.

You should be fine as long as all of your standard library usage is encapsulated within your modules, however, we do not support it if you have problems.

Also, you may have trouble mixing debug vs. release libraries. See TargetRules.bDebugBuildsActuallyUseDebugCRT, which defaults to false.

Steve