#529 [Perl] inheritance of enums and static methods

open
perl (97)
5
2010-09-27
2005-01-19
Josh Cherry
No

As discussed on the e-mail list, enums, static methods,
and any other members accessed with "::" rather than "-
>" are in effect not inherited in Perl. Consider the
following:

%module inheritance

%inline %{

class CBase
{
public:
enum EFoo {
eFoo0,
eFoo1
};
static int StatFun(void) {return 42;};
};

class CDerived : public CBase
{
};

%}

If this is wrapped for Perl, $inheritance::CDerived::eFoo0
is undefined, and calling inheritance::CDerived::StatFun
() doesn't work. A solution is to repeat some lines from
the Perl CBase package in the CDerived package.

Discussion

  • Josh Cherry

    Josh Cherry - 2005-01-21
    • labels: --> perl
     
  • Olly Betts

    Olly Betts - 2010-09-27
    • summary: Perl inheritance of enums and static methods --> [Perl] inheritance of enums and static methods
    • assigned_to: nobody --> talby
     

Log in to post a comment.