accessing static members

Hi,
Imagine i have such code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct A{
    static int a;
    int Get_a(){
        return a; // do something with a
    }
};
struct B:public A{
    static int a;
};

int main(){
    B obj;
    obj.Get_a();
}

I want the function called in line 13 to return the static a of the B structure.
Is there any way this can be achieved?
Do overload Get_a() method in derived class:

1
2
3
4
struct B:public A{
    static int a;
	int Get_a(){ return a; } // 'a' is B::a here
};
That would be annoying if Get_a() was a longer function.
I'm currently using another overloaded method which returns 'a', but I wonder if there is a smarter way to do this.
Thank you for your reply.
Topic archived. No new replies allowed.