Errors, bugs, questions - page 2653
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
Well, STL is not a one-size-fits-all solution. You have to pay much attention to specifics here.
You're confusing soft with warm.
It's not a question of STL. I'll figure it out there myself... (if someone doesn't have it, it doesn't mean that it can't be done in principle)
The easiest way to implement all the possible functionality with abstract methods in a base class or interface, and in the descendants - either implementation or =delte.
In this case, you need to pass pointers or references of the same type to the methods of the base class.
Although there is an unavoidable evil in the form of a virtual table, but it's better to arrange the architecture in such a way that there is no expensive branching via dynamic_cast anywhere.
The method you suggested was implemented earlier and also hinges on the same bug:https://www.mql5.com/ru/forum/1111/page2648#comment_15015191
The bug is in the priorities of calling reloaded functions when an implicit type conversion is performed for a pointer/class parameter.
In C++ all is OK, but in MQL the compilation error"ambiguous call to overloaded function"
One of the workaround variants is suggested above, but it is large and not convenient, and I have no desire to use it for a dozen of similar functions.
Perhaps there is something simpler?
Developers, please advise, are there any plans to fixthe bug or is this architecturally impossible?
Inside a template function, a passed pointer within an explicit type conversion behaves like a class, causing a compile-time error accordingly:
Dumb, can't solve a simple problem. I need to understand that trading is forbidden during the following EA startup settings.
This check does not work.
OrderCheck is a red herring. Please advise.
ANATOLI KAZHARSKI code
Thanks, didn't notice the MQL_TRADE_ALLOWED.
Dumb, can't solve a simple problem. I need to understand that trading is forbidden during the following EA startup settings.
This check does not work.
OrderCheck is a red herring. Please advise.
Probably the reason is the work of template class generator cache.
Bug MT5(build 2340) uses the same code twice: first pass - successful compilation, second pass - compilation error.
Apparently the problems are related to the template function generator cache.
The error disappears if for the template function "void run(const T &ff)" the transfer by reference is replaced by the transfer by value"void run(const T ff)".
Bug MT5(build 2340) Compilation error when attempting to access the internal class for a template parameter of a template function.