dammit operator

短语

词形变化

dammit operators 复数 dammit operators

释义与例句

n.
  1. 1.

    The operator ! in the C# programming language, used to indicate to the compiler that a possibly null reference will not be null at that point.

    俚语 计算机 工程 数学

    If you have a reference that the compiler presumes could be null […] but which you have good reason to believe will never be null, you can tell the compiler this by using the null forgiving operator […] It is sometimes known informally as the dammit operator, because being an exclamation mark makes it look like a slightly exasperated kind of assertion.

    However, C# 8 does have a feature (which I've heard referred to as the dammit operator) that allows you to insist that, despite what the compiler believes, you know the variable will not be null; […]

    When we've filtered out all the null elements from our collection, we apply the dammit operator to the argument for ToTitleCase, as shown in Listing 2-34.