mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-08 11:37:04 +09:00
![]() C# now supports defining `checked` variants of the following user-defined operators so that users can opt into or out of overflow behavior as appropriate: * The `++` and `--` unary operators [§11.7.14](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#11714-postfix-increment-and-decrement-operators) and [§11.8.6](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#1186-prefix-increment-and-decrement-operators). * The `-` unary operator [§11.8.3](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#1183-unary-minus-operator). * The `+`, `-`, `*`, and `/` binary operators [§11.9](https://github.com/dotnet/csharpstandard/blob/draft-v6/standard/expressions.md#119-arithmetic-operators). * Explicit conversion operators. Motivation: There is no way for a user to declare a type and support both checked and unchecked versions of an operator. This makes it hard to port various algorithms to use the proposed `generic math` interfaces exposed by the libraries team. Likewise, this makes it impossible to expose a type such as `Int128` or `UInt128` without the language simultaneously shipping its own support to avoid breaking changes. This change adds names for the new checked operators to the specification. |
||
---|---|---|
.. | ||
Ecma-335-Augments.md | ||
PE-COFF.md | ||
PortablePdb-Metadata.md |