Errors, bugs, questions - page 1135
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Please post all your code.
This is an example from mql5 documentation. Here's a link to that page. And below is this code.
It seems that with the update, not only the mandatoryplacement of static class data members was introduced,
but also removed the implicit call to the parametric constructor.
Use an explicit call:
On what grounds have they cancelled conversion of non-constant objects to constant ones?
Everything compiles normally - no errors or warnings
If there are any errors, it is only in struct, but they will get to them eventuallyEverything compiles without errors or warnings
If "A" contains a non-constant method, but is itself passed to the function as a constant object, it is now impossible to call this non-constant method in the function.
And now attention question: let's wipe the CObject.Compare():
O.k. it's a constant method that takes a constant object node. It's his right to declare node as constant. But on what basis should Compare now only work with constant methods of node? Node is not obliged to have constant methods for the sake of Compare. But it turns out that just on the grounds that the object is complex and has no constant methods, now he can not use the standard library with all that it implies!!!It is now mandatory to place static members.
And how are you supposed to place complex static objects if static constructors are not allowed?
If "A" contains a non-constant method, but is itself passed to the function as a constant object, then this non-constant method cannot now be called in the function.
That's right, that's how it should be, otherwise what's the point of specifying
instead of
void f(A* a)
If "A" contains a non-constant method, but is itself passed to the function as a constant object, then this non-constant method cannot now be called in the function.
And how are you supposed to place complex static objects if static constructors are not allowed?