Generic Class Library - bugs, description, questions, usage and suggestions - page 27
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
What do you create collections for, for collections and automatic deletion of objects?) I didn't say anything about manual operation at all. Where did you get that from?)
Study STL and you'll understand what I'm talking about.
how to copy correctly, can you give an example for this template?
I used the help to write the AddValue methodhttps://www.mql5.com/ru/docs/basis/types/classes
I racked my brains, but I don't see any other solution in MQL than I wrote in my example!
Show me your implementation of correct data storage.
But this solution is wrong anyway. A normal solution is to use something like STL. In your case std::list.
I think MQL5 doesn't limit it. You can try to translate STL sources from the same VS to MQL
That's what I mean in your case.
But it's still the wrong solution. The normal solution is to use something like STL. In your case std::list.
I don't think MQL5 doesn't limit it. You may try to translate STL source code from VS to MQL
Once again: MQL is not C++,
and a pointer to an object in MQL is in fact a handle, and a pointer in C++ is a physical memory address.
what's the point of porting C++ libraries to MQL ?
Once again: MQL is not C++,
and a pointer to an object in MQL is in fact a handle, and a pointer in C++ is a physical memory address
what's the point of porting C++ libraries to MQL ?
To properly implement the design patterns instead of creating potential problems using generics.
You must be surprised but the pointers for the operating system are virtual too. You still have to convert them into physical ones, but this is a completely different level of work with pointers.
You won't be able to port 1 into 1, but I think you will be able to port a stripped-down C++03. Support of templates and operators is available.
1. You may be surprised, but pointers for the OS are virtual too. They still need to be converted into physical ones, but that's a whole other level of pointer handling.
2. You won't be able to port 1 into 1 but you will be able to port the stripped-down C++03. Support of templates and operators is also there.
1. I would not be surprised
2. Well, here's the truth - even if you get together and make a port from C++, it will still cause questions, but why not as in the original? - what is the point?
There is a standard library of MQL, using it at least some kind of guarantee that the support will be provided by developers in the future. I've already been burned a couple of times - I used graphic components from articles written a few years ago, it's easy to use, much like working with Delphi components, but when I started trying to implement more serious projects I got a lot of questions and no response from the author of the article
I do not remember who of the prominent programmers said, but something like this: the code should not be beautiful or readable, it must perform its task
as our discussion, if I'm not mistaken, you wanted to store a structure with your data in lists, I showed you my implementation, which I developed for the same task - does my implementation work? - does it cause runtime errors in MQL-programs? - I am curious to find out in the course of the conversation
Andrey Pogoreltsev:
C++03 is possible, I think. Support for templates and operators is available.
Well yes, good luck ))
The code does not have to be pretty or readable, it has to do its job
This is only true until you want to refine it.
I have already pointed out this bug in CLinkedList class, but I will repeat it. The beginning and end nodes of the list are closed to each other: Next of the last node points to the first node, while Previous of the first node points to the last one. As the result, the standard search loop turns into an infinite loop:
In C# such nonsense is naturally not observed. The Next of the last node is zero, as well as thePrevious of the first n ode.
I don't know if it's some "feature" invented by developers (although I don't see its usefulness), but in any case the library's behavior should correspond to the original one.
I have already pointed out this bug in CLinkedList class, but I will repeat it. The beginning and end nodes of the list are closed to each other: Next of the last node points to the first node, while Previous of the first node points to the last one. As the result, the standard search loop turns into an infinite loop:
In C#, naturally, there is no such nonsense. The Next of the last node is zero, as well as thePrevious of the first n ode.
I don't know if this is some "feature" invented by the developers (although I don't see any benefit from it), but in any case the library's behaviour should correspond to the original.
What the hell is going on here again? They're deleting perfectly good LinkedList posts. Just like that, somewhere in Europe, an anonymous moderator is deleting posts from hated Russians while sniggering maliciously. What a dump, it makes you not want to write.