Home | History | Annotate | Download | only in perl5
      1 /* ------------------------------------------------------------
      2  * Overloaded operator support
      3  * ------------------------------------------------------------ */
      4 
      5 #ifdef __cplusplus
      6 
      7 // These are auto-supported by the Perl-module
      8 %rename(__plusplus__) *::operator++;
      9 %rename(__minmin__)   *::operator--;
     10 %rename(__add__)      *::operator+;
     11 %rename(__sub__)      *::operator-;
     12 %rename(__neg__)      *::operator-();
     13 %rename(__neg__)      *::operator-() const;
     14 %rename(__mul__)      *::operator*;
     15 %rename(__div__)      *::operator/;
     16 %rename(__eq__)       *::operator==;
     17 %rename(__ne__)       *::operator!=;
     18 %rename(__mod__)      *::operator%;
     19 %rename(__gt__)       *::operator>;
     20 %rename(__lt__)       *::operator<;
     21 %rename(__not__)      *::operator!;
     22 %rename(__le__)       *::operator<=;
     23 %rename(__ge__)       *::operator>=;
     24 %rename(__and__)      *::operator&;
     25 %rename(__or__)       *::operator|;
     26 %rename(__iadd__)     *::operator+=;
     27 %rename(__isub__)     *::operator-=;
     28 
     29 // These are renamed, but no test exists in operator_overload_runme.pl
     30 %ignoreoperator(EQ)         operator=;
     31 
     32 // These are renamed, but no 'use overload...' is added
     33 %rename(__lshift__)   *::operator<<;
     34 %rename(__rshift__)   *::operator>>;
     35 %rename(__xor__)      *::operator^;
     36 %rename(__invert__)   *::operator~;
     37 %rename(__call__)     *::operator();
     38 
     39 /* Ignored operators */
     40 %ignoreoperator(LAND)       operator&&;
     41 %ignoreoperator(LOR)        operator||;
     42 %ignoreoperator(MULEQ)      operator*=;
     43 %ignoreoperator(DIVEQ)      operator/=;
     44 %ignoreoperator(MODEQ)      operator%=;
     45 %ignoreoperator(LSHIFTEQ)   operator<<=;
     46 %ignoreoperator(RSHIFTEQ)   operator>>=;
     47 %ignoreoperator(ANDEQ)      operator&=;
     48 %ignoreoperator(OREQ)       operator|=;
     49 %ignoreoperator(XOREQ)      operator^=;
     50 %ignoreoperator(ARROWSTAR)  operator->*;
     51 %ignoreoperator(INDEX)      operator[];
     52 
     53 
     54 #endif /* __cplusplus */
     55