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
Perhaps by "normal implementation" you mean implementation on templates.
What's that like? What do you mean by patterns? Some special twisted way of pressing the keys with your fingers while programming?
Templates, as a legacy of the old compile-time macro substitution method, have actually lost their relevance for object-oriented programming long ago.
In modern languages such tasks are solved by runtime tools, for example, generics in C#, dynamic type recognition RTTI and the use of variant types.
There are of course still oldboys who like templates, but IMHO as a programmer it is a sign that it is time to retire.
Templates, as a legacy of the antiquated compile-time macro substitution method, have actually long since lost their relevance to object-oriented programming.
In modern languages such tasks are solved by runtime tools, for example, generics in C#, dynamic type recognition RTTI and application of variant types.
Of course, there are still oldboys who like templates, but IMHO as a programmer it is a sign that it is time to retire.
It's funny to read ) templates have long gone far away from macro substitutions and exist quite successfully as a separate paradigm.
Generics in C# are just very reduced templates and actually not runtime but compilation time, due to which their speed is higher ).
But just RTTI and variant types suggest some bad thoughts....
____________________
Okay, all this is cool, of course. But in MQL5 there are only template functions, there are no classes (will there be?). So, lists on templates are not realisable with the current tools.
Funny to read ) templates have long since moved far away from macro substitutions and exist quite successfully as a separate paradigm.
Generics in C# are just very reduced templates, and in general it is not the runtime but the compilation time, due to which the speed of their use is higher ).
But just RTTI and variant types suggest some bad thoughts....
____________________
Okay, all this is cool, of course. But in MQL5 there are only template functions, there are no classes (will there be?). So, lists on templates are not realisable with the current tools.
You are happy because fossil paradigms are your warm memories of the past century and seem to be an exhaustive baggage of knowledge.
But there is no need to eclipse modern approaches because of this, because MQs will assume that their customers are nostalgic for grandfather Macro Assembler and ANSI C and ignore suggestions for improving MQL5.
.
Since there are no templates, you can do it on macros, someone I think even wrote an article on this topic (macros instead of templates) + analogue of algorithms in stl also on macros. But imho all this should be in the standard library on templates, it is wrong somehow to write your own containers (useful only for educational purposes), it is easier to do with an array.
upd: no need for algorithms on macros, function templates are available. I don't like virtual insert/... , it is better to use type-checking asserts in debug mode.
Hello,
I try to compile test_MQL5_List.mq5 , I got the following errors :
'm_head' - member of the constant object cannot be modified CiSingleList.mqh 504 9
'm_tail' - member of the constant object cannot be modified CiSingleList.mqh 505 9
'm_size' - member of the constant object cannot be modified CiSingleList.mqh 496 9