From: Jesper E. <je...@es...> - 2007-03-05 10:23:01
|
2007/2/28, William S Fulton <ws...@fu...>: > You could modify your c++ interface to be more accurate for the intended > usage by using an operator bool() instead as then the default mapping > works exactly as you want in Java (and C++ of course). Alternatively you > can use %extend to add in a method to check the validity: > > %extend Foo { > bool isValid() { return *$self ? true : false; } > } > > and just %ignore the original operator void*. > > If this design pattern occurs over and over again, it would be worth > putting the effort into writing the typemaps instead though. Ok, thanks for the advice. -- /Jesper |