Class PureAttribute
Indicates that a method does not make any observable state changes.
The same as System.Diagnostics.Contracts.PureAttribute
Implements
Inherited Members
Namespace: JetBrains.Annotations
Assembly: UnityEngine.dll
Syntax
[AttributeUsage(AttributeTargets.Method, Inherited = true)]
public sealed class PureAttribute : Attribute, _Attribute
Examples
[Pure] private int Multiply(int x, int y) { return x * y; }
public void Foo() {
const int a = 2, b = 2;
Multiply(a, b); // Waring: Return value of pure method is not used
}