Whatever your approach is, this is the same for C/C++.
Whatever your approach is, this is the same for C/C++.
As far as I am aware, MQL4 implemented pseudo-pointers on Classes only, any other type does not "have a pointer" that we as developers can use. I was hoping to be able to generate the function call and "save" it in an array that I could iterate through the list of callables every update (once per candle). As that does not seem possible, I am going with my backup plan of using a template<typename Key, template value> in an array that a router function will have to read and generate the callable based on the function name being passed in. Basically a a digital version of the old phone switchboards.
From what I understand of your advice is that if the function signature is "the same" (not via overloading but by design) by using the same arguments/parameters I would be able to build a routing function but the argument types would have to be harmonious in nature. My question is two-fold now:
Is there something similar to C11's "..." Keyword for passing optional params?
Could I pass the arguments inside an &array to the router so it's more versatile? (error handling required obviously)
if anyone has something more elegant I would be super grateful to hear it.
"MQL5 allows creating pointers to functions using typedef." is the exact wording on typedef unfortunately. Looks like I'm either better making a DLL in C++ for this or simplifying my plans.
Thank you so much for the help!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I am looking for a way to call a literal array of functions and found ways in C++ to do this however MQL4 is obviously different. In C++ you can use pointers of the function to call it by, or in the standard library std:function is included which is what I am trying to mimick.
Is there any way to actually accomplish this without having some sort of explicit pointer? Do I need to do some cluster of inherited classes or something convoluted or stupid like that?
Please let me know if you need clarification or have an idea.
Thank you!