It usually means that after some future version upgrade, it can start to behave according to the documentation.
They wrote it like this because they planned constructors to behave as is written. Nobody outside MQ can't know if this will be a new feature or they'll consider it a bug and fix it.
Use it as is documented or be ready for a possible surprise in the future.
"The constructor, all parameters of which have default values, is not a default constructor."
But, to me, it looks like that the documentation is wrong, and a user-defined constructor with parameters having a default value behaves exactly as a default constructor (without parameters).
If anybody is around, please correct the documentation...
When classes were introduced into MT4 Build 600 (2014.02.03) you couldn't create arrays of them without a default constructor. Now in Build 1280 (2020.07.24) you can.
This is a user's forum not MetaQuotes. No one here can correct the documentation.
When classes were introduced into MT4 Build 600 (2014.02.03) you couldn't create arrays of them without a default constructor. Now in Build 1280 (2020.07.24) you can.
This is a user's forum not MetaQuotes. No one here can correct the documentation.
Thank you so much William. I did not want to "complain", but to let other people like us knowing about this inaccuracy. Can you suggest how would it be possible to contact MetaQuotes for having them taking care of such things and maintain documentation current?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear friends,
Just to let you know (and perhaps MetaQuotes people could correct errors). I refer to https://www.mql5.com/en/docs/basis/types/classes#class, the article of the documentation that refers to structs, classes and their constructors (among others).
There is a sentence that says:
And there is an example there, of which I report just a snippet of code:
And later also the declaration of an array of the class:
// CFoo foo_array[3]; // This option cannot be used - a default constructor is not specified
Well, the author of the documentation goes on:
If you uncomment these strings
//CFoo foo_array[3]; // This variant cannot be used - a default constructor is not set
or
//CFoo foo_dyn_array[]; // This variant cannot be used - a default constructor is not set
then the compiler will return an error for them "default constructor is not defined".
Well, jsut try it and you will see: This statement is WRONG and the compiler can produce a very well-funcioning script if you uncomment those lines!
and
some lines below. The comment says: if there is no default constructor, then a parametric constructor with a default value is called.
And this is what exactly happens both for the instantiation of foo, and for the creation of the foo_array. In fact all the code brokes together only when we change the CFoo constructor by removing the default value from t:
So, I am sorry, and if anybody can provide an alternative explanation I will be happy. But, to me, it looks like that the documentation is wrong, and a user-defined constructor with parameters having a default value behaves exactly as a default constructor (without parameters).
If anybody is around, please correct the documentation...