I was also able to do a lambda declaration inline in the .cpp file:
auto OnSkeletalMeshChanged = [this]()
{
UE_LOG(LogTemp, Log, TEXT("SkeletalMeshChanged!"));
ToonOutlineComp->SetSkeletalMesh(this->GetMesh()->SkeletalMesh);
};
this->GetMesh()->SkeletalMesh->GetOnMeshChanged().AddLambda(OnSkeletalMeshChanged);
This also seems to build fine but crash the editor on start…