Sign in
◑
Theme
fuchsia
/
third_party
/
swig
/
725bc081da170662b194ca1ff5e7e75144bc0760
/
.
/
Examples
/
test-suite
/
lua
/
smart_pointer_const_runme.lua
blob: 00a48466ad4b46eb47de32a4ffe80b07dc4ffb05 [
file
]
local
v
=
require
(
"smart_pointer_const"
)
local
f
=
v
.
Foo
()
local
b
=
v
.
Bar
(
f
)
-- holds pointer to 'f'
b
.
x
=
3
assert
(
b
:
getx
()
==
3
)
local
fp
=
b
:
__deref__
()
-- get point of 'f'
assert
(
fp
:
getx
()
==
3
)
fp
.
x
=
4
assert
(
fp
:
getx
()
==
4
)