S
Satish Sangapu
I am reading "Inside the C++ Object Model" by Stanley Lippman. It is a very
nice book about the internals of C++.
Anyway, I am confused about one thing. He states that a default constructor
is not ALWAYS generated by the compiler - ONLY when it's NEEDED and then he
goes on to define NEEDED.
class one
{
private:
int a;
bool b;
};
Apparently, the above class won't have a default constructor generated by
the compiler.
But,
class data
{
public:
data();
};
class two
{
private:
data d;
};
The above two class will have a default constructor generated by the
compiler.
The book was written in 1996 - I wonder if stuff like this has changed by
now?
Thanks.
nice book about the internals of C++.
Anyway, I am confused about one thing. He states that a default constructor
is not ALWAYS generated by the compiler - ONLY when it's NEEDED and then he
goes on to define NEEDED.
class one
{
private:
int a;
bool b;
};
Apparently, the above class won't have a default constructor generated by
the compiler.
But,
class data
{
public:
data();
};
class two
{
private:
data d;
};
The above two class will have a default constructor generated by the
compiler.
The book was written in 1996 - I wonder if stuff like this has changed by
now?
Thanks.