- Mini summary
- MQL5 Wizard: Development of trading robots for MetaTrader 5
- Editing, compiling, and running programs
For the following code I'm getting this warning:
class A { public: void Add(){} }; class B: public A { public: void Add(int x) { Add(); } };
the B::Add(int x) function is an overloaded version of A::Add(). Logically I expect the compiler to consider it as the following code:
class B { public: void Add(){} void Add(int x) { Add(); } };
The problem is where you want to extend a generic class, a simple call to the Add function has to be written like:
AGenericClass<ulong, CHashMap<int, CObject*>*>::Add();
It is not a bug.
This was already posted somewhere but can not find the link.
Try:
void Add(int x) { this.Add(); }
It is not a bug.
This was already posted somewhere but can not find the link.
Try:
Your code will generate the same warning. Right now MQL5 is working like java. Removing this deprecated behavior as said in the warning makes it work like C++.
The only workaround is:
void Add(int x) { A::Add(); }
Your code will generate the same warning. Right now MQL5 is working like java. Removing this deprecated behavior as said in the warning makes it work like C++.
The only workaround is:
I understand that methods calls needs to be qualified but how to qualify the iCustom function? I get the same warning here:
m_zz_handle = iCustom(Symbol(),0,"MyZigZag.mq5",m_zz_depth,m_zz_deviation,m_zz_backstep);
-> ?::iCustom
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use