[C# 10] record struct : C# struct은 default 값과 비교 할 수 없나요?
다음의 코드로 확인을 해봅시다.
// default 값을 할당할 수는 있지만,
StructValue a = default;
// 비교할 수는 없습니다.
// CS0019 오류 발생
if (a == default)
{
}
struct StructValue
{
int Value1 { get; init; }
int Value2 { get; init; }
object ObjValue { get; init; }
}
a와 def...
dimohy.slogs.dev2 min read