Errors, bugs, questions - page 1707
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
The pointer is assigned rvalue, which is then overwritten with new A.
Where? Right here?
this[0] = new A;
Here operator[] returns the value contained in cell Data[0]. Not a reference to this cell or a pointer to it, but just a copy of the value contained in this cell, i.e. rvalue. Nothing can be assigned to this copy, of course. I don't understand how operator= changes this.
And I still don't understand the last example. Overloading the "=" operator in class A turns this[0] from rvalue to lvalue... I can't figure out how. Is this some kind of MCL feature, there's no such behaviour in the pros.fxsaber, how did you even get to this construct? I mean overload = in A. Or by trial and error?
Forum on trading, automated trading systems and strategy testing
Libraries: TypeToBytes
fxsaber, 2016.09.21 21:25
Published. Now for any variable (structure or standard type) not only reading works like with array, but also WRITE:
_W(AnyVariable)[Pos] = AnyValue; // Записывает по байтовому смещению Pos значение AnyValue в переменную AnyVariable
It wasn't easy to guess before the implementation - probably turned out to be a good test of average OOP proficiency: I only know the classics for classes.
If anyone knows something similar, please share the link for education.
With full understanding I did. Otherwise I wouldn't have written such a thing.
So you understand everything, but you can't say it? )) I see.
Where? Right here?
this[0] = new A;
Here operator[] returns the value contained in cell Data[0]. Not a reference to this cell or a pointer to it, but just a copy of the value contained in this cell, i.e. rvalue. Nothing can be assigned to this copy, of course. I don't understand how operator= in the A class changes this.
Perhaps it's all about those same issues with references in MCL.
It may turn out that it's not the value returned here, but rather a reference to it, i.e. lvalue... But why can't it be assigned a new value right away, why do we need operator= in the A class? I don't understand...
Probably, it's all about the same reference stuff in MKL.
As if it didn't turn out that it's not a value that's returned here, but a reference to it, i.e. lvalue... But why can't it be assigned a new value right away, why do we need operator= in the A class? I don't understand...
When you assign something to a rvalue-pointer, the pointer is automatically cast to an object reference. Well, everybody was born yesterday!
I've been asking the Desk for that for a long time, but they say it's not safe, although in fact it's not any more dangerous than passing arguments by reference.
When you assign something to a rvalue-pointer, the pointer is automatically converted to an object reference. It's like yesterday, isn't it?
Type mismatch
MqlTick time_msc - long.
CopyTicks from - ulong.