logo       

RE: Wrapping exception handling around a constructor called from Java: msg#00084

programming.swig

Subject: RE: Wrapping exception handling around a constructor called from Java

Willis, Raymond W writes:
> Ok, how does one wrap an exception around an overloaded operator called
> from Java?
>
> SWIG doesn't like this:
>

Please define "doesn't like"---it's a little vague ;-).

> -----------------------------------
> %exception operator < %{
> try {
> $action
> }
> catch ( std::exception err) {
> std::cout << "exception" << std::endl;
> return $null;
> }
> %}
> %name(isLessThan) bool operator < (const Foo & rhs) const;
> ------------------------------------
>
>
> I also tried enclosing in quotes, "operator <", "operator<", and just
> operator<
>

Try using the full prototype. operator< (const Foo & rhs) const %{
... %}.

-- Dave

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise