Are local classes, Inner and Nested classes the same in C ++?

Local class, Inner class and Nested class mean the same thing in C ++?

+5
source share
3 answers

The local class and the nested class are different animals.

A Nested class is a class declared within another class.

A local class is declared in a function definition.

The inner class is a non-standard C ++ term. Therefore, I am not sure how to determine it.


Nested classes:

IBM documentation as good documentation here . To summarize:

  • . , , , , .
  • - . -

:
, .

+5

++ 11 (N3290):

9.7 [class.nest]

1 . , , .

9.8 [class.local]

1 ; .

, ++.

+2

this. . Java.

0

All Articles