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
I wonder is it possible to pass function to method as argument in case that method is template.
Valid C++ example of how I want to do:
I have read documentation from this link: https://docs.mql4.com/basis/types/typedef
According to this documentation it looks like MQL allows to pass function as argument only if you define all function input/output parameter types statically. So, most likely MQL does not allow such flexible definitions like C++ does, but I just want to make sure. Does anybody know any solution for that? :)
Example of the problem in MQL:
The problem is if I will want to have function
number* ConvertFunction2(number* model){ return model; }
then my template won't work. The compiler throws "'ConvertFunction2' - cannot resolve function address" and "'Convert<number>' - object pointer expected". Looks like function can't be defined with arguments from template types.