That's right, it has to be, otherwise what's the point of specifying
instead of
To work with standard collections, a class must not have const methods, because not every class can do this, but every class can use standard collections. The const constraint is imposed by an external function and it is its right, but it is not allowed to impose constraints on the architecture of third-party objects.
C-4: The const constraint is imposed by the external function and it is its right, but it has no right to impose constraints on the architecture of third-party objects.
Explain then what sense you put by specifying below const - just to be?
Explain then what point are you making by specifying below const - just to be?
This is a question to the developers of the standard library, not to me. Unfortunately, if you want to use Compare, you must redefine it according to its signature, i.e. use const. Otherwise standard search, sorting and paste algorithms won't work with my objects. But my objects do not contain const and by virtue of their structure cannot contain const. So the question is, why can't I use standard storage algorithms just because I don't have access to this damn const? !!!!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
That's right, it has to be, otherwise what's the point of specifying
instead of
A* B::a = new A;Constructor A is not static, trying to call it will naturally cause an error:
The const constraint is imposed by the external function and it is its right, but it has no right to impose constraints on the architecture of third-party objects.
Explain then what sense you put by specifying below const - just to be?
Explain then what point are you making by specifying below const - just to be?
Constructor A is not static, trying to call it will naturally cause an error:
This is actually a valid initialization. Static in a class has nothing to do with the object which is static.
And the fact that it doesn't compile really looks like a bug.
Fleder, thanks for the clarification! Do the authors of the project keep a changelog on MetaEditor and the MQL language?
Fleder, thanks for the clarification! Do the authors of the project keep a changelog on MetaEditor and the MQL language?
So the question is, why can't I use standard storage algorithms just because I can't access the damn const? !!!!
Announcement
doesn't mean that class A has to have only const methods. It only means that in f() itself only const methods can be calledThis is actually the correct initialisation. A statik in a class has nothing to do with an object that is a statik.
And the fact that it doesn't compile really looks like a bug.