Errors, bugs, questions - page 2719
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
Constructor only because you can't initialise a const field without it. Structure or class - doesn't make any difference. The main thing is to have an object.
It's up to you.
It's up to you.
I didn't think const fields were contrary to general practice.
I didn't think const fields were at odds with general practice.
No )), I just thought it should be right on the structures. Why do we need any crutches then? It's quite elegant, make an array, loop around and do set(). If there's an error in the logic (repeated call somewhere), you'll get a crash.
I don't think it's worth sticking your nose in someone else's swamp.
I don't think it's worth sticking your nose in someone else's swamp.
Junkie? fxsaber asked for advice, I told him.
In my opinion, it is logical to write const for fields that will never (and should never) be changed after creation.
No. They make const fields in very rare cases. And not for simple types.
A junkie? fxsaber asked for advice, I answered.
Keep it simple and you'll be approached...
No. Constant fields are made in very rare cases. And not for simple types.
A simple example. You need an array of MAUs with preset periods.
Each one of them is an object of one type. It is clear that an object of one type is uniquely set by its period. That's why it would be logical to make it const.
Other languages simply make an array of pointers. There is no such freedom in MQL.
No. Constant fields are made in very rare cases. And not for simple types.
Do you know how the MQL optimizer and compiler are set up?
How can you be so sure that const fields of simple types are not used for this purpose?