I
imutate
Some questions about ctors and class members
Is v private in the following ? If it is why put the declaration at
the top ? Is there any difference to putting it in the private section
?
The reference to v() defines the constructor, it will call v's
constructor, right ?
class vec
{
std::vector< celement > v;
public:
vec() : v() { }
If you declare an empty constructor like In the following is there any
difference to when it is left out ? Does C++ differ from other
languages in that you do not have to explicitely call the default ctor
from within the "programed" one.
class compos
{
int a;
double b;
public:
compos() { } // <- but there is nothing in it ?
Finally does this last example have the same results as the previous
one ?
class compos
{
int a;
double b;
public:
compos();
compos::compos
{ }
Is v private in the following ? If it is why put the declaration at
the top ? Is there any difference to putting it in the private section
?
The reference to v() defines the constructor, it will call v's
constructor, right ?
class vec
{
std::vector< celement > v;
public:
vec() : v() { }
If you declare an empty constructor like In the following is there any
difference to when it is left out ? Does C++ differ from other
languages in that you do not have to explicitely call the default ctor
from within the "programed" one.
class compos
{
int a;
double b;
public:
compos() { } // <- but there is nothing in it ?
Finally does this last example have the same results as the previous
one ?
class compos
{
int a;
double b;
public:
compos();
compos::compos
{ }