Skip to content

Assign Operator

IsaacShelton edited this page Mar 21, 2022 · 1 revision

= Operator

The = operator is used for assigning a value to a piece memory

x = 3

It can only be used as a statement, and the first operand must be mutable.

Override

The = operator can be overridden by declaring an __assign__ method.

func __assign__(this *T, other T) {

}

See __assign__ for more information.

Clone this wiki locally