Use CArrayObj instead and make sure your classes inherit CObject
nicholish en:
Use CArrayObj instead and make sure your classes inherit CObject
Use CArrayObj instead and make sure your classes inherit CObject
Suspected I'd need to inherit some classes indeed.
Will try to, thanks!
Are the Generic Data Collections (CSortedSet<T> etc) not designed for custom classes?
Can T only be primative MT5 types like int, double etc?
I thought the whole point of the Generic Data Collections library was to allow you to use your own classes in the collections, but I also just get these errors....
Can T only be primative MT5 types like int, double etc?
I thought the whole point of the Generic Data Collections library was to allow you to use your own classes in the collections, but I also just get these errors....
WorthyVII #:
Are the Generic Data Collections (CSortedSet<T> etc) not designed for custom classes?
Can T only be primative MT5 types like int, double etc?
I thought the whole point of the Generic Data Collections library was to allow you to use your own classes in the collections, but I also just get these errors....
Are the Generic Data Collections (CSortedSet<T> etc) not designed for custom classes?
Can T only be primative MT5 types like int, double etc?
I thought the whole point of the Generic Data Collections library was to allow you to use your own classes in the collections, but I also just get these errors....
mql5 is limited in terms of generic code unfortunately.
You need to use pointers not objects.
Except that restriction the generic classes are working pretty well.
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
Hi,
I am trying to use the CArrayList<T> list using a specific class of mine, that is not complex at all, but I am bumping into very basic errors which I did not mange to solve.
Do you know of any libraries or source codes that use CArrayList or similar generic structures so I can read them and try to learn by example? The documentation for these do not provide any examples and I did not find any either here in the forum.
For instance, I was trying to code a very simple logic to test these generic collections and even this I did not manage to get working:
Then I tried declaring a list these ways:
and
But I always get bunch of errors like:
These are all certainly very basic errors, but I fear my C++ is kinda rusty nowadays and I did not find many examples to help me understand how I should be using MQL5's generics.
Could you point me in the right direction or give me some practical examples?
Thanks!