PageRenderTime 21ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/smart_pointer_simple_runme.m

#
MATLAB | 15 lines | 12 code | 3 blank | 0 comment | 2 complexity | cf2e9d0dc0677c3b9aa5355ec43bc412 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. smart_pointer_simple
  2. f = Foo();
  3. b = Bar(f);
  4. b.x = 3;
  5. if (b.getx() != 3)
  6. error
  7. endif
  8. fp = b.__deref__();
  9. fp.x = 4;
  10. if (fp.getx() != 4)
  11. error
  12. endif