Errors, bugs, questions - page 1965
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
Exactly! Now I can call f all sorts of functions and variables at once. There must be some common sense in such ambiguities, so as not to cause accidental errors. In my opinion, it's logical to bamboozle by issuing an empty string to typename f, rather than causing problems when you accidentally pick up and define another f.
Don't be so stubbornly searching for common sense everywhere, especially among bugs. If you listen to you, any bug in MQL is not a bug at all, but a feature that has been included by the wise developers ))
As already noted, if you have any doubts, the first thing to do is to check it in C++, and then come up with a solution.
As for ambiguities, they should cause a compiler error and no problems. Everything was clear and unambiguous in sample A100, so I don't quite understand what you mean. If you need to overload a function, you overload it and fix the compilation errors in ambiguities and that's it.
How do I initialise a static member of a template class in MQL?
How do I initialise a static member of a template class in MQL?
How do I initialise a static member of a template class in MQL?
A100:
In general, of course, this method does not correspond to C++, but it works in MQL.
I had a similar problem with method outside the class:
Thanks to you the solution has been found:
Although this is also wrong of course, because it means defining a template method, not a method of a template class. And if a class contains both, there will be ambiguityI had a similar problem with taking a method outside the class:
This is much more convenient. The only restriction is that you can't have another class (like in the example) in between
Forum on trading, automated trading systems and strategy testing
Errors, Bugs, Questions
A100, 2016.05.19 23:26
Compilation error
because it means defining a template method rather than a template class method. And if the class contains both, there will be ambiguity
It won't - it's all been thought out before us (c). You have to repeat the template line twice (the top one will refer to the class - the bottom one to the method)
Man, this looks really messed up.
A100:
It's much more convenient that way.
Yeah, well, not having to put <T> is just such a serious convenience.)
Yeah, not having to put a <T> is such a serious convenience.)
I had a similar problem with taking a method outside the class:
wrong of course, as it means defining a template method rather than a template class method. And if the class contains both, there will be ambiguity.
I notice that methods are often placed outside the class, but why? I looked through the SB, so "small" methods are defined in one line at once, "long" methods are defined outside of the class. There is no perception convenience, because ALT+G in external definition offers not one, but two transition points. And if there are overloads, then a multiple of two, respectively. And ALT+M already shows everything at once.
Perhaps this is some kind of tribute to the clarity of the interface definition, but so far I haven't gotten into it.