c++ - 我的包装函数缺少一个变量?
问题描述
由于我遇到了一个特殊的错误,我决定像这样包装一个函数来解决上述错误:
UFUNCTION()
void OnBoxOverlapWrapper(UPrimitiveComponent* /*ignored*/, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherIndex, bool bFromSweep, const FHitResult & SweepResult)
{
OnBoxOverlap(OtherActor, OtherComp, OtherIndex, bFromSweep, SweepResult);
}
但是,当我尝试编译我的代码时,设置 OnBoxOverlapWrapper 的行会生成以下内容Error: Missing variable name
:这是在函数中声明包装器的唯一一次,因此不应该发生这种情况。特别奇怪的是,当我对另一个函数使用类似的包装器时,它并没有产生这样的错误:
UFUNCTION()
void OnBoxEndOverlapWrapper(UPrimitiveComponent* /*ignored*/ AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherIndex)
{
OnBoxEndOverlap(OtherActor, OtherComp, OtherIndex);
} //this code does not produce an error
这里发生了什么?
解决方案
事实证明,您需要为该OnBoxOverlap
函数编写一个主体。
推荐阅读
- javascript - 无法在 JavaScript 中导入 AlertifyJS
- indexing - Julia - 以元组数组作为索引的 JuMP 约束
- ios - 通过蓝牙将媒体密钥发送到 iOS 设备
- python - 做一个 groupby 和一个 sum 但在 Pandas DataFrame 中保持其他列完整
- javascript - 如何按比例缩放组件/页面,如 Ctrl +/-
- qt - 如何使 QAbstractSpinBox 自动重复向上/向下按钮?
- javascript - 无法将变量设置为 Bcrypt 生成的哈希
- python - 如何避免使用 Autoreg 或 ARIMA Statsmodels 进行动态预测
- c# - 未捕获任务错误
- ios - 在 iOS 15 中未分配 Alamofire 4.9.1 sessionManager.delegate.sessionDidReceiveChallenge