T
Tony Johansson
Hello!
What is the difference if we have the whole class Item defined within class
List see NOTE_1 below compare to
having class Item defined stand-alone and only have an instance of class
Item in the private section like NOTE_2.
Is it any advantage to nest a class definition within another class
definition such as this List class below.
Many thanks!
//Tony
NOTE_2
********
class List
{
public
....
private:
Item obj;
};
Assume we have this nested class definition
NOTE_1
*******
class List
{
public
....
private:
class Item
{
public:
item();
};
};
What is the difference if we have the whole class Item defined within class
List see NOTE_1 below compare to
having class Item defined stand-alone and only have an instance of class
Item in the private section like NOTE_2.
Is it any advantage to nest a class definition within another class
definition such as this List class below.
Many thanks!
//Tony
NOTE_2
********
class List
{
public
....
private:
Item obj;
};
Assume we have this nested class definition
NOTE_1
*******
class List
{
public
....
private:
class Item
{
public:
item();
};
};