You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
* Reverted the changes in 25904929 related to subclasses to TCommands<>.
This code relies on undefined behavior of how things are inlined. base class is a template with a static variable. One instance of that static variable exists in each dll/exe. To call TCommands<>::Get() would return the instance in the same dll.
But, because the subclass has dllexport on the type and not the members it will generate a Get function that is not inlined. The callsite when calling Get will actually then use the instantiated Get() function and not the inlined one.
So for
class API X : public TCommands<X> {}
it will (for now) work to call
X::Get() and get the same instantiated singletone.
Calling
TCommands<X>::Get() will definitely not work and return the singleton instantiated in the same dll/exe
#rb none
[CL 25909947 by henrik karlsson in ue5-main branch]