Errors, bugs, questions - page 1354

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
Gentlemen, how would you like to significantly improve the usability of the language by addingproperty: https://msdn.microsoft.com/en-us/library/x9fsa0sw.aspx
The constant dancing with setters, getters and brackets is very annoying.
Gentlemen, how would you like to significantly improve the usability of the language by addingproperty: https://msdn.microsoft.com/en-us/library/x9fsa0sw.aspx
The constant dancing with setters, getters and brackets is very annoying.
Alexey, I'm all for it, but we should do a vote, not here. There are some crutches here, I haven't tried it in MQL http://rsdn.ru/article/vcpp/props.xml
There's something wrong with the encoding on your link. I'm getting a lot of red text. But I know what you mean, I've read about these crutches before. It's not possible to implement it in MQL at the moment, because ghost operator overloading is not supported.But this native feature in VS is very useful, especially when wrapped in a macro. And it doesn't consume any additional resources. So, it's high time we implement properties in MQL too, because everything looks clumsy without them.
I figured it out, found a bug in MQL4 compiler. I was inattentive and it took me 2 days to find it. The essence of the problem is this: I will give you the simplest code. I don't get a compilation or warping error, I get a runtime error.
There is no need for any mistake here. There is a clear type conversion here. It would be like this in VS
What difference would it make?There is no need for any mistake here. There is an explicit type conversion here.
You cannot cast a class to a meaningful type, even explicitly. It is definitely an error.
It's not a class, it's a pointer, and a pointer is a number.
C++ compiles without errors
If you disallow a direct explicit conversion to double, the next time it will have int instead of double with the same result and the compiler will be guilty again. You have to distinguish your own errors from the compiler's errors.
It's not a class, it's a pointer, and a pointer is a number - learn the math.
C++ compiles without errors
If you disable direct explicit conversion to double, the next time it will have int instead of double with the same result and the compiler will be guilty again. You should distinguish your own errors from the compiler's errors.
There is no pointer there, because pointers do not exist in MQL4/5. There are handles.
----------------------
I've received an answer from Service Desk
Indeed, there must be a compilation error here.
Support Team 2015.08.24 14:39
There is no pointer there, because there are no pointers in MQL4/5. There are descriptors.
A descriptor is still a specific number
But it makes no sense to convert a descriptor to a number or vice versa, and it's most likely a bug in the code.
In the near future, if an appropriate conversion statement is overloaded in the class, it will be called.