class Lattice
{
private:
//private members
Site site[ NSITES ];
Atom atom[ NSITES ]; /* ONE IS VACANCY -CONFUSING- */
double lifeTime;
public:
//constructor
Lattice();
//destructor
~Lattice();
Question:
does it make sense that I manually called the contructors / initialise functions for site[ NSITES ] and atom[ NSITES ] ? or are they called automatically? in this case how can I use an overloaded constructor instead? would that be called AFTER the default constructors anyway?
Another thing new in C++11 is constructor delegation:
1 2 3 4 5 6 7 8 9 10
class Circle
{
public:
Circle() : Circle(1) {} //Default value would look better, but this is for sake of example
Circle(double newRadius) : radius(newRadius) {} //Using member initializer list
private:
double radius;
};