private SecondClass m_second = new SecondClass(-2);
void TestSwig ()
m_first = FactoryClass.getReference( m_first ); //The returned reference is copied from C++
FactoryClass.getReference( m_second ); //m_second is never changed
FirstClass anotherFirst = new FirstClass(-1) ;
BaseClass bc = FactoryClass.getReference( anotherFirst); //bc does equal the new instance of FirstClass but anotherFirst is not correctly replaced
//This is the case I would ideally want to use
SecondClass nothing ;
FactoryClass.getReference( nothing ) ; //NullReferenceException (because the SWIG generated interface uses nothing.CPtr() to pass by pointer as it does with all refs).
I tried a lot of %typename gymnastics to replace the signature of FactoryClass.getReference( FirstClass ) with FactoryClass.getReference( out FirstClass ) (or even ref FirstClass) but
I can’t find a way to do it properly.
Any help, feedback, or even confirmation that this is not possible, is welcome.