Errors, bugs, questions - page 2272
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
One is only created. Moreover, in f you will not be able to use T.
Moreover, in f you will not be able to use T. All in all, the situation is obvious to me.
Moreover, violated your prohibition to use T in f
As you can see it compiles without errors, and the fact that the result is absurd is not important as long as everything is "explainable".
What is the sacred meaning of this code, why did they cram it into the standard library at all?
Now it is impossible to use functions of closing positions or orders from the standard library in OnDeanite, for example with REASON_REMOVE
What is the sacred meaning of this code, why did they cram it into the standard library at all?
Now you can't use functions to close positions or orders from the standard library in OnDynit, for example with REASON_REMOVE.
Yes, that's a bug.
Moreover, I violated your prohibition to use T in f
As you see, it compiles without errors, and the fact that the result is absurd is not important - the main thing is that everything is "explainable".
You don't quite understand what templates are. They are similar to macros only with certain features.
Here is the code
.
That's because T is a setup, like macros, only with certain caveats. What we have in the end is that a signature is created. Inside the function nobody knows about A which is substituted for T in the function. But you define this A inside, so no further compilation error occurs. I inserted MqlTick inside to show that this A has nothing to do with other classes of the same name.
In short, the intraclasses in MQL5 are not visible outside the parent function. Only the name of the type as a class is passed as T. In this case the name has no reference to the parent function.
I.e. everything is quite logically explainable. It's not a bug, but such a limited implementation.
Maybe at a job interview a C++ programmer would say that this is impossible.
MQL5 is quite possible.
You don't quite understand what patterns are.
ZS Probably a C++ programmer at a job interview will tell you that this is impossible
If you think that this is impossible in C++ it means that it's not me but you who doesn't understand what templates are and how they work... all the more that you can't tell a sloppy implementation from a constrained one
If you think such a thing is impossible in C++ - that means it's not me, but you don't understand what templates are and how they work... all the more so that you can't tell a sloppy implementation from a bounded one
Read the first word of the sentence you give your comment on. My understanding of templates and macros in MQL5 is such that I realise without trying to compile that your examples won't compile in MQL5. C++ - I don't know, that doesn't prevent it.
I would be grateful if you could show how C++ reacts to this code
Forum on trading, automated trading systems and strategy testing
Bugs, bugs, questions
fxsaber, 2018.09.03 07:16
ZS Probably a C++ programmer at a job interview will tell you that this is impossible
I'd appreciate it if you could show me how C++ reacts to this code.
You don't really understand what templates are. And they are akin to macros, only with some tricks.
Yes, this example will not compile on the pluses
but even if it compiled, the result would surprise you because the class name would just be "T".