Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unknown name of the following: class Foo::Bar

Tags:

c++

I was reading a program in c++ and came across the following

class Foo::Bar
{
   ...
}

I have been researching different methods of class implementation but have not come across the :: when creating a class. Do you know the name of it so I can look it up?

Foo is a full size class, not a namespace. I do not know what Bar is.

Thank you

like image 288
user1247549 Avatar asked Nov 26 '25 07:11

user1247549


1 Answers

It is a nested class definition. It means that the class Bar was declared inside class Foo. Kind of like this:

class Foo
{
...
class Bar;
...
};
like image 123
imreal Avatar answered Nov 28 '25 21:11

imreal