MT4 has no concept of inner classes. It is the same as if you wrote them separately.
class Out{ class In{ public: int i;}; In out[2]; Out(){out[1].i=1;} }; int OnInit(){ In a; // Private Definition of In is visible here. return(INIT_SUCCEEDED); }
William Roeder:
MT4/5 has no concept of inner classes. It is the same as if you wrote them separately. So don't bother.
That's not true for mql5.
MT4/5 has no concept of inner classes. It is the same as if you wrote them separately. So don't bother.
Amir Yacoby:
#include seems to work well.
Is it possible to write an inner class without placing the whole inner class inside the parent class?
Something like include, or writing it elsewhere as to not interfere the clarity of the outer class?
William Roeder:
MT4/5 has no concept of inner classes. It is the same as if you wrote them separately. So don't bother.
MT4/5 has no concept of inner classes. It is the same as if you wrote them separately. So don't bother.
That was changed for MT5 when they introduced scopes and namespaces - see #7
Alain Verleyen:
#include seems to work well.
#include seems to work well.
I was sure to test it, thank you
Actually I tested with more complex class and it failed, but probably for other reasons
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Is it possible to write an inner class without placing the whole inner class inside the parent class?
Something like include, or writing it elsewhere as to not interfere the clarity of the outer class?