Errors, bugs, questions - page 3101
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
In b3095 I run a script:
If you remove the overload f1(T* & Ptr), all 5 calls return void f1<const X>(const X*const).
Is this some kind of feature?
Please explain:
Line *1* gives a compiler error - expected.
But line *2* compiles and works fine. Why?
Please explain:
Line *1* gives a compiler error - expected.
But line *2* compiles and works fine. Why?
You need to show a clear contradiction (that you changed const value):
And you suggest that both experienced Users and Developers should guessvalue change
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5 language, subtleties and tricks
My idea is to use mql5 as a forex trading system, and I would like to use it in my own practice.
Is it possible to change the fieldsof a const objectof a class or to call its non-const methods? -You can!Don't like this chip myself. Thought I was insured against unauthorised access. Bummer, though! It doesn't work with const structures, of course. So keep this loophole in mind.
You need to show a clear contradiction (that you have changed the value of const):
And you suggest that both experienced Users guess and DevelopersYes. But in your example you have an explicit (via a function) conversion of const T to T - i.e. a "legalised" loophole.
((A*)(&a)).i = 1;
similarly - (const A*) convert to A*.
((A)a).i = 1;
Your example explicitly converts const to non const, and there it is clean