Open hbivens opened 3 months ago
In fortran.cxx there's this code:
// Define policy if (CPlusPlus) { if (SwigType *name = Getattr(n, "name")) { String *policystr = Swig_name_mangle_string(name); Insert(policystr, 0, "SWIGPOLICY_"); Setattr(n, "fortran:policy", policystr); // Define policies for the class const char *policy = "swig::ASSIGNMENT_DEFAULT"; if (Getattr(n, "feature:smartptr")) { policy = "swig::ASSIGNMENT_SMARTPTR"; } else if (!GetFlag(n, "allocate:default_destructor")) { policy = "swig::ASSIGNMENT_NODESTRUCT"; } Printv(f_policies, "#define ", policystr, " ", policy, "\n", NULL); } }
How do I set the policy to swig::ASSIGNMENT_SMARTPTR in the interface file?
swig::ASSIGNMENT_SMARTPTR
This works, but I think there's a better way using features?
%{ #include "MyClass.h" #undef SWIGPOLICY_MyClass #define SWIGPOLICY_MyClass swig::ASSIGNMENT_SMARTPTR %}
In fortran.cxx there's this code:
How do I set the policy to
swig::ASSIGNMENT_SMARTPTR
in the interface file?This works, but I think there's a better way using features?