How to create value-type C++ classes not structs?

How would one create a C++ class that is passed by value and not garbage collected like a struct?

Such lightweight structs seem like they make more sense in some places. Unfortunately the USTRUCT seems like it cannot implement a UE4 interface. So if I want to implement an interface it seems I have to use a class. But if I use a class it seems like instead of pass by value I get garbage collection. Any suggestions?

Thanks,
-X

What exacly you need interface for? Structs can inherent same as classes, so you can make base struct that works as interface, not sure if it works with reflection system. You can make non-UObject class via wizard in editor, it should set up it right, but such class wont work with blueprints if im not mistaken. In order to pointer to not be garbage collected you need to use UPROPERTY ()

Seems like structs to do not work with interface (probably due to the reflection system as you say) so I can’t make “base struct that works as interface”.

I can’t make non-UObject class via wizard in editor since all wizard things inherit from UObject at some point (except struct).

I want an interface that works with simple value types (like structs) which are always passed by value and so one doesn’t need to worry about garbage collection. For now I’m just using UObject but seems like this would be handy if someone knows how.

Thanks,
-X

You sure struct inherence dont work? And theres definitly option for non UObject class in wizard, you missing it, its top option