MyOperators
Namespace: MyClassLib
A class exercising operator overloads.
public class MyOperators
Inheritance Object → MyOperators
Attributes NullableContextAttribute, NullableAttribute
Properties
Value
The wrapped value.
public int Value { get; }
Property Value
Constructors
MyOperators(Int32)
Initializes a new MyOperators.
public MyOperators(int value)
Parameters
value Int32
The wrapped value.
Methods
Equals(Object)
public override bool Equals(object? obj)
Parameters
obj Object?
Returns
GetHashCode()
public override int GetHashCode()
Returns
Operators
operator +(MyOperators, MyOperators)
Adds two operands.
public static MyOperators operator +(MyOperators a, MyOperators b)
Parameters
a MyOperators
The left operand.
b MyOperators
The right operand.
Returns
MyOperators
The sum.
operator -(MyOperators, MyOperators)
Subtracts two operands.
public static MyOperators operator -(MyOperators a, MyOperators b)
Parameters
a MyOperators
The left operand.
b MyOperators
The right operand.
Returns
MyOperators
The difference.
operator ==(MyOperators, MyOperators)
Equality.
public static bool operator ==(MyOperators a, MyOperators b)
Parameters
a MyOperators
The left operand.
b MyOperators
The right operand.
Returns
Boolean
True when values are equal.
operator !=(MyOperators, MyOperators)
Inequality.
public static bool operator !=(MyOperators a, MyOperators b)
Parameters
a MyOperators
The left operand.
b MyOperators
The right operand.
Returns
Boolean
True when values are not equal.
implicit operator int(MyOperators)
Implicit conversion to Int32.
public static implicit operator int(MyOperators value)
Parameters
value MyOperators
The value to convert.
Returns
explicit operator MyOperators(Int32)
Explicit conversion from Int32.
public static explicit operator MyOperators(int value)
Parameters
value Int32
The value to convert.