Errors, bugs, questions - page 1691
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 spread values does theCopySpread() function producefor the corresponding chart period?
It is not clear whether it is the average, minimum or maximum, and the help of the function does not say anything about it.
What spread values does theCopySpread() function producefor the corresponding chart period?
It is not clear whether it is the average, minimum or maximum, and the help of the function does not say anything about it.
where, in the account or in the tester
ambiguous call to overloaded function with the same parameters
Is this a misunderstanding or a bug?
Is it my misunderstanding or a bug?
ambiguous call to overloaded function with the same parameters
Is this a misunderstanding or a bug?
Misunderstanding.
Well, that's it, I've answered it. ))))
To my understanding this code must behave the same in both cases.
That's what I think too.
Misunderstanding.
Well, that's it, I've answered. ))))
That stupid source code example took a long time to create. My sense of humour almost disappeared while I was creating it.
This dumb source example took a long time to create. My sense of humour almost disappeared while I was creating it.
(chuckles) Okay. )
In all the three versions of the call it is impossible to understand whether the argument is passed by value or by reference, so the compiler cannot choose which function to call. And the const modifier overloads them: void f(){} and void f() const {} are different functions. If in your example you declare one of the methods as const, then uncertainty will disappear: the compiler will select the desired method depending on whether the call is made from a constant object or not (the type of argument in your example does not matter).
Your object a is not a constant, so the method without const will be called all three times. If you declare an object as constant (A const a;), then a constant method will be called.
See what the output will be:
Good. )
In all three variants of the call it is impossible to understand whether an argument is passed by value or by reference, that's why the compiler cannot choose which function to call. And the const modifier overloads them: void f(){} and void f() const {} are different functions. If in your example you declare one of the methods as const, then uncertainty will disappear: the compiler will select the desired method depending on whether the call is made from a constant object or not (the type of argument in your example does not matter).
Your object a is not a constant, so the method without const will be called all three times. If you declare the object as constant (A const a;), then the constant method will be called.
All calls before that go through without any problems.
See what it prints out:
This is from another thread.