-
-
Notifications
You must be signed in to change notification settings - Fork 9
POD Variable
IsaacShelton edited this page Mar 21, 2022
·
1 revision
Variables that are marked as POD
(plain-old-data), are immune to __defer__
management procedures.
import basics
struct Bomb ()
func __defer__(this *Bomb) {
printf("Boooooom!!!\n")
}
func main {
test1()
test2()
}
func test1 {
bomb_dot_com Bomb
print("Running test1...")
// __defer__(Bomb) will be called
}
func test2 {
bomb_dot_com POD Bomb
print("Running test2...")
// __defer__(Bomb) will NOT be called
}
Running test1...
Boooooom!!!
Running test2...