You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
You want (as I think is obvious) - to get overridden names in filename variables...
For Init() to work properly, it must be called after constructing the object.
Or not?
I think the VMT is only initialised in the terminating code of the constructor, so when you call a method in the constructor, it will call a method of type variable, not of type constructible object.
That's something like this.
At least this one works:
To MetaQuotes: If I got it right, it's better to prohibit calling virtual functions in constructors altogether. To.
Or make them work correctly. Which I doubt.
Just getting to know parametric constructors. But it seems that in the example
The parentheses in the highlighted line are incorrectly placed.Just getting to know parametric constructors. But it seems that in the example
in the highlighted line has the wrong parentheses.Technical post (start of a small discussion on initialisation, also in constructors). Moved, so it doesn't get lost under the heavy footsteps of the newbies: https://www.mql5.com/ru/forum/58/page31#comment_66890
A question about initialisation. As a general rule, initialization of string variables and complex objects is done automatically, "by default". This wastes a certain amount of computing power of computer (I call it "computer clock", sorry for amateurish terms).
Now there are initialisation lists that allow you to initialise variables with custom values. Is there any difference in initialisation speed between automatic initialisation and initialisation with a custom value? In other words, does the number of "computer strokes" when using initialisation lists (and custom values) increase compared to automatic initialisation?
And if we save a few clock cycles, will it give a significant gain? Especially since the initialization is done once, and the values will still have to be assigned later.
This is an important question for me personally, because I want to understand the technique.
The right approach, everything would be like that. Initialization lists are a consequence of the introduction of parametric constructors.
Let's examine two examples:
It is all written in the comments.
Example 2:
So, in variant 1 we have 1 call of Init and in variant 2 we have 2 calls. And since the "like" function is very heavy, there's an upside.TheXpert, thank you very much! I'll look into it.
I understood indirectly from your words, that there is no difference in speed between auto-initialization of variable of " string, dynamic array and complex object" type and user initialization of the same variable.
I've implicitly understood from your words that there is no difference in speed between auto-initialisation of a variable of " string, dynamic array and complex object" type and user initialisation of the same variable.