I’m having trouble getting TFunctions to work as method argument. Initially, I want to pass a lambda that takes as only parameter a reference to ASupraPawn
, returning void
:
void SetCarrier(class ASupraPawn& NewCarrier, TFunction<void(class ASupraPawn&)> CarrierMethod);
This gave me the following error:
Error: In BallPlayerHistoryComponent: Missing '*' in Expected a pointer type
Changing the references to pointers gave me:
Error: In BallPlayerHistoryComponent: Unrecognized type 'TFunction'
I then added the include:
#include "Core/Public/Templates/Function.h"
Which gave me an error in some other file:
Unparsed class 'Function' found while validating DependsOn entries for 'BallPlayerHistoryComponent'
There are no examples of usage of TFunction, and I’m unsure how to use them properly. I figured they would just be a drop in replacement for std::function
?