PageRenderTime 44ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1.3.35/Examples/test-suite/li_implicit.i

#
Swig | 23 lines | 19 code | 4 blank | 0 comment | 0 complexity | 73d371c07adab00ee73be3d31ed7e2ac MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module("nocastmode") li_implicit
  2. #pragma SWIG nowarn=SWIGWARN_PP_CPP_WARNING
  3. %include implicit.i
  4. %inline
  5. {
  6. struct B { };
  7. }
  8. %implicit(A, int, double, B);
  9. %inline
  10. {
  11. struct A
  12. {
  13. int ii;
  14. A(int i) { ii = 1; }
  15. A(double d) { ii = 2; }
  16. A(const B& b) { ii = 3; }
  17. };
  18. int get(const A& a) { return a.ii; }
  19. }