MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Ansi Namespace Reference

Epic Games may not agree with standards because they know better, but sometimes we have to bare consequences of such wisdom. This namespace contains utilities which politely circumvent the obviously superior decisions Epic Games has made. More...

Namespaces

namespace  Detail
 

Data Structures

class  FAllocator
 Allocator that allocates memory using standard library functions. More...
 
class  FSetAllocator
 Allocator for sets to follow standard allocation behavior. More...
 

Functions

template<typename T , typename... Args>
T * New (Args &&... args)
 Force using the ANSI memory allocation behavior, instead of the Unreal default.
 
template<typename T >
void Delete (T *ptr)
 Force using the ANSI memory release behavior, instead of the Unreal default.
 

Detailed Description

Epic Games may not agree with standards because they know better, but sometimes we have to bare consequences of such wisdom. This namespace contains utilities which politely circumvent the obviously superior decisions Epic Games has made.

Function Documentation

◆ Delete()

template<typename T >
void Mcro::Ansi::Delete ( T * ptr)

Force using the ANSI memory release behavior, instead of the Unreal default.

This may be less performant and will not be considered by AutoRTFM. Use it only when Unreal overrides cause problems and comment the reason why this was necessary. This is paired with Ansi::New<T>().

FFoobar* myVar = Ansi::New<FFoobar>();
Ansi::Delete(myVar);
void Delete(T *ptr)
Force using the ANSI memory release behavior, instead of the Unreal default.
Definition New.h:49
T * New(Args &&... args)
Force using the ANSI memory allocation behavior, instead of the Unreal default.
Definition New.h:32

Definition at line 49 of file New.h.

◆ New()

template<typename T , typename... Args>
T * Mcro::Ansi::New ( Args &&... args)

Force using the ANSI memory allocation behavior, instead of the Unreal default.

This may be less performant, may need more memory and will not be considered by AutoRTFM. Use it only when Unreal overrides cause problems and comment the reason why this was necessary. This is paired with Ansi::Delete instead of delete.

FFoobar* myVar = Ansi::New<FFoobar>();
Ansi::Delete(myVar);

Definition at line 32 of file New.h.