Return reference, throwing exceptions

 

Suggestion that would massively improve the MQL5 language.


Return reference.

Currently you can't return a reference, adding this feature would enable full support for overloading the operators, for example, the index operator[] which would allow us to use a class that simulates the C++'s Vector class behavior using the syntax:

SomeCollection<SomeClass*> test;

// Since the operator[] would return a reference to the class's internal array, this assignment would work.
test[0] = new ...;

Throwing exceptions

Exceptions makes the code more concise, instead of having to check for error on every function call, we could have a dedicated place to handle and log them.