From 1ef5505dd5b43293a1c7f843d40bdb4f64a152c9 Mon Sep 17 00:00:00 2001 From: Stuart Mosquera Date: Fri, 1 Aug 2025 17:48:19 -0300 Subject: [PATCH 1/3] add clarification for operator overloading --- .../csharp/language-reference/operators/operator-overloading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/operators/operator-overloading.md b/docs/csharp/language-reference/operators/operator-overloading.md index 2e411016eb6af..f9ebda5439dd8 100644 --- a/docs/csharp/language-reference/operators/operator-overloading.md +++ b/docs/csharp/language-reference/operators/operator-overloading.md @@ -18,7 +18,7 @@ Use the `operator` keyword to declare an operator. An operator declaration must - It includes a `public` modifier. - A unary operator has one input parameter. A binary operator has two input parameters. In each case, at least one parameter must have type `T` or `T?` where `T` is the type that contains the operator declaration. - It includes the `static` modifier, except for the compound assignment operators, such as `+=`. -- The increment (`++`) and decrement (`--`) operators can be implemented as either static or instance methods. +- The increment (`++`) and decrement (`--`) operators can be implemented as either static or instance methods, new feature in C# 14. The following example defines a simplified structure to represent a rational number. The structure overloads some of the [arithmetic operators](arithmetic-operators.md): From 18845f48250e58ea2b9332ec37e8ac4c6cd785cb Mon Sep 17 00:00:00 2001 From: Stuart Mosquera Date: Sat, 2 Aug 2025 15:14:45 -0300 Subject: [PATCH 2/3] fix grammar --- .../csharp/language-reference/operators/operator-overloading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/operators/operator-overloading.md b/docs/csharp/language-reference/operators/operator-overloading.md index f9ebda5439dd8..d4d1616c2ebcd 100644 --- a/docs/csharp/language-reference/operators/operator-overloading.md +++ b/docs/csharp/language-reference/operators/operator-overloading.md @@ -18,7 +18,7 @@ Use the `operator` keyword to declare an operator. An operator declaration must - It includes a `public` modifier. - A unary operator has one input parameter. A binary operator has two input parameters. In each case, at least one parameter must have type `T` or `T?` where `T` is the type that contains the operator declaration. - It includes the `static` modifier, except for the compound assignment operators, such as `+=`. -- The increment (`++`) and decrement (`--`) operators can be implemented as either static or instance methods, new feature in C# 14. +- The increment (`++`) and decrement (`--`) operators can be implemented as either static or instance methods. This is a new feature introduced in C# 14. The following example defines a simplified structure to represent a rational number. The structure overloads some of the [arithmetic operators](arithmetic-operators.md): From 32d660e6de36c70894b00f2bfcd740472f30e790 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Mon, 4 Aug 2025 12:25:33 -0400 Subject: [PATCH 3/3] Update docs/csharp/language-reference/operators/operator-overloading.md --- .../csharp/language-reference/operators/operator-overloading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/operators/operator-overloading.md b/docs/csharp/language-reference/operators/operator-overloading.md index d4d1616c2ebcd..d99257a9fcf5d 100644 --- a/docs/csharp/language-reference/operators/operator-overloading.md +++ b/docs/csharp/language-reference/operators/operator-overloading.md @@ -18,7 +18,7 @@ Use the `operator` keyword to declare an operator. An operator declaration must - It includes a `public` modifier. - A unary operator has one input parameter. A binary operator has two input parameters. In each case, at least one parameter must have type `T` or `T?` where `T` is the type that contains the operator declaration. - It includes the `static` modifier, except for the compound assignment operators, such as `+=`. -- The increment (`++`) and decrement (`--`) operators can be implemented as either static or instance methods. This is a new feature introduced in C# 14. +- The increment (`++`) and decrement (`--`) operators can be implemented as either static or instance methods. Instance method operators are a new feature introduced in C# 14. The following example defines a simplified structure to represent a rational number. The structure overloads some of the [arithmetic operators](arithmetic-operators.md):