Skip to content

Commit d26cd50

Browse files
authored
Document sizeof behavior for enum types (#54567)
1 parent 7adc9e3 commit d26cd50

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • docs/csharp/language-reference/operators

‎docs/csharp/language-reference/operators/sizeof.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ The expressions presented in the following table are evaluated at compile time t
3434

3535
The size of the types in the preceding table is a compile-time constant.
3636

37+
For an enum type, the result of the `sizeof` operator is the size of the enum's underlying integral type. The result is computed at compile time.
38+
3739
In [unsafe](../keywords/unsafe.md) code, you can use `sizeof` on any non-`void` type, including types constructed from type parameters.
3840

3941
> [!NOTE]

0 commit comments

Comments
 (0)