Verse Library verse

01 Comparable

Demonstrates a unique reference class holding an integer, illustrating assignment and comparison behavior.

extracted-snippets/documentation/en-us/uefn/comparable-in-verse/01-comparable.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/comparable-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/comparable-in-verse.md
# Section:    Comparable
int_ref := class<unique>:
Contents:int
Main()<decides> : void =
X := int_ref{Contents := 0}
Y := int_ref{Contents := 0}
X = X # Succeeds
X = Y # Fails
X <> Y # Succeeds

Comments

    Sign in to vote, comment, or suggest an edit. Sign in