AI对话记录: 2026-03-11
This commit is contained in:
@@ -137,5 +137,37 @@ bool FEditorAnomalyOptionBase::CanCast()
|
||||
```
|
||||
```
|
||||
//修改后
|
||||
template <typename T>
|
||||
bool FEditorAnomalyOptionBase::CanCast()
|
||||
{
|
||||
FString ClassName = GetMatchName();
|
||||
// 如果 T是UObject派生类
|
||||
if constexpr (TIsDerivedFrom<T,UObject>::Value)
|
||||
{ FString MatchName = T::StaticClass()->GetName();
|
||||
return ClassName.Equals(MatchName);
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}}
|
||||
```
|
||||
# 默认构造时子对象初始化问题
|
||||
```
|
||||
|
||||
```
|
||||
```
|
||||
```
|
||||
|
||||
```
|
||||
# 枚举中用另外一个枚举赋值
|
||||
# 使用const w_char_t*
|
||||
# 使用宏::\#\#
|
||||
# 子类同名重写函数与父类参数不同
|
||||
## ##__VA_ARGS__的作用是去掉前面的逗号,前面没有逗号时不能用,会报错。
|
||||
```
|
||||
#define NetAssert(cond, ...) do { \
|
||||
if (!(cond)) { \
|
||||
LogMqNetError(#cond, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
```
|
||||
# std:result_of 在C++20 中被移除
|
||||
改成invoke_result
|
||||
Reference in New Issue
Block a user