/tags/rel-1.3.35/Examples/test-suite/octave/smart_pointer_simple_runme.m

# · MATLAB · 15 lines · 12 code · 3 blank · 0 comment · 2 complexity · cf2e9d0dc0677c3b9aa5355ec43bc412 MD5 · raw file

  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