Namespace scope

Apr 20, 2014 at 3:20am
If I have a header and a few class like this:

1
2
3
4
5
6
7
8
9
10
11
12
namespace ns {
     class Human;
     class Animal;
}

class Human {

};

class Animal {

};


Can I just put these classes in namespace ns and write them outside of its scope without making them global? And if I can't, is there any way I can make it possible?
Last edited on Apr 20, 2014 at 3:21am
Apr 20, 2014 at 3:32am
closed account (3hM2Nwbp)
You mean something like this?

1
2
3
4
5
6
7
8
9
namespace x
{
  class y;
}

class x::y
{};

int main(){}
Apr 20, 2014 at 3:58am
I think so. Thanks
Topic archived. No new replies allowed.