Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing outside of class's namespace inside class method?

I have a header resource that I'm making use of that defines a struct called

typedef struct { ... } Mii;

Now, in my own program, I'm writing a wrapper class that uses this struct privately and internally for its own operations, so I put my class inside my program's namespace to avoid conflict.

namespace CMii {
    class Mii {
        ...
        void doSomething();
    };
}

Now, I can refer to my wrapper class by CMii::Mii. Now, inside the implementation of doSomething:

void CMii::Mii::doSomething() {
    Mii m; 
    ...
}

The compiler thinks I'm referring to CMii::Mii. How can I tell the compiler I want to use the struct?

like image 505
cemulate Avatar asked Jul 23 '11 17:07

cemulate


1 Answers

You can do the following:

::Mii m
like image 72
Cem Kalyoncu Avatar answered Oct 20 '22 18:10

Cem Kalyoncu