@L B mesh is a class (sorrty for responding so late but I'm learning c++ and wanted to know more before responding again..!)
I've understood that mesh electrodeMesh(10e-9,4,10); is the same than mesh electrodeMesh={10e-9,4,10};
Now my doubt is, how can you use different constructors? The program knows which one to use because of the number and types of parameters used? (I say this because I suppose that mesh electrodeMesh(10e-9,4,10); refers to the 4th constructor.
class mesh
{
public:
//! Constructor
/*!
* Default constructor for mesh.
* @param nNodes[] is a vector with the number of nodes in the x, y, or z direction.
*/
mesh();
mesh(vector<unsignedint>& nNodes, unsignedint nNeighbours, const vector<double> &dimensions);
mesh(unsignedint nx);
mesh(double length, unsignedint nDecades, unsignedint pointsPerDecade);
mesh(double length, unsignedint nx);
mesh(double lenght, vector<double> xpos);
//!Destructor
~mesh();
//!Copy constructor
mesh(const mesh & _mesh);
[...]
Yes, if you are familiar with function overloading you will realize that constructor overloading works the same way.
By the way, there are some minor differences between using the constructor with parenthesis vs using the constructor with curly braces vs using the = sign, but I won't go into too much detail because it's very technical and differs between C++03 and C++11.