Namespace scope

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
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(){}
I think so. Thanks
Topic archived. No new replies allowed.