/tags/rel-1-3-15/SWIG/Examples/test-suite/private_assign.i

# · Swig · 21 lines · 17 code · 4 blank · 0 comment · 0 complexity · 977047f3f4c34fa1d67a3556b6db4c56 MD5 · raw file

  1. // A class with a private assignment operator.
  2. // This is rare, but sometimes used with singletons and
  3. // objects that have complicated state.
  4. %module private_assign
  5. %inline %{
  6. class Foo {
  7. private:
  8. Foo &operator=(const Foo &f) {
  9. return *this;
  10. }
  11. public:
  12. void bar() { }
  13. };
  14. Foo blah() {
  15. return Foo();
  16. };
  17. %}